SOLSTACKAcademy

Intermediate· Lesson 2 of 2· 3 min

SPL tokens: mints, token accounts and ATAs

A token on Solana is two kinds of account and one program. Once you see the shapes, creating, sending and auditing tokens becomes mechanical.

Solana has no token contract per project. One program — the Token program, TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA, and its successor Token-2022, TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb — manages every token. A “token” is a set of accounts owned by that program.

The mint

The mint account defines the token: supply, decimals and two optional authorities. Its address is the token's identity — what you paste into an explorer, and what people mean by “contract address” on Solana.

supplyTotal units in existence, as an integer in base units.
decimalsHow many base units make one display unit. With 6 decimals, 1,000,000 base units show as 1.0. Chosen once; it cannot be changed.
mint_authorityWho can create new supply. Set to none and the supply is fixed forever.
freeze_authorityWho can freeze individual token accounts. Set to none and no one ever can.

Those two authorities are the first thing a buyer checks. A live mint authority means supply can be inflated; a live freeze authority means holders can be locked. Revoking both is one transaction in Token Manager; Token authorities explains what each one can do.

Token accounts

Balances live neither in the mint nor in your wallet. Each holder has a token account per mint: a 165-byte account owned by the Token program that records the mint, the owner — the wallet allowed to spend — and the amount. Holding five different tokens means five token accounts, each with its own ~0.002 SOL rent deposit.

Associated token accounts

A wallet could have several token accounts for one mint, which would be a mess. The Associated Token Account program fixes it by deriving one canonical address per (wallet, mint) pair — a program derived address from the seeds [wallet, token_program, mint]. Anyone can compute it, so a sender can create the recipient's ATA in the same transaction as the transfer. That is why sending someone a token they have never held costs a little more: you pay the rent on their new token account. Airdrop costs explained has the arithmetic.

Metadata

The Token program knows nothing about a token's name or logo. Those come from a metadata account: for classic SPL tokens a Metaplex Token Metadata account derived from the mint, for Token-2022 optionally stored in the mint itself through the metadata extension. Wallets and explorers read it, and nothing on-chain enforces uniqueness — a lookalike can copy any name — which is why the mint address is the only identity that counts.

Token-2022

Token-2022 is the same model with optional extensions on the mint or the token account: transfer fees, non-transferable tokens, interest-bearing display, confidential transfers, a permanent delegate, metadata in the mint. Wallet and exchange support is broad but not universal, so choose it when you need an extension. See SPL vs Token-2022 and Token-2022 extensions.

Creating one, in one transaction

  1. Create the mint account (paying its rent) and initialize it with decimals and authorities.
  2. Create the metadata account that points at the mint.
  3. Create your own associated token account for the mint.
  4. Mint the initial supply into it.
  5. Optionally revoke the mint and freeze authorities.

SPL Token Creator does all five in one signed transaction, on devnet or mainnet.

What to remember

  • One program manages every token. A token is a mint account plus one token account per holder.
  • The mint address is the token's only real identity. Names and logos are metadata anyone can copy.
  • Decimals are permanent. Mint and freeze authority are the two things a buyer checks.
  • An ATA is the canonical token account for a (wallet, mint) pair; creating one costs ~0.002 SOL of refundable rent.
  • Token-2022 adds extensions. Use it when you need one.

Try it