Mint Governor Program #407
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new Solana program that enables delegated minting authority with per-minter limits. Instead of a single wallet holding mint authority, the
mint_governorprogram acts as a PDA-based intermediary that can authorize multiple minters, each with an optional cap on how many tokens they can mint.Motivation
Projects often need to grant minting capabilities to multiple parties (e.g., DAO proposals, performance package program, etc.) while maintaining central oversight. Directly transferring mint authority is all-or-nothing and irrevocable. This program provides a controlled delegation layer where:
Architecture
Accounts
MintGovernor (PDA:
["mint_governor", mint, create_key])mint: The SPL token this governor controlsadmin: Address authorized to manage the governorcreate_key: Signer used at initialization (allows multiple governors per mint)seq_num: Monotonic counter for indexingbump: PDA bump seedMintAuthority (PDA:
["mint_authority", mint_governor, authorized_minter])mint_governor: Parent governorauthorized_minter: Address permitted to callmint_tokensmax_total: Optional cap on cumulative minting (None = unlimited)total_minted: Running total of tokens minted through this authoritybump: PDA bump seedInstructions
initialize_mint_governorcreate_keytransfer_authority_to_governorcurrent_authorityadd_mint_authorityadminmint_tokensauthorized_minterupdate_mint_authorityadminmax_totalfor an existing authorityremove_mint_authorityadminupdate_mint_governor_adminadminreclaim_authorityadminMechanics
Minting Flow
add_mint_authoritywithmax_total = Some(1_000_000)for address Xmint_tokenswithamount = 500_000→ succeeds,total_mintedbecomes 500,000mint_tokenswithamount = 600_000→ fails withMintLimitExceededmint_tokenswithamount = 500_000→ succeeds,total_mintedbecomes 1,000,000update_mint_authorityto raise the capIf
max_total = None, the minter has no cap (thoughtotal_mintedis still tracked for accounting).