Start with the basics · Choosing a history

Why the Longest Chain Is Not Always the Main Chain

Bitcoin is often summarized as a system in which nodes accept the longest chain. That works as a first approximation. The more precise rule is that a node selects the valid chain with the most accumulated proof of work. Length and work look identical while every block has the same difficulty. Across Bitcoin’s actual history, difficulty has changed thousands of times.

Only valid candidates enter the comparison

A node does not vote among every branch it receives. It first checks headers, proof of work, block structure, signatures, absence of double spends, permitted subsidy, and the remaining consensus rules. A chain containing an impossible transaction cannot win regardless of its block count.

Proof of work chooses among histories that satisfy the rules; it does not replace those rules. A miner cannot make somebody else’s signature valid or create arbitrary BTC merely by spending more electricity.

What height measures

Block height counts the steps back to the genesis block. Genesis is height 0 and the next block is height 1. Competing branches can have the same height when miners find different successors almost simultaneously.

When difficulty is equal, each block contributes roughly the same expected work. The higher branch then also carries more work, which explains the convenient phrase “longest chain.”

What chainwork measures

Every block encodes a target that its hash must fall below. A stricter target requires more attempts on average. A node converts that target into expected work and adds it to the work of every predecessor.

The accumulated result is chainwork. It is not a meter of actual electricity or specific hardware. It is a mathematical estimate of the work normally required to produce that sequence of qualifying hashes.

How a shorter branch can be heavier

Imagine one valid branch with 100 low-difficulty blocks and another with 90 blocks found at several times the difficulty. The first has greater height, but the second may carry far more chainwork.

Block count is therefore insufficient. A block after a difficulty change can represent a different expected amount of computation than a block in an earlier period. Nodes compare the sum of work, not the visual length of a list.

What happens after simultaneous blocks

If two valid blocks share a parent and have equal accumulated work, different nodes may temporarily follow different tips. A node usually extends the first one received while retaining knowledge of the competitor.

The next block adds work to one branch. Nodes that learn of the heavier valid chain switch to it. Non-conflicting transactions from the abandoned branch may return to mempools and appear in later blocks.

Why confirmations raise the cost of rewriting

A confirmation is not a notary seal. It means additional work has accumulated above a block. Replacing an old transaction requires building an alternative branch that overtakes the network’s accumulated work.

Every new block increases the gap. Catch-up probability depends on the attacker’s share of hash power and never becomes mathematically zero, but it falls rapidly when that share is smaller. Different recipients therefore choose different confirmation depths.

What full validation adds

The most-work rule protects a user only when the user’s node also validates the rules. A lightweight client can inspect headers and a Merkle proof but does not see the complete context of every spend.

A full node joins two separate questions: is this history valid, and which valid history contains the most accumulated work? The shortcut “the longest chain wins” hides that essential double test.

Height tells us how many blocks came before. Chainwork tells us how much expected work stands behind them.

Sources and verification

  1. Bitcoin white paper: Network and Calculations
  2. Bitcoin Developer Guide: proof of work and forks
  3. Bitcoin Developer Guide: full nodes and cumulative work
  4. Bitcoin Optech: work rather than block count

Technical educational material. A suitable confirmation depth depends on payment context, threat model, and the recipient’s validation method.

Back to the rubric