Solana throws away the state trie entirely. Just pubkey β bytes in RocksDB.Programs are accounts. Data is in accounts. Parallel execution via Sealevel because transactions pre-declare which accounts they touch.
No Merkle Patricia Trie. No IAVL. No State Trie At All.
Ethereum/Cosmos: every state read/write β traverse a deep tree β many DB lookups
Solana: pubkey β bytes β 1 DB lookup. Done.
Everything is an Account
Wallets, tokens, programs, config β everything is an account. Each account = lamports (SOL) + bytes (data) + owner program.
Programs are Stateless
A program (smart contract) only stores bytecode. All mutable state lives in separate "data accounts" owned by the program. This enables parallelism.
Parallel via Account Declarations
Transactions must declare all accounts upfront. The scheduler sees which txs share accounts and runs independent ones in parallel via Sealevel.
Account Types β Everything in Solana
Click any account to explore its structure.
Account Structure
1// Solana Account Model β NO GLOBAL STATE TRIE2// Every account is just a blob of bytes in RocksDB34Account {5 lamports: u64, // SOL balance (1 SOL = 1e9 lamports)6 data: Vec<u8>, // arbitrary data (up to 10MB)7 owner: Pubkey, // which program owns this account8 executable: bool, // is this account a program?9 rent_epoch: u64, // when rent was last collected10}1112// Storage key: just the pubkey (32 bytes)13DB[alice_pubkey] = serialize(alice_account)14DB[program_pubkey] = serialize(program_account) // program is also an account!1516// NO global state trie17// NO keccak256(address) β nibbles β trie traversal18// JUST: pubkey β bytes
1// Programs (Smart Contracts) = Just Accounts2// The code lives in a "program account" with executable=true34// Program account:5{6 owner: BPF_LOADER_PUBKEY,7 executable: true,8 data: [compiled BPF bytecode...] // the actual program9}1011// State accounts (owned by programs):12{13 owner: spl_token_program, // this program controls the data14 data: serialize(TokenAccount {15 mint: usdc_mint_pubkey,16 owner: alice_pubkey,17 amount: 1000000, // 1 USDC (6 decimals)18 ...19 })20}2122// KEY INSIGHT: Programs are stateless!23// A program's code never changes its own data24// Instead, it updates "data accounts" that it owns25// This is why Solana can parallelize transactions
Sealevel β Parallel Execution Engine
1// Sealevel β Solana's Parallel Execution Engine2// Why it works: transactions declare ALL accounts they'll touch34// Transaction must declare:5tx.accounts = [6 { pubkey: alice, is_writable: true, is_signer: true },7 { pubkey: bob, is_writable: true, is_signer: false },8 { pubkey: usdc, is_writable: false, is_signer: false },9]1011// Scheduler can see:12// Tx1 reads/writes: [alice, bob]13// Tx2 reads/writes: [carol, dave]14// Tx3 reads/writes: [alice, carol] // conflicts with Tx1 and Tx2!1516// Tx1 and Tx2 β PARALLEL (no shared accounts)17// Tx3 β must wait for Tx1 and Tx2 to finish1819// Compare to Ethereum:20// Txs can read/write any account β must run sequentially
Visual: Parallel vs Sequential Execution
AccountsDB β Append-Only Storage
1// Solana AccountsDB β How accounts are stored2// Uses an append-only write structure for performance34// Old accounts are NOT modified in place5// Instead, new versions are APPENDED and old ones marked as dead67AccountsDB {8 // Append-only storage files9 append_file_1: [account_v1_data, account_v2_data, ...]10 append_file_2: [new_account_data, ...]1112 // Index: pubkey β (file_id, offset, size)13 index: {14 alice: (file_2, offset_100, 128), // latest version15 bob: (file_1, offset_500, 96),16 }17}1819// Merkle hash for verification:20// Not a full trie! Uses account-hash for each account21// Then a separate "bank hash" combines all changed accounts22// Much simpler than Ethereum's per-account trie2324bank_hash = hash(25 prev_bank_hash,26 hash_of_all_account_changes_in_block // simple XOR of account hashes27)
Rent β Preventing State Bloat
1// Solana Rent β Paying for Storage2// Accounts must maintain minimum balance or get deleted34// Minimum balance = (account_size bytes) Γ rent_per_byte5// At current rates: ~0.00089 SOL per KB per year67// Rent-exempt: if balance > rent_minimum, never deleted8alice_min_lamports = RENT_EXEMPTION_THRESHOLD(account_size)9// β 2 years of rent (about 0.002 SOL for a basic account)1011// If balance falls below minimum:12// β account is garbage collected β data DELETED from DB13// This keeps the DB clean β no state bloat!1415// Ethereum comparison:16// Ethereum has state bloat β old contract storage stays forever17// Solana's rent forces cleanup of unused state
How Flat Storage β Capabilities
No state trie β direct pubkey lookupReading account state = 1 RocksDB lookup. Ethereum = O(64) trie node reads. Solana is dramatically faster for reads.
Pre-declared account access + stateless programsSealevel can run thousands of transactions in parallel. ~65,000 TPS theoretical. No sequential bottleneck.
No global state Merkle proofCan't prove account state to a light client like Ethereum can. Solana needs validators to trust each other more.
Rent mechanismForces accounts to hold minimum SOL. Prevents state bloat. But unfamiliar to Ethereum developers.
Programs are fixed code accountsPrograms can't be upgraded unless they use special upgrade authority pattern. More secure but less flexible.