DEV Community

Siddhant Chavan
Siddhant Chavan

Posted on

Solana's Account Model, Explained to My Past Self (A Web2 Dev's Guide) #100DaysOfSolana

Coming from Web2, Solana's account model felt completely backwards to me. No objects, no built-in state, no familiar patterns. After a 4 week of building on devnet, it finally clicked. Here's the short version I wish I had on day one.

Everything is an account

Wallet? Account. Smart contract? Account. The data that smart
contract reads and writes? Also an account.

They all live in the same flat key-value store. A 32-byte address maps to an account. That's it. No separate contract accounts vs wallets like Ethereum does. One model for everything.

Every account has five fields

Run "solana account

" in your terminal and you'll see
five things every time.

Lamports is the SOL balance. 1 SOL equals 1 billion lamports.
Everything on-chain works in whole numbers.

Data is a raw byte array. Empty for a basic wallet. Token balances, NFT metadata, and program bytecode all live here.

Owner is the program that controls this account. Only the owner can modify the data or move the lamports.

Executable is a simple true or false. True means this account is a runnable program. False means it holds data. That is literally the only structural difference between a smart contract and a wallet.

Rent epoch is deprecated. You will always see it set to the max value. Ignore it.

Programs don't store their own state

This is the part that trips up every Web2 developer, including me.

Solana programs are stateless. The program account holds compiled bytecode and nothing else. All state lives in separate data accounts that users pass in on every single call.

Think of it like a stateless REST API. The server holds no memory between requests. The caller sends everything the server needs to do its job. Same idea here, except the "data" being passed in are actual on-chain accounts.

The security model is simple

Only the owner program can modify an account's data or debit its lamports. The runtime enforces this, not your code. There is no auth middleware to forget. The account structure itself is the permission system.

Rent exemption

Every account needs to hold a small minimum balance to stay
on-chain, roughly 0.00089 SOL for a basic account. It is not
a fee. It is a refundable deposit. Close the account and you
get the lamports back.

You can check the exact amount by running "solana rent 0" in
your terminal.

The one analogy that ties it all together

Think of Solana as a filesystem. Accounts are files. Programs
are executables. Data accounts are documents. The System Program is the OS kernel that creates files and manages ownership.

Once that image lands, everything else starts to make sense.

Beginner #WEB3 #Solana #Blockchain #100DaysOfSolana

Top comments (0)