How to Create an SPL Token on Solana: A Step-by-Step Guide

·

Creating a token on Solana is fundamentally different from Ethereum’s ERC-20 model. While Ethereum requires writing and deploying smart contracts—often using OpenZeppelin libraries—Solana simplifies the process with its SPL Token Program. This powerful, built-in protocol allows developers to issue tokens without writing any smart contract code. Instead, you use command-line tools to create, mint, and manage tokens efficiently.

In this comprehensive guide, you’ll learn how to create an SPL token on Solana, understand core concepts like mint accounts and token accounts, configure metadata, and even add a logo visible on blockchain explorers—all using the spl-token CLI.

Core Keywords


Install the SPL Token CLI

To get started, you’ll need the spl-token-cli tool. This command-line utility interacts directly with Solana’s Token Program and streamlines the entire token lifecycle.

Prerequisite: Ensure you have Rust (cargo) and the Solana CLI installed. If not, refer to Solana’s official setup guide.

Install the CLI using Cargo:

cargo install spl-token-cli

Once installed, you’re ready to create your first token.

👉 Learn how blockchain platforms simplify token creation for developers.


Create a New SPL Token

Run the following command to generate a new token:

spl-token create-token

This creates a mint account—a special account that holds essential token data such as supply, decimals, and authority permissions. Example output:

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

The Address is your mint address, which uniquely identifies the token type. By default, the initial supply is set to zero:

spl-token supply G8Z8ArrhUnNYZ1ZjvoNpECSR67Ug5RTbYzewvgcUp3h3
# Returns: 0

Before issuing tokens, you must create a token account to hold the balance.


Create a Token Account

A token account stores the balance of a specific token (linked to its mint address). Think of it as a wallet dedicated to one SPL token.

Create one using:

spl-token create-account G8Z8ArrhUnNYZ1ZjvoNpECSR67Ug5RTbYzewvgcUp3h3

Output:

Creating account Dx31MHuMRdf14mr73c6Bn7oKCVMP8nqvv5EJX7m8pES7

Now you have a place to store your newly minted tokens.


Mint Tokens

Minting increases both the total supply (in the mint account) and the balance in a designated token account.

Use this command to issue 100 tokens:

spl-token mint G8Z8ArrhUnNYZ1ZjvoNpECSR67Ug5RTbYzewvgcUp3h3 100 Dx31MHuMRdf14mr73c6Bn7oKCVMP8nqvv5EJX7m8pES7

Output confirms the action:

Minting 100 tokens
Token: G8Z8ArrhUnNYZ1ZjvoNpECSR67Ug5RTbYzewvgcUp3h3
Recipient: Dx31MHuMRdf14mr73c6Bn7oKCVMP8nqvv5EJX7m8pES7

Verify results:

spl-token supply G8Z8ArrhUnNYZ1ZjvoNpECSR67Ug5RTbYzewvgcUp3h3  # Should return 100
spl-token balance Dx31MHuMRdf14mr73c6Bn7oKCVMP8nqvv5EJX7m8pES7 # Should return 100

Query Token and Account Information

Use spl-token display to inspect account details.

View Token Account Details

spl-token display Dx31MHuMRdf14mr73c6Bn7oKCVMP8nqvv5EJX7m8pES7

Output includes balance, owner, decimals, and state.

View Mint Account Info

spl-token display G8Z8ArrhUnNYZ1ZjvoNpECSR67Ug5RTbYzewvgcUp3h3

Shows total supply, mint authority, and decimal precision.

Explore on Solana Block Explorer

You can also view your token on Solana Explorer by pasting the mint address. This provides a user-friendly interface showing transaction history, holders, and more.


Transfer SPL Tokens

Transferring tokens between wallets requires either pre-existing token accounts or on-the-fly creation.

Attempt Transfer to New Wallet

Generate a new wallet:

solana-keygen new -o ~/.config/solana/id-01.json

Try sending tokens:

spl-token transfer G8Z8ArrhUnNYZ1ZjvoNpECSR67Ug5RTbYzewvgcUp3h3 50 GEpoPXXoyWi3TZeZmvFgheoej2kdBMGXV7tDetUWKGtu

You’ll likely see:

