DEV Community

NIRANJAN LAMICHHANE
NIRANJAN LAMICHHANE Subscriber

Posted on

Solana Account Model — City Analogy

Think of Solana as a city

Every building in the city has the same basic structure: an address, a size, an owner, and contents inside. That is exactly what an account is — a building. The blockchain is the city map that records who owns what building and what is inside each one.

The 5 fields — what every building has

Field Analogy Meaning
lamports money inside the building how much SOL this account holds (1 SOL = 1 billion lamports)
owner who has the master key only this program can change what is inside — everyone else can look but not touch
data what is stored inside raw bytes — could be empty (a wallet) or full of state (token balance, game score)
executable is it a factory or a house? false = stores things (wallet, data) · true = runs code (a program)
rentEpoch building tax status pay 2 years rent upfront and you never pay again — that is rent exemption

Why are program and data separate buildings?

1. Ethereum way: imagine a McDonald's where the kitchen (code) and the customer orders (data) are locked inside the same room. To change the menu, you demolish the whole building and rebuild it. Every new franchise needs its own separate building with its own separate kitchen.

2. Solana way: the kitchen (program account) is one permanent building in the city. It never stores any food orders inside — it is just the recipe book and the chef. Every customer order (data account) is a separate locker room next door, owned by the kitchen. Millions of lockers, one kitchen.

The three building types in the city

Wallet account — Your house. You own it.

  • executable: false
  • data: empty
  • owner: System Program
  • Holds SOL. The System Program is like the city government — it owns all plain wallets but you control yours with your private key (signature).

Program account — A factory. Read-only.

  • executable: true
  • data: BPF bytecode
  • owner: BPF Loader
  • Pure logic. No state lives here. Once deployed it just sits there waiting to be called. Upgrading means redeploying the bytecode — the data accounts are untouched.

Data account (PDA) — A locker assigned to you.

  • executable: false
  • data: your state
  • owner: the program
  • Created by the program on your behalf. Stores your token balance, your game score, your profile — whatever the program needs to remember about you. You cannot open it without the program.

One-line rule to remember forever

The owner field is the master key. Only the program listed as owner can change the data inside or take lamports out. Anyone in the world can send SOL in or read the data — but only the owner can write.

Your wallet is owned by the System Program. When you sign a transaction, you are telling the System Program "I authorise this" — and it acts on your behalf because your signature matches your address.


Walk me through a SOL transfer at the account level — which accounts change and which programs act on them.

Top comments (0)