SPL Token
SPL Token¶
SPL Token is the token standard on Solana, equivalent to Ethereum's ERC-20. The SPL (Solana Program Library) Token program defines how to create, manage, and transfer fungible and non-fungible tokens on Solana.
Core Concepts¶
Mint Account Token definition and configuration: - Total token supply - Decimal places - Mint Authority - Freeze Authority
Token Account Stores a user's token balance: - Associated Mint - Owner - Amount (Balance) - Delegate information
Associated Token Account (ATA) A user's default Token account, with address derived (PDA) from the user's wallet and Mint.
Creating Tokens¶
# Create Mint
spl-token create-token
# Create Token Account
spl-token create-account <MINT>
# Mint tokens
spl-token mint <MINT> <AMOUNT>
# Transfer
spl-token transfer <MINT> <AMOUNT> <RECIPIENT>
Token Operations¶
Minting Only accounts with Mint Authority can mint new tokens.
Burning Users can burn their own tokens, reducing the total supply.
Freezing If Freeze Authority is set, specific Token accounts can be frozen.
Delegation Allows another account to transfer a specified amount of tokens on your behalf.
Token-2022¶
The upgraded version of SPL Token, adding: - Transfer fees - Transfer hooks - Confidential transfers - Metadata extension - Interest-bearing tokens
Related Concepts¶
- ERC-20: Ethereum's fungible token standard
- ATA: Associated Token Account
- Token-2022: Extended version of SPL Token