Consensus Mechanisms
Chapter 3 deliberately left one piece open: what "proof-of-work" actually means, and how a network of mutually distrusting participants, with no central authority, ever agrees on one single, shared version of the chain. This chapter fills that gap in full, then covers the real alternative approach — Proof of Stake — that Ethereum, the second-largest blockchain network, actually switched to in 2022.
Proof of Work: Making Agreement Expensive to Fake
Recall Chapter 3's own header field, nonce — "number used once." Mining is
the process of repeatedly changing that nonce (and re-hashing the block header with SHA-256 each
time) until the resulting hash happens to fall below a specific target value set by the network's
current difficulty. Because SHA-256 output is unpredictable (the avalanche
effect from Chapter 2), there's no shortcut — the only way to find a valid nonce is to keep
trying different values and hashing, over and over, which is exactly why this is called "proof of
work": finding a valid block genuinely requires spending real, verifiable computational
effort.
Crucially, verifying a solved block is nearly instant — anyone can hash the header once and check the result against the target — while finding that nonce in the first place took an enormous number of attempts. This "hard to solve, trivial to verify" asymmetry is the whole engine behind proof-of-work.
Difficulty Adjustment
Bitcoin's network re-targets its own difficulty every 2016 blocks. At the network's intended pace of one block roughly every 10 minutes, 2016 blocks works out to exactly 2016 × 10 minutes = 20,160 minutes, or precisely 14 days. Every two weeks, the network checks how long the previous 2016 blocks actually took to mine and adjusts the difficulty target up or down — harder if blocks came in faster than 10 minutes on average (meaning more total mining power joined the network), easier if they came in slower. This keeps the real average block time close to 10 minutes regardless of how much total computing power is pointed at the network at any given moment.
Resolving Temporary Forks: The Longest-Chain Rule
Because mining is a genuinely random race, it's entirely possible for two different miners, somewhere on the network, to each find a valid next block at nearly the same moment — briefly producing two competing versions of the chain. Bitcoin's rule for resolving this is simple: nodes always follow whichever valid chain represents the most total accumulated proof-of-work (in practice, usually just the longest chain). Miners building on the "losing" branch abandon it and switch to extending the winning one instead, and the transactions in the discarded block return to the pool of unconfirmed transactions to be included in a future block.
The 51% Attack
If a single miner or coordinated group ever controlled more than half the network's total mining power, they could, in principle, mine faster than the rest of the network combined — enough to build an alternative chain that eventually overtakes the honest one, letting them double-spend coins or censor specific transactions. This is the real, named 51% attack.
In practice, this stays economically impractical against an established network like Bitcoin, even though it's not theoretically impossible. A real 2025 estimate by Duke University finance professor Campbell Harvey put the cost of executing a week-long 51% attack on Bitcoin, at October 2025 prices, at around $6 billion — a real, staggering figure, but still under 1% of Bitcoin's own total market value at the time, meaning an attacker would be risking an enormous sum against a network whose participants have every incentive to notice and respond.
Proof of Stake: Replacing Computation With Skin in the Game
Proof of Stake (PoS) takes a structurally different approach to the same problem — how does the network agree on who gets to propose the next block, without a trusted central party? Instead of racing to solve a computational puzzle, participants ("validators") lock up, or "stake," a quantity of the network's own cryptocurrency as collateral. The network selects who proposes and validates each new block roughly in proportion to how much they've staked, rather than how much raw computing power they control.
Because there's no computational race to win, PoS avoids proof-of-work's own enormous energy cost almost entirely. Security instead comes from the stake itself: a validator caught acting dishonestly (proposing invalid blocks, or supporting two conflicting chains at once) can have a real, meaningful portion of their staked coins destroyed — a process called slashing — giving validators a direct financial reason to behave honestly.
Ethereum's Real Transition: "The Merge"
Ethereum, the second-largest blockchain network by market value, actually made this switch in a real, documented event known as "The Merge," completed in September 2022 — moving its entire live network from proof-of-work to proof-of-stake. The reported result was dramatic: Ethereum's own energy consumption fell by more than 99% almost immediately, with some sources citing a reduction exceeding 99.9%.
| Proof of Work (Bitcoin) | Proof of Stake (Ethereum, since 2022) | |
|---|---|---|
| Who proposes the next block | Whoever solves the computational puzzle first | A validator selected roughly in proportion to staked coins |
| Cost of dishonest behavior | Wasted electricity and computing hardware | Slashing — a real, direct loss of staked coins |
| Energy use | Very high — the expense is the security mechanism | Dramatically lower — Ethereum reported a >99% real reduction after 2022 |
| Real, honest criticism | Enormous energy consumption | Wealthier participants can stake more and earn proportionally more influence |
Hands-On Exercises
Three exercises reinforcing how each consensus mechanism actually secures the network, before Chapter 5 turns to Bitcoin's own real, specific implementation of everything covered so far.
Quick Reference
- Proof of work — miners repeatedly hash the block header with different nonces until the result falls below a difficulty target; hard to solve, trivial to verify.
- Difficulty adjustment — Bitcoin retargets every 2016 blocks (~2 weeks at a 10-minute target), keeping average block time stable regardless of total mining power.
- Longest-chain rule — the network follows whichever valid chain has the most accumulated proof-of-work, resolving temporary forks.
- 51% attack — controlling a majority of mining power enables rewriting recent history; real, but economically extreme (a 2025 estimate put a week-long Bitcoin attack around $6 billion).
- Proof of stake — validators are selected in proportion to staked coins rather than computing power; dishonesty is punished by slashing (losing staked coins).
- The Merge — Ethereum's real September 2022 switch from proof-of-work to proof-of-stake, cutting its own energy use by over 99%.