Skip to content

​What Does Minting Do?

Minting creates new units of an existing token and increases the mint’s total supply. Only the mint authority can mint new tokens. The destination token account must already exist and must belong to the same mint.

​How to Mint Tokens

Minting tokens uses the Token Program’s MintTo or MintToChecked instruction. The examples below use MintToChecked, which requires the caller to provide the mint’s decimals so the instruction can verify the expected token precision before minting. The native mint does not support minting.

​Source Reference

ItemDescriptionToken ProgramToken Extension Program
MintThe mint state stores the mint authority and total token supply.SourceSource
AccountThe token account state stores the destination balance updated by minting.SourceSource
MintToA mint instruction that mints tokens to an existing token account without requiring the caller to provide the mint’s decimals.SourceSource
MintToCheckedA mint instruction that requires the caller to provide the mint’s decimals and checks that value before minting tokens to an existing token account.SourceSource
process_mint_toShared processor logic for minting tokens.SourceSource

​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 to Cargo.toml (tested with Rust 1.89 and 1.98):
Cargo.toml
Rust

​Python

This example uses solana (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.