Skip to main content

Blockchain Double-Spend Probability (Nakamoto)

IntermediateFintech & Digital FinanceAlso known as: blockchain fundamentals, 51% attack, confirmations, proof of work security, attacker catch-up probability

Finds: how many confirmations make a payment safe.

When to use it: Use it to see why waiting for more confirmations makes a payment safer. The chance of reversal falls very fast as confirmations rise when the attacker has a small share, which is why the number of confirmations a merchant demands should match the amount at risk. It assumes a pure proof-of-work chain and a simple attacker.

The formula

P\displaystyle P=1−∑k=0zλke−λk!(1−(q/p)z−k)\displaystyle =1-\sum_{k=0}^{z}\frac{\lambda^{k}e^{-\lambda}}{k!}\left(1-(q/p)^{z-k}\right)λ\displaystyle \lambda=zqp\displaystyle =z\frac{q}{p}

In words: Let q be the attacker's share of total computing power and p = 1 − q the honest share. After z confirmations, the chance the attacker can still catch up and replace the chain = 1 − sum for k = 0 to z of Poisson(k; lambda) x (1 − (q/p)^(z-k)), with lambda = z x q / p; If q is 50% or more the attacker eventually succeeds

What each symbol means

qAttacker share of the network's computing powerpercent
zNumber of blocks confirmed after the paymentcount
lambdaExpected number of blocks the attacker mines while the honest chain mines znumber

Worked example

An attacker controls 10% of the computing power. How safe is a payment after 1, 3 and 6 confirmations?

Confirmations used66
Probability of reversal0.0243%
Probability with 1 confirmation20.46%
Probability with 3 confirmations1.317%
Probability at 30% attacker power with the same confirmations13.21%
The answer

With 6 confirmations the chance of reversal is 0.0243%. With 1 confirmation it is 20.46% and with 3 it is 1.317%. At 30% attacker power and the same confirmations it would be 13.21%.

Want every formula on a few pages?Get the free Cheat Sheet (PDF) →

Calculator

Probability of reversal0.0243%
Probability with 1 confirmation20.46%
Probability with 3 confirmations1.317%
Probability at 30% attacker power with the same confirmations13.21%

Keep going