Why the Account Model Matters
Before you can build anything meaningful on Solana, you need a clear mental model of how it stores state. Not a vague intuition an actual, precise understanding of the four fields every account has and what each one does.
This post goes field by field, using real on-chain examples you can look up yourself in Solana Explorer. By the end, you'll be able to look at any account on Solana and understand exactly what it is and who controls it.
Open explorer.solana.com as you read. Everything described here is live on-chain right now.
Field 1: lamports
Lamports are the smallest unit of SOL. One SOL equals exactly 1,000,000,000 lamports the same relationship as dollars to fractions of a cent, but taken further.
Every account on Solana holds a lamports balance. For a regular wallet, this is your spendable SOL. For a program or data account, these lamports serve a specific purpose: keeping the account rent-exempt (covered below).
Real example: Look up any active Solana wallet in Explorer. You'll see its SOL balance displayed prominently, with the lamport equivalent shown underneath. A wallet holding 1.5 SOL holds 1,500,000,000 lamports.
When you send SOL, you're doing one thing: reducing lamports in your account and increasing lamports in the recipient's account. The simplest possible operation in the account model.
What to remember: Lamports are both the currency and the storage deposit. Every account needs enough lamports to survive (rent exemption). Run out and the account gets deleted.
Field 2: owner
This is the most important part of the account model and the most misunderstood.
Every account on Solana is owned by a program. The owner field contains the address of the program that has exclusive write access to that account's data field. No other program and no user can directly modify an account's data without going through its owner.
This is enforced at the runtime level. It's not a convention or a best practice. It's a hard rule checked on every transaction.
Real examples:
- Your wallet account's owner:
11111111111111111111111111111111(the System Program) - A USDC token account's owner:
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA(the Token Program) - A Metaplex NFT metadata account's owner:
metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s(Metaplex's program)
Look any of these up in Explorer. The owner field is displayed on every account page.
What to remember: Owner determines who can write. If a program isn't listed as the owner of an account, it cannot modify that account's data, period.
Field 3: data
The data field is an arbitrary array of bytes. The Solana runtime doesn't know or care what's in it that's entirely up to the program that owns the account.
For wallet accounts, the data is empty. Wallets only need to track SOL, which lives in lamports.
For program-owned data accounts, the data contains whatever state the program needs. The program defines the structure; the bytes are stored in the account.
Real examples of what lives in data:
A token account's data contains three things: the address of the token mint (which token this account holds), the address of the wallet that controls this account, and the current token balance. All serialized as bytes.
An NFT metadata account's data contains: the name of the NFT, its symbol, a URI pointing to off-chain metadata (image, traits, etc.), royalty percentage, and creator addresses.
A Serum DEX market account's data contains: the addresses of the base and quote token vaults, the current order book state, and fee configuration.
What to remember: Data is the payload. Its meaning is defined entirely by the owning program. Solana Explorer decodes data for well-known programs but for custom programs, you need the program's IDL (interface definition) to understand what the bytes mean.
Field 4: executable
This boolean flag answers one question: is this account a program?
If executable = true, the data field contains compiled BPF bytecode code that the Solana runtime can execute when this account is invoked as a program. If executable = false, the data field contains state, not code.
This is the field that makes Solana's "everything is an account" claim literally true. Programs and data use the exact same storage primitive. The only difference is this one flag.
Real example: Search for the System Program (11111111111111111111111111111111) in Explorer. You'll see executable: true. Now look at any wallet address. You'll see executable: false. Same account structure, completely different purpose, differentiated by one boolean.
What to remember: executable = true means "this account is a program." executable = false means "this account is state." Wallets, token balances, and NFT metadata are all executable = false. Programs are executable = true.
Why Programs and Data Are Separated
If you've worked with Ethereum, you're used to a smart contract bundling its logic and state together. The contract's code and the contract's storage live at the same address.
Solana separates them, and the reasons are practical:
Reason 1: Upgradeability
A Solana program account contains only code. It holds no mutable state. This means you can upgrade a program replace its bytecode with a new version without touching any of the state accounts it manages.
In Web2 terms: you can redeploy your application with new logic without running any database migrations. The data accounts keep working with the new code as long as the data schema is compatible.
Reason 2: Parallel execution
Solana can run multiple transactions simultaneously when those transactions don't touch the same accounts. Because the program logic is separate from the program state, the runtime can identify which transactions are truly independent (they touch different data accounts) and execute them in parallel.
This is a major contributor to Solana's throughput. Separation of programs and data isn't just an architectural preference it's a prerequisite for parallel execution.
Rent Exemption: Why Accounts Need SOL
Validators keep all active accounts in memory to process transactions quickly. This memory has a cost. Solana's answer is rent exemption: every account must hold a minimum SOL balance proportional to its data size to stay alive indefinitely.
The minimum is approximately 0.00203928 SOL per kilobyte of data (this number is defined by the network and can change with governance). An empty account (zero bytes of data) requires about 0.00089088 SOL.
If an account's lamports drop below the rent-exempt minimum, it becomes eligible for deletion by the network. In practice, almost all accounts are funded to the rent-exempt level upfront.
The practical implications:
When you create a new data account on-chain (which happens automatically in many transactions like receiving a new token for the first time), someone pays a rent-exempt deposit. Often it's the user, sometimes it's the application. The deposit is returned in full when the account is closed.
This is why closing unused token accounts in your wallet returns a small amount of SOL you're reclaiming the rent-exempt deposit that was paid when the account was created.
The Full Picture
Put all four fields together and you get a remarkably consistent model:
- Wallets: lamports (your SOL balance) + empty data + System Program as owner + not executable
- Programs: lamports (rent-exempt deposit) + bytecode in data + BPF Loader as owner + executable = true
- Token accounts: lamports (rent-exempt deposit) + token state in data + Token Program as owner + not executable
- NFT metadata: lamports (rent-exempt deposit) + metadata bytes in data + Metaplex as owner + not executable
Every account type fits the same four-field model. The variation is entirely in how those fields are used, not in the structure itself.
That consistency is what makes "everything is an account" more than a slogan. It's a genuinely elegant design choice that lets a single storage primitive power an entire programmable blockchain.
Top comments (0)