Skip to content

Conversation

@pileks
Copy link
Contributor

@pileks pileks commented Jan 23, 2026

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_governor program 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:

  • An admin can grant/revoke minting rights to any address
  • Each minter can be capped to a maximum total they can ever mint
  • The admin retains the ability to reclaim the underlying mint authority

Architecture

Accounts

MintGovernor (PDA: ["mint_governor", mint, create_key])

  • mint: The SPL token this governor controls
  • admin: Address authorized to manage the governor
  • create_key: Signer used at initialization (allows multiple governors per mint)
  • seq_num: Monotonic counter for indexing
  • bump: PDA bump seed

MintAuthority (PDA: ["mint_authority", mint_governor, authorized_minter])

  • mint_governor: Parent governor
  • authorized_minter: Address permitted to call mint_tokens
  • max_total: Optional cap on cumulative minting (None = unlimited)
  • total_minted: Running total of tokens minted through this authority
  • bump: PDA bump seed

Instructions

Instruction Signer Description
initialize_mint_governor create_key Creates the governor account for a mint
transfer_authority_to_governor current_authority Transfers SPL mint authority to the governor PDA
add_mint_authority admin Creates a MintAuthority for an authorized minter
mint_tokens authorized_minter Mints tokens to a destination, respecting limits
update_mint_authority admin Modifies max_total for an existing authority
remove_mint_authority admin Closes a MintAuthority account, reclaiming rent
update_mint_governor_admin admin Transfers admin role to a new address
reclaim_authority admin Transfers mint authority from governor to any address

Mechanics

Minting Flow

  1. Admin calls add_mint_authority with max_total = Some(1_000_000) for address X
  2. X calls mint_tokens with amount = 500_000 → succeeds, total_minted becomes 500,000
  3. X calls mint_tokens with amount = 600_000 → fails with MintLimitExceeded
  4. X calls mint_tokens with amount = 500_000 → succeeds, total_minted becomes 1,000,000
  5. Further minting by X is blocked until admin calls update_mint_authority to raise the cap

If max_total = None, the minter has no cap (though total_minted is still tracked for accounting).

@pileks pileks self-assigned this Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants