Skip to content

​In short

Wallets don’t hold tokens directly. Each token (USDC, or your own asset) gets a small account owned by the wallet, and transfers move between these accounts.

​What Is a Token Account

A token account stores tokens for one mint and one token account owner on Solana.
Token Account Type
Here, owner means the authority that can transfer, burn, or delegate tokens from the token account. The account’s program owner is still the Token Program or Token Extension Program. Each token account is tied to exactly one mint, which means the token account can hold units of only one token, the token identified by the token account’s mint field.

​What Is an Associated Token Account

An associated token account (ATA) is the default token account for a wallet and mint. The Associated Token Program derives the ATA address from the wallet address, token program address, and mint address. Only token accounts created by the Associated Token Program are called associated token accounts. The Associated Token Program is a way to create a token account at a standard, deterministic address. The resulting account is still a token account owned by the Token Program or Token Extension Program, not by the Associated Token Program. The Associated Token Program derives the ATA address as shown in address.rs:
Associated Token Account Address Derivation
For any wallet, token program, and mint combination, there is exactly one ATA address. The Associated Token Program creates a standard token account at that address, and the resulting account still uses the Account type defined by the Token Program or Token Extension Program.

​Cost and Payer

Creating an ATA requires a refundable minimum balance for the account’s onchain storage, plus the transaction fee. The payer passed to the create instruction funds the storage balance and must sign. The payer can be different from both the transaction fee payer and the wallet that will own the ATA, so an application can create an ATA on behalf of a recipient. At the mainnet storage rate as of October 2026 (5,080 lamports per byte), the base costs are:
Token programATA sizeMinimum storage balance
Original Token Program165 bytes1,488,440 lamports (0.00148844 SOL)
Token-2022 with automatic immutable owner170 bytes1,513,840 lamports (0.00151384 SOL)
Token-2022 mints can require account extensions in addition to the automatic ImmutableOwner extension. Those ATAs are larger and require a higher minimum balance. The Associated Token Program asks the selected Token Program for the required account size and funds the ATA accordingly. Do not hard-code these balances in application logic. Query getMinimumBalanceForRentExemption for the required data size, or let the Associated Token Program calculate and fund it during creation.
The storage balance is refundableClosing an empty token account transfers all of its lamports, including the minimum storage balance, to the destination specified by the close instruction. The original creation payer is not automatically the refund destination. See Close Token Account.

​How to Create an Associated Token Account

Creating an associated token account uses the Associated Token Program’s Create or CreateIdempotent instruction. The Associated Token Program derives the ATA address, creates the account at the ATA address, and initializes the account as a token account owned by the Token Program or Token Extension Program.
RecommendedFor most applications, create token accounts through the Associated Token Program instead of creating them by directly calling the System Program and Token Program instructions. An associated token account uses a deterministic address derived from the owner, token program, and mint, which makes the default token account for a given mint easier for wallets and applications to find.

​Source Reference

ItemDescriptionSource
CreateCreates an associated token account at the derived ATA address.Source
CreateIdempotentCreates the associated token account, but still succeeds if that ATA already exists for the same owner and mint.Source
process_create_associated_token_accountDerives the ATA address and uses create_pda_account plus CPIs to the selected token program to initialize the token account. When the selected program is the Token Extension Program, the ATA processor also initializes the immutable owner extension.Source
create_pda_accountHelper used by process_create_associated_token_account to create the PDA account by CPI into the System Program.Source

​Kit

These examples use @solana/kit.

​Web3.js v3

These examples use the class-based @solana/web3.js v3 API with @solana-program instruction builders.

​Rust

Add these dependencies to Cargo.toml (tested with Rust 1.89 and 1.98):
Cargo.toml
Rust

​Python

This example uses solana (solana-py) 0.41 and solders:
Terminal
Python

​Web3.js (legacy)

These examples use legacy @solana/web3.js 1.x with @solana/spl-token.
@solana/web3.js 1.x is no longer actively maintainedIt receives critical fixes only. Use Kit for new code. To migrate existing code, follow the Kit upgrade guide, or the web3.js v3 migration guide to keep the class-based API.To run this code, install 1.x with npm install @solana/web3.js@1. A plain npm install @solana/web3.js installs v3, which this code doesn’t run on.

​How to Create a Token Account

Creating a token account requires two instructions:
  1. The System Program’s CreateAccount instruction creates a new rent-exempt account and assigns the Token Program as the program owner of the new account.
  2. The Token Program’s InitializeAccount, InitializeAccount2, or InitializeAccount3 instruction initializes the new account for a mint and owner.
Include the CreateAccount instruction and the token account initialization instruction in the same transaction. During token account initialization, the Token Program checks that the account is not already initialized and is rent-exempt.
The section below shows how to create a token account by directly calling the System Program and Token Program instructions. For most applications, use the Associated Token Program instead. Use direct System Program and Token Program calls when you have a specific reason not to use an associated token account or when you need to create custom PDA token accounts by making CPIs to the System Program and Token Program instructions from your own Solana program.

​Source Reference

ItemDescriptionToken ProgramToken Extension Program
AccountThe base token account fields stored in every token account.SourceSource
InitializeAccountA token account initialization instruction that expects the owner and rent sysvar account in its accounts list.SourceSource
InitializeAccount2A token account initialization instruction that passes the owner in instruction data instead of the accounts list.SourceSource
InitializeAccount3A token account initialization instruction that passes the owner in instruction data and does not require the rent sysvar account.SourceSource
_process_initialize_accountShared processor logic for token account initialization.SourceSource
process_initialize_accountPublic handler for InitializeAccount.SourceSource
process_initialize_account2Public handler for InitializeAccount2.SourceSource
process_initialize_account3Public handler for InitializeAccount3.SourceSource

​Kit

These examples use @solana/kit.

​Web3.js v3

These examples use the class-based @solana/web3.js v3 API with @solana-program instruction builders.
Instructions

​Rust

Add these dependencies to Cargo.toml (tested with Rust 1.89 and 1.98):
Cargo.toml
Rust

​Python

This example uses solana (solana-py) 0.41 and solders:
Terminal
Python

​Web3.js (legacy)

These examples use legacy @solana/web3.js 1.x with @solana/spl-token.
@solana/web3.js 1.x is no longer actively maintainedIt receives critical fixes only. Use Kit for new code. To migrate existing code, follow the Kit upgrade guide, or the web3.js v3 migration guide to keep the class-based API.To run this code, install 1.x with npm install @solana/web3.js@1. A plain npm install @solana/web3.js installs v3, which this code doesn’t run on.