In short
A mint account defines a token: its supply, its decimals, who may create more (mint authority), and who may freeze holders (freeze authority).You’ve used this in: Quickstart Step 3 Quickstart Step 5 Tokenized asset Step 2
What Is a Mint Account
A mint account defines and uniquely identifies a token on Solana, and stores the shared state that applies to all token accounts for that mint. The Token Program defines theMint account type as:
Mint Account Type
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v. The mint address uniquely
identifies USDC throughout the Solana ecosystem. You can view this mint on
Solana Explorer.
How to Create a Mint Account
Creating a mint requires two instructions:- The System Program’s
CreateAccountinstruction creates a new rent-exempt account and assigns the Token Program as the program owner of the new account. - The Token Program’s
InitializeMintorInitializeMint2instruction initializes the new account as a mint.
CreateAccount instruction and the mint initialization
instruction in the same transaction.
During mint initialization, the Token Program checks that the mint account is
not already initialized and is rent-exempt. The Token Program then writes the
mint authority, freeze authority, decimals, and is_initialized flag into
the mint account data.
Source Reference
| Item | Description | Token Program | Token Extension Program |
|---|---|---|---|
Mint | The base mint state stored in every mint account. | Source | Source |
InitializeMint | A mint initialization instruction that expects the rent sysvar account in its accounts list. | Source | Source |
InitializeMint2 | A mint initialization instruction that does not require the rent sysvar account in its accounts list. | Source | Source |
_process_initialize_mint | Shared processor logic for mint initialization. | Source | Source |
process_initialize_mint | Public handler for InitializeMint. | Source | Source |
process_initialize_mint2 | Public handler for InitializeMint2. | Source | Source |
Kit
These examples use@solana/kit.
Web3.js v3
These examples use the class-based@solana/web3.js v3 API with
@solana-program instruction builders.
Rust
Add these dependencies toCargo.toml (tested with Rust 1.89 and 1.98):
Cargo.toml
Rust
Python
This example usessolana (solana-py) 0.41 and solders:
Terminal
Python
Web3.js (legacy)
These examples use legacy@solana/web3.js 1.x with @solana/spl-token.
@solana/web3.js 1.x is no longer actively maintainedIt receives critical fixes only. Use Kit for new code. To migrate existing code, follow the Kit upgrade guide, or the web3.js v3 migration guide to keep the class-based API.To run this code, install 1.x with npm install @solana/web3.js@1. A plain npm install @solana/web3.js installs v3, which this code doesn’t run on.How to Add Metadata
A mint account only stores basic token information (supply, decimals, authorities). To add human-readable metadata like a name, symbol, and image to your token, you have two options:Metaplex Token Metadata
Add metadata using the Metaplex Token Metadata Program. Works with both, the original Token Program and Token-2022.
Token Extensions Metadata
Use the built-in metadata extension with Token-2022.
The metadata extension is only available for mint accounts created with Token-2022.
To add metadata to mint accounts created with the original Token Program, use the Metaplex Token Metadata Program.