DEV Community

Peter Okoh
Peter Okoh

Posted on

Week 4: #100DaysOfSolana; Account Model

On Solana, everything is an account. There’s no separation between wallet accounts, smart contracts, or data storage. They all live in one unified system. Every account is just a key-value entry where the key is a 32-byte address and the value is the account itself. I like to think of it as a giant filesystem where every file is an account.

Every Solana account also shares the same structure. It always has five fields: lamports (the balance in SOL, where 1 SOL = 1 billion lamports), data (a raw byte array for storing state), owner (the program that controls the account), executable (a flag that tells you if it’s a program), and rent epoch (mostly deprecated and usually maxed out now).

The ownership rule is also very strict but simple. Only the owner program can modify an account’s data or deduct its lamports. However, anyone can send lamports into an account as long as it’s writable. This makes the security model very predictable because control is tied to ownership, not identity.

One of the biggest surprises for me was that programs don’t store their own state. On Solana, programs are completely stateless. The program is just logic, while state lives in separate data accounts. So instead of a smart contract holding everything internally, it behaves more like a backend server that reads and writes to a database.

Another important concept is rent exemption. Every account must hold a minimum amount of lamports based on its data size to stay alive on-chain. If it meets that threshold, it becomes “rent-exempt” and won’t be deleted. This can be gotten using:

To make sense of it all, I like using a simple analogy: Solana is like a filesystem. Each account is a file with metadata (owner, permissions, size) and content (data). Programs are executable files, data accounts are documents, and the system program acts like the operating system that manages everything.

Once this model clicks, Solana stops feeling abstract. Transactions start to look like structured file operations, and the entire system becomes much easier to reason about.

Solana is making more sense to me now.

100DaysOfSolana

Day27

Top comments (0)