Skip to main content
Both methods return the complete ordered instruction set needed to create a mint — you don’t need to separately query rent, build a System Program create instruction, or initialize the mint. The key difference is which token program the mint belongs to: Token-2022 supports extensions (like metadata); SPL Token supports Metaplex metadata via a separate program.
Not sure which token program to use? See Token Programs for the trade-offs.
These methods return instruction lists. Add them in order to a transaction and use the Transaction Service to compile, sign, and submit. See Instructions & Transactions.

CreateToken2022Mint

Creates and fully initializes a Token-2022 mint in one call. Returns the complete ordered instruction set: System::CreateAccount → extension pre-init instructions → initialize_mint → extension post-init instructions (e.g. token metadata, update fields).

Request

payer_pub_key
Base58-encoded public key (string)
required
Pays for account creation. Must be a signer.
mint_pub_key
Base58-encoded public key (string)
required
The mint account to create. Must be a signer (new keypair).
mint_authority_pub_key
Base58-encoded public key (string)
required
The authority that can mint new tokens.
freeze_authority_pub_key
Base58-encoded public key (string)
Optional. Authority that can freeze token accounts. Omit to disable freeze.
decimals
uint32
required
Decimal precision. Common values: 9 (SOL-like), 6 (USDC-like), 0 (NFTs).
extensions
Token2022Extension[] (repeated)
Optional. Token-2022 extensions to enable at initialization. Extensions cannot be added after mint creation. Currently supported: metadata extension. Transfer hooks, transfer fees, and other extensions are coming soon.

Response

instructions
SolanaInstruction[] (repeated)
required
Ordered instructions. Submit in this exact order: System::CreateAccount → extension pre-init → initialize_mint → extension post-init.
lamports
uint64
Lamports deposited for rent exemption. Covers base mint size plus variable extension data.
space
uint64
Initial bytes allocated by System::CreateAccount. Token-2022 may realloc beyond this for variable-length extension data.

Code Examples

resp, err := client.CreateToken2022Mint(ctx, &token_v1.CreateToken2022MintRequest{
    PayerPubKey:          "YourPayerAddress...",
    MintPubKey:           "YourNewMintAddress...",
    MintAuthorityPubKey:  "YourMintAuthorityAddress...",
    Decimals:             6,
    // Extensions: []*token_v1.Token2022Extension{...}, // optional
})
if err != nil {
    log.Fatal(err)
}
// Add all instructions to your transaction in order
for _, instr := range resp.Instructions {
    tx.AddInstruction(instr)
}

CreateSPLTokenMint

Creates and fully initializes a legacy SPL Token mint. Returns System::CreateAccount + initialize_mint + optional Metaplex CreateMetadataAccountV3. Space is always 82 bytes for SPL Token mints.

Request

payer_pub_key
Base58-encoded public key (string)
required
Pays for account creation. Must be a signer.
mint_pub_key
Base58-encoded public key (string)
required
The mint account to create. Must be a signer (new keypair).
mint_authority_pub_key
Base58-encoded public key (string)
required
The authority that can mint new tokens.
freeze_authority_pub_key
Base58-encoded public key (string)
Optional. Authority that can freeze token accounts. Omit to disable freeze.
decimals
uint32
required
Decimal precision. Common values: 9 (SOL-like), 6 (USDC-like), 0 (NFTs).
metadata
MetaplexTokenMetadata (object)
Optional. Metaplex on-chain metadata. When provided, appends a CreateMetadataAccountV3 instruction.

Response

instructions
SolanaInstruction[] (repeated)
required
Ordered: System::CreateAccount, initialize_mint, and optionally CreateMetadataAccountV3.
lamports
uint64
Rent exemption lamports for the mint account.
space
uint64
Always 82 for SPL Token mints.

Code Examples

resp, err := client.CreateSPLTokenMint(ctx, &token_v1.CreateSPLTokenMintRequest{
    PayerPubKey:         "YourPayerAddress...",
    MintPubKey:          "YourNewMintAddress...",
    MintAuthorityPubKey: "YourMintAuthorityAddress...",
    Decimals:            6,
    // Metadata: &token_v1.MetaplexTokenMetadata{...}, // optional
})
if err != nil {
    log.Fatal(err)
}
// Add all instructions to your transaction in order
for _, instr := range resp.Instructions {
    tx.AddInstruction(instr)
}