Creating an SPL Token on Solana
Creating an SPL token on Solana is a streamlined process enabled by the SPL Token Program, which allows developers to define new digital assets with complete control over supply, decimals, minting authority, and distribution. This guide walks through the creation of an SPL token using the spl-token
CLI tool, helping you understand each step under the hood.
🔐 SPL Token Program ID:
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
Prerequisites
Before proceeding, ensure the following:
✅ Installed Tools
Solana CLI: For interacting with the Solana blockchain.
SPL Token CLI: A utility for managing SPL tokens.
✅ Environment Setup
Your wallet is initialized:
Solana CLI is set to devnet or mainnet:
Your wallet is funded with SOL (to pay transaction fees):
Step-by-Step Token Creation
1. Create the Token Mint
This initializes a new token and returns its unique mint address.
You’ll receive an output like:
Behind the scenes:
A Mint Account is created to track total supply and configuration.
Your wallet is set as Mint Authority (can mint tokens).
By default, your wallet is also the Freeze Authority (can freeze token accounts).
📌 Save the token address. It is the permanent identifier for your SPL token.
2. Create an Associated Token Account
A token account is required to hold balances of a specific SPL token.
This command creates a token account associated with your wallet for the given mint.
💡 Solana wallets can have one associated token account per mint. This is not the same as your main wallet address.
3. Mint Tokens to an Account
To generate supply, mint tokens from your wallet to a token account:
Example:
This sends 1,000,000 tokens to your wallet’s associated token account.
Minting requires authority. If you revoke minting rights (recommended after distribution), this command will fail.
4. Check Your Token Balance
Or view all token accounts:
This confirms your SPL token balance is available in your token account.
5. Transfer Tokens to Another Wallet
To send tokens to another Solana wallet:
If the recipient doesn’t have a token account, the CLI will automatically create one if possible.
Optional Operations
🔐 Revoke Mint Authority (Cap Supply)
If you want a fixed supply:
❄️ Freeze Accounts (Security Option)
You must have freeze authority to perform this action.
Summary Table
Create Token
spl-token create-token
Generates mint address
Create Token Account
spl-token create-account <MINT>
Needed to hold tokens
Mint Tokens
spl-token mint <MINT> <AMOUNT>
Requires mint authority
Check Balance
spl-token balance <MINT>
Verifies token balance
Transfer Tokens
spl-token transfer <MINT> <AMOUNT> <RECIPIENT_ADDRESS>
Sends tokens to recipient
Revoke Mint Authority
spl-token authorize <MINT> mint --disable
Optional, for capping supply
Freeze Token Account
spl-token freeze <TOKEN_ACCOUNT_ADDRESS>
Optional, requires freeze authority
Final Thoughts
Creating an SPL token is a foundational step in launching products on Solana—whether DeFi tokens, NFTs, or DAOs. With just a few commands, developers can create fast, scalable assets with real utility.
Want to go further? Integrate your token into smart contracts using Anchor, add metadata via Metaplex, or distribute tokens via claim sites or Merkle trees.
Next: Revisit Whar are SPL tokens? for conceptual grounding.
Last updated