Proof of work
The conceptWhy Bitcoin miners burn electricity guessing numbers
Proof of work is a puzzle that takes a lot of computing to solve but only an instant to check. The answer itself proves that someone spent the effort.
The puzzle uses a hash function, which turns any input into a random-looking number. You must find an extra number, a nonce, so that hash(data + nonce) starts with a set number of zero bits.
Because the output cannot be predicted, there is no shortcut. You try nonce 0, 1, 2 and so on until one works. Each extra zero bit you demand halves the chance of success on each try.
What it’s forEstimates how much guessing a proof-of-work puzzle needs.
expected tries = 2ᵈ
- d
- how many leading zero bits the hash must have
- 2ᵈ
- average number of nonces to try, since each try succeeds with chance 1 in 2ᵈ
What it givesThe average work needed to find a valid answer. Checking one answer still takes a single hash.
- d = 4: 2⁴ = 16 tries on average
- d = 20: 2²⁰ = 1,048,576 tries on average
- Checking either answer: 1 hash