Error: The recipient address is not funded. Add `--allow-unfunded-recipient`

This means the recipient lacks a token account.

Solution 1: Recipient Creates Token Account

Switch to the new wallet:

solana config set --keypair ~/.config/solana/id-01.json

Then create the account:

spl-token create-account G8Z8ArrhUnNYZ1ZjvoNpECSR67Ug5RTbYzewvgcUp3h3

Now switch back and retry the transfer.

Solution 2: Sender Funds Recipient Automatically

Use these flags to simplify:

spl-token transfer --fund-recipient G8Z8ArrhUnNYZ1ZjvoNpECSR67Ug5RTbYzewvgcUp3h3 50 GEpoPXXoyWi3TZeZmvFgheoej2kdBMGXV7tDetUWKGtu --allow-unfunded-recipient

This auto-creates the recipient’s token account and covers the small SOL cost (rent).

👉 Discover how decentralized networks enable seamless digital asset transfers.


Add Metadata with Token-2022

By default, SPL tokens lack human-readable names or logos. To add name, symbol, and logo, use Token-2022, Solana’s enhanced token standard.

Create a Token-2022 Compatible Token

spl-token create-token -p TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb --enable-metadata

This enables metadata extension support.

Initialize Metadata

Set name and symbol:

spl-token initialize-metadata AQtCRnZtcD4B9Z4ovd9qEhe1cJo5EvDNB2rtq3tKeemD "My SPL Token" "MST" ""

Check the result:

spl-token display AQtCRnZtcD4B9Z4ovd9qEhe1cJo5EvDNB2rtq3tKeemD

You’ll now see metadata fields populated.


Upload Logo and JSON Metadata

For your token to display correctly on explorers, upload metadata via IPFS.

Step 1: Upload Logo

Use Pinata or similar IPFS service to upload your logo (PNG/SVG). Get the CID (Content Identifier).

Step 2: Prepare Metadata JSON

Create a file like this:

{
  "name": "My SPL Token",
  "symbol": "MST",
  "description": "A pig token.",
  "image": "https://ipfs.io/ipfs/YOUR_LOGO_CID",
  "external_url": "",
  "attributes": [],
  "properties": {
    "files": [
      {
        "uri": "https://ipfs.io/ipfs/YOUR_LOGO_CID",
        "type": "image/png"
      }
    ]
  }
}

Upload it and get its CID.

Step 3: Update Token URI

spl-token update-metadata AQtCRnZtcD4B9Z4ovd9qEhe1cJo5EvDNB2rtq3tKeemD uri "https://ipfs.io/ipfs/YOUR_METADATA_CID"

Refresh the Solana block explorer—you should now see your logo and name!

👉 See how metadata powers NFTs and modern digital assets.


Frequently Asked Questions (FAQ)

Q: Do I need to write smart contracts to create a token on Solana?
A: No. Solana uses pre-deployed programs like SPL Token and Token-2022. You interact via CLI or SDKs—no Solidity-like coding required.

Q: What’s the difference between a mint account and a token account?
A: The mint account defines the token’s properties (supply, decimals). The token account holds balances for users and is linked to a specific mint.

Q: Why does transferring fail even with enough balance?
A: The recipient needs a token account. Use --allow-unfunded-recipient and --fund-recipient to automate creation.

Q: Can I change the token name after creation?
A: Yes, if you retain the update authority. Use spl-token update-metadata to modify name, symbol, or URI.

Q: What is Token-2022?
A: It’s an upgraded version of the SPL Token Program with built-in extensions for metadata, transfer hooks, and more. Recommended for new projects.

Q: How much does it cost to create a token?
A: Minimal—just enough SOL to cover rent for accounts (≈$0.01–$0.05). No gas fees for basic operations like minting or transferring.


Conclusion

Creating an SPL token on Solana is fast, efficient, and accessible—even for developers without deep blockchain experience. By leveraging tools like spl-token-cli and standards like Token-2022, you can launch functional tokens in minutes.

From minting and transferring to enriching tokens with metadata and logos, Solana offers a robust ecosystem for building digital assets. Whether you're launching a community token, reward system, or NFT utility coin, mastering SPL tokens is a critical step in your Web3 journey.