DEV Community

Hauwa Ibrahim
Hauwa Ibrahim

Posted on

Solana’s account model isn’t scary. It’s just a filing cabinet.

Hey, Web2 friend.

You’ve built REST APIs. You’ve stored sessions in Redis. You’ve wrestled with PostgreSQL at 3 AM.

Now you’re peeking into Solana, and someone hit you with the phrase: “Everything is an account.”

Your first thought is probably: “Uh oh. Another abstract blockchain thing I have to memorize.”

I promise, it’s not that bad.

In fact, if you’ve ever used a filesystem or a key-value store, you already understand 80% of Solana’s account model. Let me show you what I mean.


One model to rule them all

Ethereum has two types of accounts:

  • Externally owned accounts (wallets)
  • Contract accounts (smart contracts)

Solana says: “Nah, that’s too complicated. Let’s just have one.”

On Solana, everything is an account.

Your wallet? Account.

A program (smart contract)? Account.

A single token balance? Also an account.

An NFT’s metadata? You guessed it. Account.

The whole blockchain is basically a giant key-value store.

  • Key: a 32-byte address (looks like a long random string)
  • Value: the account itself

That’s it. Flat. Simple. No nesting. No inheritance. Just a big hash map in the sky.


What’s actually inside an account?

Every account on Solana has exactly five fields. No more, no less.

Here’s what one looks like (simplified):

{
  "lamports": 890000,
  "data": [],
  "owner": "SystemProgram",
  "executable": false,
  "rent_epoch": 18446744073709551615
}
Enter fullscreen mode Exit fullscreen mode

Let’s walk through them like normal humans.

🪙 lamports – the “storage rent” piggy bank

lamports is just SOL measured in tiny units (1 SOL = 1 billion lamports).

To keep an account alive on Solana, it needs a minimum balance. Think of it like a security deposit so you don’t spam the network with junk data.

In Web2 terms: you pay AWS for EBS storage. Same vibe.

📦 data – the actual stuff

This is a byte array. Could be anything.

  • If the account is a program, this holds executable code.
  • If it’s a data account, this holds JSON, numbers, token balances, or whatever the app needs.

No separate database. No ORM. Just bytes.

👑 owner – who’s allowed to touch this?

This is the only program that can modify the account’s data or spend its lamports.

Anyone can send lamports to the account. But changing the data? That requires permission from the owner.

Web2 analogy: only the root user or the file owner can chmod a file.

🧠 executable – is this code or data?

  • true → this account is a program (smart contract)
  • false → this account is just holding data

That’s it. No third option.

⏳ rent_epoch – ignore this

Honestly? Ignore it. It’s deprecated. For all modern accounts, it’s just set to the maximum number. Move along.


The part that surprises most Web2 devs

Here’s where Solana flips the script.

Programs don’t store their own state.

Wait, what?

In Web2, your server (program) keeps things in memory or connects to a database. The code and the data live in the same place conceptually.

On Solana:

  • Program account = the logic (like a read-only function)
  • Data account = the state (like a row in a table)

They are separate.

A program can read and write to many data accounts, but it never “remembers” anything on its own between transactions.

Think of a program like a pure function. Give it data accounts as input. It gives you new data accounts as output. No hidden globals. No singletons.

This is weird at first. But it’s also beautiful.

It’s why Solana can run thousands of transactions in parallel — because transactions that touch different data accounts don’t conflict.


A tiny note on rent (but not scary rent)

Solana used to charge “rent” over time. That’s gone.

Now you just need to be rent-exempt.

That means your account holds enough lamports for its data size. For a basic account with no extra data, that’s about 0.00089 SOL (roughly a fraction of a penny).

Pay it once. Account stays forever. No monthly bills.


So… what do I actually remember?

If you know this from Web2 You already understand Solana
Key-value store (Redis, Dynamo) The whole blockchain
File permissions (chown, chmod) The owner field
Executable vs. data file The executable boolean
Paying for disk space lamports for rent exemption
Stateless functions Programs don’t store state

You’ve got this

The account model is the foundation of everything on Solana.

Tokens? Accounts.

NFTs? Accounts.

Governance votes? Also accounts.

Once you stop thinking in “classes and objects” and start thinking in “files and permissions,” Solana becomes much less intimidating.

You don’t need to write a smart contract tomorrow.

Just sit with the model for a day.

Look up an account on Solana Explorer.

See those five fields with your own eyes.

That’s the moment it clicks.

And when it does? You’re officially thinking like a Solana dev.

Happy building

Top comments (0)