You now know the two primitives — hashing and signatures. This lesson assembles them into the structure the technology is named after: the chain of blocks, and the mechanism that lets thousands of strangers agree on a single version of it. That agreement mechanism, consensus, is the real breakthrough. We will see how blocks link into a tamper-evident chain, why that alone isn't enough, and how proof of work and proof of stake solve the genuinely hard problem: getting a leaderless network to agree without trusting anyone.
- Explain how blocks link together into a tamper-evident chain
- State the core problem consensus solves: agreement without a central authority
- Compare proof of work and proof of stake at a working level
- Explain finality, forks, and why 'longer chain wins'
From blocks to a chain
A block is a bundle of transactions plus a small header. The header's key ingredient is the hash of the previous block. Because each block embeds the previous block's fingerprint, the blocks form an ordered chain reaching back to the very first one. This is what makes history tamper-evident: if someone alters a transaction in an old block, that block's hash changes, which no longer matches the 'previous hash' stored in the next block, which breaks the link — and so on for every block after it. To rewrite one old transaction you'd have to redo every block since. The chain of hashes turns 'edit one entry' into 'redo all of history,' which is the whole point.
block {
height: 500
prev_hash: 00a3...f19c // fingerprint of block 499
transactions: [ ...signed txs... ]
timestamp: 1735689600
nonce: 42817
hash: 0091...b2d7 // this block's own fingerprint
}
// Block 501 will store prev_hash = 0091...b2d7.
// Change any tx here -> this hash changes -> the link to 501 breaks.Why chaining isn't enough: the agreement problem
Linking blocks by hashes makes tampering *detectable*, but it does not, by itself, decide which chain everyone should follow. In a decentralised network, many participants might each propose the next block at the same moment. Without a central authority to pick the winner, how does a leaderless network of anonymous strangers — some of whom may be dishonest — agree on one shared history? This is the deep problem blockchains had to solve, and it is why the technology is genuinely novel. The mechanism that solves it is called consensus, and it must make honest agreement the easy, profitable path and cheating prohibitively expensive.
Consensus is the real invention. Chaining blocks with hashes is simple. Getting a trustless, leaderless, global network to agree on one version of that chain — while resisting attackers — is the hard part, and it's what every consensus mechanism (proof of work, proof of stake) exists to do.
Proof of work: agreement by spending energy
Proof of work (PoW), used by Bitcoin, makes adding a block deliberately expensive. To propose a block, a participant (a miner) must find a special number, the nonce, such that hashing the block produces a hash below a target — many leading zeros, say. Because hashes are unpredictable, the only way to find such a nonce is to try billions of them, which costs real computing power and electricity. The first miner to find it broadcasts the block and, by the network's rules, earns a reward. Everyone else can *verify* the solution instantly by hashing once. So work is hard to produce but trivial to check.
This solves agreement because rewriting history would mean redoing all that work faster than the rest of the network combined — needing more than half the world's mining power, which is astronomically expensive. Honesty is cheaper than attacking. The costs, though, are real: PoW consumes a great deal of energy, which is the main criticism of Bitcoin and the reason many newer chains chose a different mechanism.
Proof of stake: agreement by putting money at risk
Proof of stake (PoS), which Ethereum now uses, replaces burned energy with money at risk. Instead of miners racing to solve puzzles, validators lock up a deposit of the chain's currency — their stake — for the right to propose and attest to blocks. The network picks validators to create blocks in a way weighted by their stake. The security comes from slashing: if a validator tries to cheat — proposing conflicting blocks or attesting to invalid ones — the network destroys part of their staked deposit. So attacking the chain means putting your own money on the line to lose it. PoS reaches the same goal — making honesty the profitable choice — without the enormous energy cost, which is why Ethereum switched to it.
| Aspect | Proof of Work | Proof of Stake |
|---|---|---|
| Who proposes blocks | Miners with computing power | Validators with staked coins |
| Cost of participating | Hardware and electricity | Locking up capital as stake |
| Cost of cheating | Out-compute the whole network | Lose your staked deposit (slashing) |
| Energy use | Very high | Very low |
| Used by | Bitcoin | Ethereum (since 2022) |
Forks, finality and 'longest chain wins'
Occasionally two valid blocks appear at nearly the same time and the chain temporarily forks into two branches. The network resolves this with a rule for which branch is canonical — classically, the chain with the most accumulated work (loosely, the 'longest chain') wins, and the other branch's block is orphaned. This is why a transaction becomes more trustworthy as blocks pile on top of it: reversing it would mean out-building all those blocks. In Bitcoin, waiting for several confirmations (blocks added after yours) is how you gain confidence. Proof-of-stake systems like Ethereum add explicit finality: after a couple of blocks are attested by validators, they are treated as irreversible, so you don't wait as long.
Practical takeaway: a transaction isn't truly settled the instant it appears in a block — it settles as blocks build on top (confirmations) or as validators finalise it. For anything valuable, wait for the confirmations or finality your chain recommends before treating a payment as done.