articleJul 31, 2022
Solana accounts model
How Solana accounts store state: data vs program accounts, PDA limits, ownership rules, rent, and the fields every account carries.

Account
Accounts are the basic building blocks for Solana programs. Each one has a unique address and holds state (data). Size is capped at 10 MB for ordinary accounts and 10 KB for PDA accounts. PDAs let a program sign on its own behalf. Size is fixed at creation but can change later with realloc. Storing data costs rent, and the default owner is the system program.
Account model
Three account kinds show up most often:
- Data account — holds state
- Program account — holds executable program bytes
- Native program accounts — system, stake, and vote programs
Data account
- System-owned account
- PDA (program derived address) account
Account struct
Each account has an address (usually a public key) and an owner (a program account address). Fields in the account store:
| Field | Description |
|---|---|
| lamports | Lamports owned by the account |
| owner | Program that owns the account |
| executable | Whether the account is executable |
| rent_epoch | Next rent epoch |
| data | Raw byte array stored in the account |
Ownership rules
- Only the owner of a data account can change its data or debit lamports.
- Anyone can credit lamports to a data account.
- When account data length becomes zero, the owner can assign a new owner.
Program accounts do not store app state
A counter program needs two accounts: one for the program code and one for the counter value. You still pay rent so the accounts are not garbage-collected.

Rent
Keeping data on-chain costs SOL as rent. An account is rent-exempt if its balance covers about two years of rent. Close the account and send lamports back to a wallet to recover most of that balance; a slice of collected rent is burned and the rest goes to vote accounts at epoch end. If an account cannot pay rent, it is deallocated and its data is removed.
Rent is charged in two situations:
- when a transaction references the account
- once per epoch