Blockchain Double-Spend Probability (Nakamoto)
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
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
| q | Attacker share of the network's computing power | percent |
| z | Number of blocks confirmed after the payment | count |
| lambda | Expected number of blocks the attacker mines while the honest chain mines z | number |
Worked example
An attacker controls 10% of the computing power. How safe is a payment after 1, 3 and 6 confirmations?
| Confirmations used | 6 | 6 |
| Probability of reversal | 0.0243% | |
| Probability with 1 confirmation | 20.46% | |
| Probability with 3 confirmations | 1.317% | |
| Probability at 30% attacker power with the same confirmations | 13.21% |
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%.