What Are SPL Tokens?
SPL (Solana Program Library) tokens are Solana's equivalent of ERC-20 tokens on Ethereum. Every fungible token on Solana — from USDC to meme coins — is an SPL token. Understanding how to create and manage them is fundamental to building on Solana.
This guide covers the full lifecycle: creating a mint, configuring authorities, adding Metaplex metadata, minting supply, and deploying to Mainnet.
Prerequisites
- Solana CLI v1.18+ installed and configured
- Node.js 18+
- A funded Devnet wallet (
solana airdrop 2)
solana --version
solana config set --url devnet
solana balance1. Create a Token Mint (CLI)
The fastest way to create a token:
spl-token create-tokenThis outputs a mint address — the unique identifier for your token. By default, your wallet becomes the mint authority (can mint new supply) and there is no freeze authority.
With Custom Decimals
spl-token create-token --decimals 6Most tokens use 6 or 9 decimals. USDC uses 6, SOL uses 9.
2. Create a Token Account and Mint Supply
# Create an associated token account for your wallet
spl-token create-account <MINT_ADDRESS>
# Mint 1,000,000 tokens
spl-token mint <MINT_ADDRESS> 1000000Check your balance:
spl-token balance <MINT_ADDRESS>To create a fixed-supply token, mint your total supply and then revoke the mint authority: spl-token authorize <MINT_ADDRESS> mint --disable. This makes the supply permanently capped.
3. Programmatic Token Creation with TypeScript
For dApps like Mintora, you need programmatic token creation.
import {
Connection,
Keypair,
SystemProgram,
Transaction,
sendAndConfirmTransaction,
} from "@solana/web3.js";
import {
TOKEN_PROGRAM_ID,
createInitializeMintInstruction,
getMintLen,
createAssociatedTokenAccountInstruction,
getAssociatedTokenAddress,
createMintToInstruction,
} from "@solana/spl-token";
const connection = new Connection("https://api.devnet.solana.com", "confirmed");
const payer = Keypair.generate(); // Fund this wallet first
async function
4. Adding Token Metadata with Metaplex
Raw SPL tokens have no name, symbol, or image. You need Metaplex metadata to make your token recognizable in wallets and explorers.
npm install @metaplex-foundation/mpl-token-metadata @metaplex-foundation/umi @metaplex-foundation/umi-bundle-defaultsimport { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
import { createMetadataAccountV3 } from "@metaplex-foundation/mpl-token-metadata";
import { publicKey } from "@metaplex-foundation/umi";
const umi = createUmi("https://api.devnet.solana.com");
async function addMetadata(mintAddress: string) {
await createMetadataAccountV3(umi, {
mint: publicKey(mintAddress),
data: {
name: "My Token",
symbol: "MTK",
uri: "https://arweave.net/your-metadata-json"
The uri should point to a JSON file hosted on Arweave or IPFS:
{
"name": "My Token",
"symbol": "MTK",
"description": "A utility token for the MTK ecosystem",
"image": "https://arweave.net/your-token-logo.png"
}Wallets like Phantom and Solflare read metadata from Metaplex. Without it, your token shows up as "Unknown Token" with no logo.
5. Authority Management
| Authority | Purpose | Best Practice |
|---|---|---|
| Mint Authority | Can mint new tokens | Revoke after initial mint for fixed supply |
| Freeze Authority | Can freeze token accounts | Set to null unless you need compliance features |
| Update Authority | Can update Metaplex metadata | Keep for fixing metadata, revoke when finalized |
# Revoke mint authority (permanent)
spl-token authorize <MINT> mint --disable
# Revoke freeze authority
spl-token authorize <MINT> freeze --disable6. Token Extensions (Token-2022)
The newer Token-2022 program supports advanced features:
spl-token create-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb \
--enable-transfer-fee \
--transfer-fee 50 1000000| Extension | Use Case |
|---|---|
| Transfer Fee | Protocol revenue on every transfer |
| Interest Bearing | Staking-like yield without staking |
| Non-Transferable | Soulbound tokens, credentials |
| Confidential Transfers | Privacy-preserving balances |
7. Deploy to Mainnet
# Switch to Mainnet
solana config set --url mainnet-beta
# Ensure you have SOL for rent + fees
solana balance
# Create the token
spl-token create-token --decimals 6
# Add metadata, mint supply, revoke authoritiesDouble-check all authority settings before revoking on Mainnet. Revoking mint authority is irreversible. Test everything on Devnet first.
Wrapping Up
Creating SPL tokens is the starting point for any Solana project — whether you are launching a DeFi protocol, a governance system, or a community token. The key decisions are decimals, supply model (fixed vs. inflationary), and authority management.
For locking token liquidity after launch, see our Liquidity Locker tutorial. For building a React frontend around your token, check out Solana React Basics.