An account is Solana's fundamental data unit for storing state. The network stores all state in a key-value store where each key is a 32-byte address and each value is an account.
Diagram of 3 accounts and their addresses. Includes the account structure definition.
Account Structure
Account addresses (public key, PDA), the five fields every account contains, rent state machine, with interactive code walkthrough.
Account Types
Program accounts (executable code), data accounts (program state), system accounts, and sysvars (cluster-wide state).
Modification Rules
Runtime-enforced rules for lamports, data, owner, executable flag, and borrows.
Account Runtime
Account loading validation, BPF serialization format, and deserialization.
Key facts
- Structure: Every account has the same five fields: lamports, data, owner, executable, rent_epoch.
- Address: Each account is identified by a unique 32-byte address (either an Ed25519 public key or a PDA).
- Ownership: Only the account's owner program can modify its data or debit lamports. Any program can credit lamports to any writable account.
- Rent: Every account must hold a minimum lamport balance proportional to its data size to remain on-chain.
Limits
| Limit | Value | Source |
|---|---|---|
| Max account data size | 10 MiB (10,485,760 bytes) | MAX_ACCOUNT_DATA_LEN |
| Max data growth per instruction | 10 KiB (10,240 bytes) | MAX_PERMITTED_DATA_INCREASE |
| Max data growth per transaction | 20 MiB (20,971,520 bytes) | MAX_ACCOUNT_DATA_GROWTH_PER_TRANSACTION |
| Account base storage overhead | 64 bytes per account | TRANSACTION_ACCOUNT_BASE_SIZE |
| Address size | 32 bytes (Ed25519 public key) | -- |
| Rent-exempt minimum (formula) | (account_size + 128) * 3,480 lamports/byte-year * 2 years | minimum_balance() |
Is this page helpful?