Introduction to Solana Accounts
On the Solana blockchain, all data is stored within structures called "accounts." Think of Solana's data architecture as a public database with a single table named "accounts," where each record represents an individual account. Every Solana account shares the same foundational account type.
Key Features
- Storage Capacity: Accounts can hold up to 10MiB of data, which may include executable program code or program state.
- Rent Mechanism: Accounts require a rent deposit proportional to their data storage size (denominated in lamports/SOL), fully refundable upon account closure.
- Program Ownership: Each account has a designated program owner. Only the owning program may modify account data or deduct lamports, though anyone can increase the balance.
Special Account Types:
- Sysvar Accounts: Store network cluster state
- Program Accounts: Contain smart contract executable code
- Data Accounts: Created by programs to manage program state
Account Structure
Each Solana account features a unique 32-byte address, typically displayed as a base58-encoded string (e.g., 14grJpemFaf88c8tiVb77W7TYg2W3ir6pfkKz3YjhhZ5). This address functions similarly to a key-value pair, where the address serves as the key to locate on-chain data.
Address Types
- Standard Addresses: Most Solana accounts use Ed25519 public keys
- Program Derived Addresses (PDAs): Special deterministic addresses derived from program IDs and optional seeds
👉 Learn more about PDAs in our advanced guide
Account Composition
All Solana accounts contain these core fields:
| Field | Description |
|---|---|
data | Byte array storing arbitrary account data |
executable | Boolean flag indicating program status |
lamports | Account balance in lamports (1 SOL = 1 billion lamports) |
owner | Program ID of the owning program |
rent_epoch | Legacy field (no longer functional) |
Rent Mechanism
To store data on-chain, accounts must maintain a lamport balance proportional to their data storage requirements. This "rent" functions more like a deposit, as it's fully recoverable when closing an account. The calculation method uses these constants.
Program Ownership
Program ownership is fundamental to Solana's account model:
- Only the owning program may modify account data or deduct lamports
- Ownership enables secure state management for decentralized applications
👉 Explore program development best practices
System Program
The System Program serves critical functions:
- Creates new accounts
- Allocates account space
- Transfers program ownership
- Manages wallet accounts (fee payment capability)
Special Account Types
Sysvar Accounts
These special accounts reside at predefined addresses and provide access to dynamic network state data. Examples include clock and stake information.
Program Accounts
Deployed programs create executable program accounts containing:
- Executable code (managed by loader programs)
- Program metadata (loader-v3 specific)
Data Accounts
Programs create separate data accounts to maintain state:
- System Program creates the account
- Ownership transfers to custom program
- Custom program initializes account data
This separation between code and state enhances security and upgradability.
FAQ Section
Q: What's the maximum account size on Solana?
A: Accounts can store up to 10 megabytes of data.
Q: Can multiple programs own a single account?
A: No, each account has exactly one owning program.
Q: How are accounts created on Solana?
A: Only the System Program can create new accounts initially.
Q: What happens to rent deposits when closing an account?
A: The full lamport balance becomes withdrawable.
Q: Are program accounts different from data accounts?
A: Yes, program accounts store executable code while data accounts store program state.
Q: How do PDAs differ from regular addresses?
A: PDAs are program-derived and don't have corresponding private keys.