Crypto glossary

Longest chain rule

Definition

The longest chain rule tells proof-of-work nodes to follow the valid chain with the most accumulated work, which resolves forks without any central referee.

When nodes see two competing versions of the blockchain, they need a deterministic way to pick one. Bitcoin's answer is to follow the valid chain that represents the greatest total proof of work. It is popularly called the longest chain, although what counts is cumulative difficulty, not the number of blocks: a shorter chain mined at higher difficulty would win.

This simple rule lets thousands of nodes that never coordinate converge on the same history. Miners have an incentive to build on the heaviest tip, because blocks on a losing branch earn nothing, so temporary forks usually resolve within one block.

The rule also defines the security model. Anyone controlling a majority of hashrate could produce a heavier chain in private and trigger a reorganisation, which is the basis of the 51% attack. Proof-of-stake systems replaced it with other fork-choice rules, such as Ethereum's LMD-GHOST combined with Casper FFG finality.

Example

A node following a branch with 10 blocks at low difficulty switches to a rival branch with 9 blocks at much higher difficulty, because the rival carries more cumulative work.

Related terms