Consensus: Agreeing Without a Referee
Thousands of strangers, some possibly lying, settle on one shared history — not by voting, but by tying influence to a cost no one can fake.
Picture 10,000 strangers around the world, each keeping their own copy of the ledger, with no boss. At almost the same instant, two transactions hit the network: Alice pays Bob with her last coin, and Alice pays Carol with that same coin. Some copies hear Bob’s first; others hear Carol’s first. If they can’t agree on which one “really” happened, the double-spend you defeated back in lesson 1 sneaks right back in. So how do thousands of strangers — some possibly lying — settle on a single shared history? Hold the question.
The real problem is agreeing on the order
Storing a ledger is easy; the hard part is getting thousands of copies to agree on its order. Transactions ripple across the world at different speeds, so different copies see them in different sequences. And when two transactions conflict — spending the same coin — someone has to decide which came first. That decision is exactly what stops a double-spend.
So the job is: make every honest copy converge on one identical history of which transactions happened and in what order — despite network delays, crashed machines, and outright liars. That’s the consensus problem, and everything else in this module is built on its answer.
Why you can’t just take a vote
The obvious idea: let every node vote on the order, majority wins. It collapses instantly, because on the internet identities are free. One person can spin up a million fake nodes and outvote everyone — a Sybil attack (named for a case of many false identities). “One node, one vote” is meaningless when anyone can mint unlimited nodes for nothing.
The fix is to tie the right to propose the next block to a scarce, costly resource — real computing work, or real money put at stake — so influence can’t be faked by inventing names. You can have a thousand identities, but you can’t fake having done the work or staked the funds. (Which scarce resource? That’s mining vs staking, next lesson.)
The rule that makes copies converge
Once proposing a block costs a scarce resource, add one shared rule everyone follows: treat the history with the most accumulated cost behind it — the “heaviest,” or longest valid, chain — as the real one.
When two valid blocks appear at once, the network briefly splits into two branches. But the next costly block lands on one of them, making that branch heavier, and everyone switches to it. No referee chooses; the rule plus the cost does. This means agreement isn’t a stamped certificate — it’s economic and probabilistic. The deeper a block is buried, the more an attacker would have to out-spend the entire honest network to rewrite it (the cascade from lesson 4), so deep history is treated as settled: not “mathematically impossible to change,” but “so costly to change that it’s irrational to try.”
Imagine thousands of people independently building the same Lego tower, hearing about new bricks by word of mouth, so news arrives out of order. To avoid chaos they agree on one rule: “always build on the tallest tower you’ve seen — and adding a brick takes real effort (you must solve a hard puzzle, or put down a deposit, first).” If two people place a brick at the same height, there are briefly two towers — but the next effortful brick lands on one, making it taller, and everyone moves to the tallest. No referee decides. And secretly building a taller rival tower to rewrite history would mean out-building the entire crowd at once — far more effort than it could ever be worth.
The double-spend race, resolved by consensus: 1. Alice broadcasts two conflicting transactions: pay Bob and pay Carol, with the same single coin. 2. Half the network hears “Bob” first, half hears “Carol” first — genuine temporary disagreement. 3. A proposer who paid the scarce cost bundles, say, the Bob transaction into the next block and extends the chain. 4. The shared rule — “build on the heaviest chain” — means the following proposer builds on the block that contains Bob’s transaction. 5. Alice→Carol is now invalid (the coin is already spent in the agreed history), so it’s dropped. Every copy converges on the same single history: Alice→Bob. No referee ruled — everyone following the cost-plus-heaviest- chain rule produced one agreed answer.
This is the reading. The interactive version — active-recall quiz, a hands-on experiment you run in your own AI, and an earned mastery check — is free in the app.
Start this lesson free →