Blockchain · consensus mechanisms

Agreement without anyone in charge.

A blockchain is a shared ledger that thousands of strangers keep identical copies of, with no bank or referee. Two ideas make it work: hashes that make tampering obvious, and a consensus rule that decides whose next page gets added.

Demo 1 · SHA-256, live

Edit any block and watch the chain break

Each block’s hash is a fingerprint of its contents and the previous block’s hash. Change one character in block 2 and its fingerprint changes, so block 3 no longer points to it, and so on down the chain. Re-mining means finding a new nonce whose hash starts with enough zeros: that work is proof of work.

Demo 2 · proof of work security

Can an attacker rewrite history?

To reverse a payment, an attacker must secretly build a longer chain than the honest network. Each confirmation is a block they have to make up. Satoshi Nakamoto’s 2008 white paper worked out the odds.

Chance the attacker ever catches up
Why six confirmations?With 10% of hash power, an attacker’s chance against 6 confirmations is about 0.02%. At 50% or more the attacker always wins eventually: that’s the “51% attack”. Smaller proof-of-work chains with little hash power, such as Ethereum Classic in 2020, have suffered real ones.
Demo 3 · fault tolerance

The Byzantine generals

Generals surrounding a city must all attack together or all wait, but some may be traitors sending conflicting messages. Lamport, Shostak and Pease (1982) proved that agreement needs more than two-thirds of the generals to be loyal. Proof-of-stake chains like Ethereum and BFT chains like Cosmos build on this result.

Protocol tolerates up to

Model: loyal generals vote ATTACK. Traitors tell half the others ATTACK and half RETREAT. A general commits once it hears a quorum (2f+1 matching votes, where f is the number of traitors the protocol was built to tolerate). This is the core of PBFT (Castro and Liskov, 1999) and Tendermint.

Field guide

How networks decide who writes the next block

Every mechanism answers the same question: what makes it costly to cheat? Electricity, money at stake, reputation, or simply enough honest votes.

MechanismCost of cheatingFinalityEnergy useWho can join
Proof of workHardware + electricityProbabilistic (deeper is safer)Very highAnyone with hardware
Proof of stakeStaked coins can be slashedFinal after ~2 epochs on EthereumLowAnyone with stake
Delegated PoSLosing votes and rewardsFastLowElected producers
Proof of authorityPublic reputationFastLowApproved validators
BFT (PBFT, Tendermint)Need over ⅓ of votes to breakInstant, once committedLowA known validator set
Raft / PaxosAssumes no liars, only crashesInstantLowTrusted servers
Key ideas

The vocabulary of distributed agreement