How to Create Solana SPL Tokens Using Command Line Tools

·

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-token

Output Example:

Creating token E69iMAYn5k9HcWiPRZtthMDmyv1owgiWSbZCtTn9VMzy under program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA  
Address: E69iMAYn5k9HcWiPRZtthMDmyv1owgiWSbZCtTn9VMzy  
Decimals: 9  

Key Details:

👉 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 E69iMAYn5k9HcWiPRZtthMDmyv1owgiWSbZCtTn9VMzy

Output:

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 Cemt9DSnRUZCJo7HtYeS75GrnfM6fne1HinqnUkiFdVz

Verify balance:

spl-token balance E69iMAYn5k9HcWiPRZtthMDmyv1owgiWSbZCtTn9VMzy

Step 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 6nmqFHKGZP8AXpdh3ynwV4GQS1cc64wG8e8dZUgX4RoM

Note: The --fund-recipient flag covers transaction fees for the recipient’s ATA creation if needed.

👉 Advanced Solana CLI tips


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

By mastering these commands, you’ll efficiently manage SPL tokens for projects, airdrops, or DeFi protocols.

For further reading:
👉 Solana’s official documentation