Fork Choice Rule
The rule a node follows to choose between competing chain tips.
Basically
A fork choice rule picks one valid chain when several exist. It lets honest computers running the network agree on the same transaction history.
Key Takeaways
- A fork choice rule tells a node which valid branch to follow when competing forks exist. Without it, nodes would never agree on one canonical chain.
- Bitcoin uses the heaviest-chain rule, based on the most cumulative proof of work. Ethereum uses LMD-GHOST, which counts validator attestation weight to select the chain head.
- Fork choice bugs can cause chain reorganisations and network splits. Correct implementation is central to blockchain security and finality.
What Is a Fork Choice Rule?
A fork choice rule is the algorithm a blockchain node uses to determine the canonical, or correct, chain when multiple valid branches compete. Blocks can propagate asynchronously in any decentralised network, so two or more valid blocks can appear at nearly the same time for the same chain position and create a fork. The rule resolves this ambiguity so all honest nodes converge on one version of the ledger.
The fork choice rule is distinct from the consensus mechanism, though the two are tightly coupled. Consensus determines how blocks are created and validated, while the fork choice rule determines which valid blocks join the main chain. Every blockchain needs both a way to produce blocks and a way to choose between competing blocks.
An election with multiple voting rounds offers a useful comparison. The consensus mechanism defines who can vote and what counts as a valid ballot, while the fork choice rule is the counting method that determines the winner.
How It Works
Every fork choice rule takes the same basic inputs: the blocks and protocol messages, such as votes and attestations, that a node has observed. It outputs one block that the node treats as the current chain head. All transactions and state derive from the path between the genesis block and this selected head.
Specific algorithms vary dramatically between protocols, but their fundamental goal stays the same. Given the same information, all honest nodes should arrive at the same answer.
Bitcoin: Heaviest Chain
Bitcoin's fork choice rule is commonly called the "longest chain rule", but that term is technically imprecise. Bitcoin nodes actually select the chain with the most cumulative proof of work, meaning the highest chainwork value, rather than the chain with the most blocks.
The distinction matters because Bitcoin's mining difficulty adjusts over time. A chain with fewer blocks mined at higher difficulty can represent more total computational work than a chain with more blocks mined at lower difficulty. Selection by cumulative work rather than block count prevents an attacker from creating a longer but lighter chain by exploiting difficulty adjustment boundaries.
Satoshi Nakamoto's original 2009 Bitcoin code compared block height, but this was corrected in July 2010 to compare cumulative work. The whitepaper used "longest chain" on the implicit assumption that all blocks require roughly equal work, a simplification that holds only when difficulty is constant.
Ethereum: LMD-GHOST
Ethereum switched from a proof-of-work fork choice rule to LMD-GHOST, or Latest Message Driven Greediest Heaviest Observed SubTree, after the Merge in September 2022. LMD-GHOST counts the attestation weight of proof-of-stake validators rather than computational work to determine the chain head.
The algorithm works by traversing the block tree. Its traversal begins at a starting checkpoint.
The "Latest Message Driven" qualifier means that only each validator's most recent attestation counts, not historical votes. This prevents vote accumulation attacks in which old messages could be replayed to manipulate the fork choice.
Yonatan Sompolinsky and Aviv Zohar proposed the original GHOST protocol in 2013 to address the reduced security caused by high stale block rates in blockchains with fast block times. Ethereum's LMD-GHOST adaptation builds on this insight by weighting validator attestations instead of block count.
Casper FFG: The Finality Overlay
Ethereum's fork choice does not operate alone. Casper FFG, or Friendly Finality Gadget, was proposed by Vitalik Buterin and Virgil Griffith in 2017 and acts as a finality overlay on top of LMD-GHOST. Together, they form the combined protocol known as Gasper.
Casper FFG introduces two key concepts: justification and finalisation. Checkpoints occur at epoch boundaries, every 32 slots or roughly every 6.4 minutes, and a checkpoint becomes justified when two-thirds or more of total staked ETH votes for it. A justified checkpoint becomes finalised when its direct child checkpoint is also justified, after which a block cannot be reverted without at least one-third of total staked ETH being slashed.
LMD-GHOST begins its tree traversal from the latest justified checkpoint, not from genesis. Casper FFG constrains the fork choice rule's starting point. The fork choice rule then determines the head within those constraints.
Probabilistic vs. Deterministic Finality
Fork choice rules produce different types of finality depending on the underlying consensus mechanism. The main distinction here is between probabilistic and deterministic finality.
Bitcoin's heaviest-chain rule provides probabilistic finality: a transaction is never mathematically 100% final, but the cost of reversal grows exponentially with each block confirmation. The trade-off is that the chain never halts, even under network partitions.
BFT-based protocols like Tendermint provide deterministic finality: once two-thirds of validators sign off on a block, it is irreversible. The trade-off is that the chain stops producing blocks entirely if more than one-third of validators go offline.
Ethereum's Gasper sits between these extremes. LMD-GHOST provides fast probabilistic confirmation within a single 12-second slot, while Casper FFG adds economic finality after roughly 12.8 minutes. This layered approach lets users choose their own confidence threshold based on transaction value.
Why It Matters
The fork choice rule directly determines the security guarantees that users, developers and protocols rely on, rather than remaining an abstract academic detail. A well-designed fork choice rule ensures that transactions settle reliably and that chain reorganisations are rare and shallow.
Layer-2 protocols like the Lightning Network and Spark rely on the base layer's fork choice rule as the ultimate security backstop. Any layer-2 state anchored to a layer-1 transaction becomes uncertain if that transaction can be reorged out. Confirmation depth requirements for deposits and finality guarantees for cross-chain bridges exist because of this risk.
Exchange deposit policies, bridge security assumptions and DeFi protocol parameters all derive from the properties of the underlying fork choice rule. Bitcoin's 6-confirmation convention for high-value transactions is a direct consequence of its probabilistic fork choice. Ethereum's finalised checkpoint model enables faster settlement for protocols that wait for finality rather than a fixed number of confirmations.
Fork Choice Bugs
Implementation bugs in fork choice logic can cause catastrophic network splits. In August 2020, the Ethereum Medalla testnet suffered a major incident when a Prysm client clock synchronisation error caused validators to disagree on the current slot, triggering over 3,000 slashing events and dropping participation to near zero. Roughly 62-65% of validators ran Prysm at the time, highlighting the dangers of client monoculture.
A Prysm bug after Ethereum's Fusaka upgrade in December 2025 caused unnecessary old state regeneration when processing outdated attestations. Validator participation dropped to 75%, leaving the network just 9% away from losing finality. Client diversity saved the network because Lighthouse, Nimbus and Teku continued operating normally.
Chain Reorganizations
Short chain reorganisations of 1-2 blocks are normal and expected in any blockchain. They occur when two valid blocks are produced near-simultaneously and the fork choice rule resolves the tie. Deeper reorgs, however, can enable double-spends and disrupt applications.
Low-hashrate proof-of-work chains are particularly vulnerable. Mining economics directly affect reorg risk, and chains where an attacker can rent sufficient hash power have suffered 51% attacks with 100+ block reorganisations. Ethereum Classic experienced multiple such attacks in 2019 and 2020, with millions of dollars double-spent.
Finality Delays
Proof-of-stake systems that separate fork choice from finality, like Ethereum's Gasper, can see the finality gadget fall behind while fork choice continues advancing. Casper FFG cannot justify new checkpoints if participation drops below two-thirds of staked ETH, so finality stalls. Ethereum mainnet experienced this in May 2023, when client bugs caused finality delays lasting several hours.
Ethereum's roadmap addresses this with 3-slot finality, or 3SF, a proposal to replace the current two-epoch finality window with roughly 36-second finality. Under 3SF, the fork choice and finality mechanisms would be unified rather than operating as separate layers.
Client Diversity
A single fork choice bug can affect the entire network when a supermajority of nodes runs the same client software. Client diversity, meaning multiple independent implementations of the same protocol, is the primary defence against this risk. Networks where a single client holds more than one-third of stake face existential risk from a single software bug.
Fork Choice in Layer-2 Protocols
Layer-2 scaling solutions inherit the fork choice properties of their base layer but may add their own conflict resolution mechanisms. Optimistic rollups, for example, use a challenge period during which fraud proofs can revert incorrect state transitions. ZK-rollups rely on validity proofs that provide immediate mathematical certainty.
Bitcoin layer-2 protocols like Spark and the Lightning Network anchor their state to Bitcoin's base layer, inheriting its heaviest-chain fork choice guarantees. The hard fork resistance of Bitcoin's conservative development culture provides additional stability for protocols building on top of it.
Is the "longest chain rule" the same as the fork choice rule?
The longest chain rule is one specific fork choice rule, but it is not exactly the same as the broader concept and the term is imprecise for Bitcoin. Bitcoin actually uses the heaviest-chain rule, meaning the most cumulative proof of work, not the longest chain, meaning the most blocks. The broader term "fork choice rule" encompasses any algorithm for selecting between competing valid chains.
Can a fork choice rule change without a hard fork?
The answer depends on the protocol. Some fork choice modifications can be deployed as soft forks if they only tighten existing rules. Fundamental changes to the fork choice algorithm typically require a hard fork because nodes running old software would select a different chain from nodes running updated software.
Why does Ethereum use two separate mechanisms for fork choice and finality?
Separating LMD-GHOST, which provides fast fork choice, from Casper FFG, which provides slower but stronger finality, allows Ethereum to offer both fast block confirmations and strong economic guarantees. Users making small purchases can rely on fast probabilistic confirmation, while high-value transfers can wait for full finality. This flexibility comes at the cost of protocol complexity, which is why Ethereum's roadmap includes proposals to unify these mechanisms.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.