Skip to content
AdvancedLook up a term

What is the longest chain rule?

Author
CRYPTO PORT Editorial
Published
Updated
Reading time
5 min

In short

The longest chain rule decides which branch is authoritative when the chain forks. 'Longest' does not mean the most blocks — it means the greatest cumulative work. The distinction matters, because comparing branches of differing difficulty by block count gives the wrong answer.

Key points

  • Decides which branch wins when the chain forks
  • Compares cumulative work, not block count
  • Counting blocks misjudges branches of different difficulty
  • It defines when and how far a reorg can reach

Definition

The rule that treats the branch with the greatest cumulative work — the sum of each block's difficulty — as the valid chain. It is more precisely called the heaviest-chain rule.

When two blocks at the same height appear almost simultaneously, the network briefly holds two branches. Each node extends whichever it saw first, but once one branch pulls ahead, every node switches to it and the abandoned blocks become invalid.

What 'ahead' means is the crux. Comparing raw block counts would let a branch stacked cheaply at low difficulty win. The actual rule sums each block's difficulty and compares cumulative work, so a shorter branch with harder blocks prevails.

When nodes switch branches, the transactions in the discarded blocks return to an unconfirmed state. From the recipient's side, a payment that appeared to have arrived simply disappears. Waiting for confirmations is the practice that lowers the odds of this happening.

Proof-of-stake chains use an analogous fork-choice rule, but the weight comes from validator votes rather than computation, and they typically mark blocks meeting certain conditions as finalised and therefore out of reach of any reorg.

Watch out for

  • · Saying 'more blocks wins' is inaccurate; cumulative work is what is compared
  • · Transactions right after a fork are not settled and can vanish while confirmations are few
  • · Fork-choice rules differ by chain, so Bitcoin's explanation does not carry over

Related coins

Read next

Crypto quizzes

Answer a few questions and get your result instantly.

Start