Sign in

What Solana is

Suggest an edit

Ethereum runs transactions one after another. Solana was designed to run them at the same time wherever it can. To make that possible, every transaction declares up front which state it will read and which it will write.

Every transaction declares what it touches

Solana starts from the same architecture as any blockchain and adds one constraint: the runtime should be able to execute unrelated work in parallel.

On Ethereum a contract decides which storage to read and write while its code runs. A node cannot tell before execution whether two transactions will touch the same state, so the transactions of a block are processed one after another. Solana requires that information in advance.

Picture a global computer where the state is broken into millions of small, independently-owned cells. Anyone can read any cell. Writing to a cell requires permission. Every transaction has to declare up front which cells it will read and which it will write, a manifest of what it touches. The runtime takes those declarations, sorts the incoming transactions into groups whose cell-sets do not overlap, and runs the groups on different threads at the same time.

Declared account lists let Solana run non-overlapping transactions in parallelThree transactions each declare which accounts they touch: Tx 1 uses A and B, Tx 2 uses C and D, Tx 3 uses B and E. The runtime runs Tx 1 and Tx 2 in parallel since they share no accounts, but makes Tx 3 wait because it overlaps with Tx 1 on account B. Why declared accounts let the runtime parallelize Transaction 1 accounts: A, B Alice sends tokens to Bob Transaction 2 accounts: C, D Carol updates her NFT listing Transaction 3 accounts: B, E Dave reads from Bob's account Runtime checks the declared account lists Tx 1 touches {A, B}. Tx 2 touches {C, D}. Tx 3 touches {B, E}. Tx 3 overlaps with Tx 1. Tx 1 and Tx 2 run in parallel no overlap, different threads, same slot Tx 3 waits for Tx 1 runs after, on B's new state Declared access lets the runtime sort transactions into batches that can run side by side.

Programs and wallets are the same kind of account

The cells in the picture above are called accounts. Every account has an address, a balance in lamports, which is Solana's smallest unit at one billionth of a SOL, some bytes of data, and an owner. Each account is owned by one program, and only that program is allowed to change the account's data. Reads are open to anyone.

Ethereum has two kinds of accounts: user accounts controlled by a private key, and contract accounts controlled by code. Solana has one kind, and a program is an account whose data is executable code and whose owner is the special loader program that knows how to run it. A user's wallet is an account owned by the System Program. A token balance is an account owned by the Token Program.

Creating an account locks a deposit in lamports sized to its data, called rent, and every transaction pays a fee in lamports. The lessons on rent and fees cover both.

The price is hardware and a harder programming model

Ethereum made a different choice, a global serial computer with a simpler programming model. On Solana you have to know every account a transaction will touch before you send it, and the throughput depends on validators running far more demanding hardware than an Ethereum node needs. Why Solana was built differently derives the rest of the programming model from the parallel-execution choice, and What Solana traded for what goes through the costs.