DEV Community

Cover image for Understanding Solana’s Account Model as a Web2 Developer
Tobi Ayinmiro
Tobi Ayinmiro

Posted on

Understanding Solana’s Account Model as a Web2 Developer

Understanding Solana’s Account Model as a Web2 Developer

When I started learning Solana, I expected wallets and smart contracts to work like Ethereum. Instead, I discovered something very different:

On Solana, everything is an account.

At first, that sounded simple. But it completely changed how I thought about blockchain architecture.

As a Web2 developer, I’m used to systems that look like this:

Frontend → Backend API → Database
Enter fullscreen mode Exit fullscreen mode
  • The backend stores logic
  • The database stores state

Solana works differently — but underneath it all is a surprisingly familiar mental model.

The easiest way to understand Solana’s account model is to think of it like a filesystem or operating system:

  • Accounts = files
  • Programs = executable applications
  • Data accounts = databases/documents
  • The System Program = operating system kernel

Once this clicks, the rest of Solana becomes much easier to understand.


Everything on Solana Is an Account

Unlike Ethereum, which separates:

  • externally owned accounts (wallets)
  • contract accounts (smart contracts)

Solana uses a unified account model for everything.

On Solana:

  • wallets are accounts
  • programs are accounts
  • tokens are accounts
  • NFT metadata lives in accounts

Everything exists inside one giant flat key-value store.

key   = public address
value = account data
Enter fullscreen mode Exit fullscreen mode

Or, if you’re thinking like a backend developer:

Map<PublicKey, Account>
Enter fullscreen mode Exit fullscreen mode

That simplicity is one of the reasons Solana can process transactions efficiently.


Every Solana Account Has the Same Structure

Every account contains the same core fields:

Field Purpose
lamports SOL balance
data Raw bytes storing state
owner Program allowed to control the account
executable Whether the account contains executable code
rent_epoch Deprecated rent-related field

Let’s break them down.


1. Lamports

Lamports are the smallest unit of SOL.

1 SOL = 1,000,000,000 lamports
Enter fullscreen mode Exit fullscreen mode

Similar to:

  • dollars → cents
  • bitcoin → satoshis

Example:

500000000 lamports = 0.5 SOL
Enter fullscreen mode Exit fullscreen mode

Lamports are used for:

  • transaction fees
  • storing accounts
  • transferring SOL

2. Data

The data field stores arbitrary bytes.

This is where programs save state, including:

  • token balances
  • NFT metadata
  • usernames
  • protocol configuration
  • DeFi positions

Unlike traditional databases, Solana does not store JSON directly.

Everything is serialized into bytes.

For Web2 developers, this feels more like:

  • binary storage
  • buffers
  • low-level database records

3. Owner

The owner field is one of the most important concepts in Solana.

It defines which program controls an account.

Example:

Owner: Token Program
Enter fullscreen mode Exit fullscreen mode

That means only the Token Program can:

  • modify the account’s data
  • debit lamports from the account

This is the foundation of Solana’s security model.

Ownership Rules

Solana follows a surprisingly simple set of rules:

Only the owner program can:

  • modify account data
  • remove lamports from the account

But anyone can:

  • send lamports to a writable account

Without ownership rules, any program could edit any account’s data.

Imagine random APIs directly modifying your production database tables.

That would be chaos.

Solana prevents this through program ownership.


4. Executable

The executable field is simply a boolean.

true  = account contains program code
false = account stores data
Enter fullscreen mode Exit fullscreen mode

If executable = true, the account contains compiled program code.

Otherwise, it’s just a data account.


5. Rent Epoch

This field is mostly deprecated today.

Historically, it related to Solana’s rent system.

Now it’s typically set to a maximum value and ignored in most cases.


The Biggest Mindset Shift: Programs Don’t Store Their Own State

This was the concept that confused me the most.

On Solana:

Programs are stateless.

Smart contracts do not permanently store their own internal state.

