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.You’ve used this in: Quickstart Step 2 Quickstart Step 3 Quickstart Step 4 Payments Step 1 Payments Step 2 Pay-per-call Step 2 Tokenized asset Step 1
What Is a Token Account
A token account stores tokens for one mint and one token account owner on Solana.Token Account Type
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
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. Thepayer 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 program | ATA size | Minimum storage balance |
|---|---|---|
| Original Token Program | 165 bytes | 1,488,440 lamports (0.00148844 SOL) |
| Token-2022 with automatic immutable owner | 170 bytes | 1,513,840 lamports (0.00151384 SOL) |
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’sCreate 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
| Item | Description | Source |
|---|---|---|
Create | Creates an associated token account at the derived ATA address. | Source |
CreateIdempotent | Creates the associated token account, but still succeeds if that ATA already exists for the same owner and mint. | Source |
process_create_associated_token_account | Derives 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_account | Helper 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 toCargo.toml (tested with Rust 1.89 and 1.98):
Cargo.toml
Rust
Python
This example usessolana (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:- The System Program’s
CreateAccountinstruction creates a new rent-exempt account and assigns the Token Program as the program owner of the new account. - The Token Program’s
InitializeAccount,InitializeAccount2, orInitializeAccount3instruction initializes the new account for a mint and owner.
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
| Item | Description | Token Program | Token Extension Program |
|---|---|---|---|
Account | The base token account fields stored in every token account. | Source | Source |
InitializeAccount | A token account initialization instruction that expects the owner and rent sysvar account in its accounts list. | Source | Source |
InitializeAccount2 | A token account initialization instruction that passes the owner in instruction data instead of the accounts list. | Source | Source |
InitializeAccount3 | A token account initialization instruction that passes the owner in instruction data and does not require the rent sysvar account. | Source | Source |
_process_initialize_account | Shared processor logic for token account initialization. | Source | Source |
process_initialize_account | Public handler for InitializeAccount. | Source | Source |
process_initialize_account2 | Public handler for InitializeAccount2. | Source | Source |
process_initialize_account3 | Public handler for InitializeAccount3. | Source | 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.
Instructions
Rust
Add these dependencies toCargo.toml (tested with Rust 1.89 and 1.98):
Cargo.toml
Rust
Python
This example usessolana (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.