Blockchain explained
Series
Blockchain explained
Lesson
06 of 06
Edition
November 2026
References
3

Consensus and the 51% attack

Abstract

Nodes follow the chain with the most accumulated work. An attacker with less than half of the computing power falls behind, and every confirmation makes catching up less likely.

Key points

  1. When two versions of the chain compete, nodes follow the valid one with the most proof of work.
  2. To undo a payment, an attacker must secretly build a longer chain starting from before that payment.
  3. With less than half of the power, the chance of catching up falls exponentially with each confirmation.
  4. With half or more, the attacker eventually wins: hence the name “51% attack”. Even then, they cannot forge signatures or spend other people’s coins.

LimitsWhere this toy model differs from the real system: Limits

Which chain is the real one?

Thousands of nodes and no central server: they need a rule to agree on a single history. In Bitcoin the rule is simple: follow the valid chain with the most accumulated proof of work, which is usually the longest. If two miners find a block at almost the same moment, the network splits for a while; the next block extends one of the two branches, and everyone switches to it.

The attacker’s race

Suppose Mallory pays a merchant, receives the goods, and then wants the payment to disappear. She must build, in secret, a different chain without that payment, starting from a block before it, and make it longer than the honest chain. Meanwhile the honest network keeps adding blocks. Every block added on top of the payment is a confirmation, and the merchant decides how many to wait for.

Section 11 of the Bitcoin whitepaper computes Mallory’s chance as a race between two random processes. The widget uses the same formula, and the site’s tests check it against the tables printed in the whitepaper.

Figure 1Try it: Chance of a successful attack

Probability the attacker ever catches up0.0243% about 1 in 4,119Confirmations needed for less than 0.1%5

100%1%0.01%0.0001%05101520ConfirmationsProbabilityq = 0.1q = 0.3

This widget needs JavaScript. The text of the lesson explains the same idea without it.

With 10% of the computing power and 6 confirmations, the attacker succeeds about once in 4,000 tries (0.024%). With 30%, the same 6 confirmations still leave about 13%, and the merchant would have to wait for 24 to fall below 0.1%. At 50% or more, no number of confirmations is enough.

What a majority cannot do

A majority of the computing power lets an attacker undo or reorder recent transactions, including their own payments, and refuse to include other people’s transactions. It does not let them create coins out of nothing or spend coins locked to someone else’s key: every node still checks the signatures and the rules, and a block that breaks them is rejected however much work it carries.

Limits

Sources

Primary sources this lesson is based on.