Instead:

  • program accounts store executable code
  • separate accounts store persistent data

This is very different from Ethereum.


The Web2 Analogy That Made It Click

Think of a Solana program like a Node.js backend service.

The backend server:

  • contains logic
  • processes requests
  • validates data

But it does not permanently store all user data in memory.

Instead, it reads from and writes to a database.

Solana works the same way:

Program Account = Backend Server
Data Accounts   = Database Records
Enter fullscreen mode Exit fullscreen mode

Programs execute logic.

Accounts store persistent state.


Example: A Todo App on Solana

Imagine building a Todo app.

Program Account

Contains logic like:

createTodo()
updateTodo()
deleteTodo()
Enter fullscreen mode Exit fullscreen mode

Data Accounts

Store actual user data:

- todo text
- completed status
- owner wallet
Enter fullscreen mode Exit fullscreen mode

The program modifies data accounts whenever users interact with the app.


Why Solana Separates Code From State

At first, this architecture feels inconvenient.

But it enables several powerful features:

  • parallel transaction execution
  • better scalability
  • clearer ownership rules
  • flexible storage patterns

Because accounts are separate from programs, Solana can determine which transactions touch which accounts.

That allows many transactions to execute simultaneously.

This is one of the major reasons Solana is fast.


Rent Exemption Explained

Every account on Solana must maintain a minimum balance to stay on-chain.

This is called:

rent exemption

The required amount depends on the account’s data size.

More data requires:

  • more storage
  • more lamports

For a tiny account with no additional data, the requirement is roughly:

~0.00089 SOL
Enter fullscreen mode Exit fullscreen mode

You can check rent requirements with:

solana rent 0
Enter fullscreen mode Exit fullscreen mode

Or via RPC:

getMinimumBalanceForRentExemption()
Enter fullscreen mode Exit fullscreen mode

Why Rent Exists

In Web2 systems:

  • servers have storage limits
  • databases cost money

Solana validators also store account data permanently.

Without rent requirements, attackers could spam the network with millions of useless accounts.

Rent helps prevent storage abuse.


Reading a Real Solana Account

Using the CLI:

solana account <ACCOUNT_ADDRESS>
Enter fullscreen mode Exit fullscreen mode

You might see:

Public Key: 7xKXtg2CW...
Balance: 0.002 SOL
Owner: System Program
Executable: false
Rent Epoch: 18446744073709551615
Data Length: 0
Enter fullscreen mode Exit fullscreen mode

Here’s how to interpret it:

Field Meaning
Public Key Account address
Balance SOL stored in the account
Owner Program controlling the account
Executable Whether it stores code
Data Length Amount of stored data
Rent Epoch Deprecated field

Once you understand these fields, Solana Explorer becomes much easier to read.


Example of an account detail

The System Program

One program you’ll constantly encounter is the System Program.

Think of it like the operating system kernel.

It handles:

  • account creation
  • SOL transfers
  • ownership assignment
  • storage allocation

Almost every Solana application interacts with it.


Comparing Solana to Ethereum

Ethereum

  • contracts store their own state
  • different account types exist
  • code and storage are tightly coupled

Solana

  • everything is an account
  • programs are stateless
  • state lives in separate accounts
  • unified account architecture

This is one of the biggest conceptual shifts for Web2 developers entering Solana.


Final Mental Model

Here’s the simplest way I now think about Solana:

Accounts       = Files
Programs       = Executable apps
Data Accounts  = Databases/documents
System Program = Operating system
Enter fullscreen mode Exit fullscreen mode

Once the account model clicks, many other Solana concepts become easier to understand:

  • tokens
  • NFTs
  • staking
  • DeFi protocols
  • DAOs

They all build on the same foundation:

  • accounts
  • ownership
  • programs
  • data storage

And honestly, that unified design is one of the things that makes Solana so interesting to learn as a developer.

Top comments (0)