Solana's SPL (Solana Program Library) tokens are standardized digital assets built on the Solana blockchain. This guide walks you through creating, minting, and transferring SPL tokens using command-line tools, ideal for developers and crypto enthusiasts.
Step 1: Token Creation
Run the following command to generate a new SPL token:
spl-token create-tokenOutput Example:
Creating token E69iMAYn5k9HcWiPRZtthMDmyv1owgiWSbZCtTn9VMzy under program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
Address: E69iMAYn5k9HcWiPRZtthMDmyv1owgiWSbZCtTn9VMzy
Decimals: 9 Key Details:
- Token Address: Unique identifier for your token (e.g.,
E69i...VMzy). - Decimals: Precision (default: 9). Adjustable during creation.
👉 Explore Solana token standards
Step 2: Create a Token Account
Associate the token with a wallet by creating an Associated Token Account (ATA):
spl-token create-account <TOKEN_ADDRESS>Example:
spl-token create-account E69iMAYn5k9HcWiPRZtthMDmyv1owgiWSbZCtTn9VMzyOutput:
Creating account Cemt9DSnRUZCJo7HtYeS75GrnfM6fne1HinqnUkiFdVz Step 3: Mint Tokens
Issue tokens to your ATA:
spl-token mint <TOKEN_ADDRESS> <AMOUNT> <ATA_ADDRESS>Example:
spl-token mint E69iMAYn5k9HcWiPRZtthMDmyv1owgiWSbZCtTn9VMzy 10000 Cemt9DSnRUZCJo7HtYeS75GrnfM6fne1HinqnUkiFdVzVerify balance:
spl-token balance E69iMAYn5k9HcWiPRZtthMDmyv1owgiWSbZCtTn9VMzyStep 4: Transfer Tokens
Send tokens to another wallet:
spl-token transfer --fund-recipient <TOKEN_ADDRESS> <AMOUNT> <RECIPIENT_WALLET>Example:
spl-token transfer --fund-recipient E69iMAYn5k9HcWiPRZtthMDmyv1owgiWSbZCtTn9VMzy 100 6nmqFHKGZP8AXpdh3ynwV4GQS1cc64wG8e8dZUgX4RoMNote: The --fund-recipient flag covers transaction fees for the recipient’s ATA creation if needed.
FAQs
1. What is an SPL Token?
SPL tokens are Solana’s equivalent of ERC-20 tokens, adhering to the Solana Program Library standards for interoperability.
2. How do I check my token balance?
Use:
spl-token balance <TOKEN_ADDRESS>3. Can I change the decimals after minting?
No. Decimals are immutable once the token is created.
4. What’s the cost to create an SPL token?
Expect minimal SOL fees (~0.01 SOL) for account creation and transactions.
Key Takeaways
- Token Creation: Use
spl-token create-token. - Minting: Assign supply via
spl-token mint. - Transfers: Enable seamless distribution with
spl-token transfer.
By mastering these commands, you’ll efficiently manage SPL tokens for projects, airdrops, or DeFi protocols.
For further reading:
👉 Solana’s official documentation