Bitcoin

Proof of Work

Proof of Work is the mechanism that makes Bitcoin’s ledger trustworthy without a trusted party. It forces anyone who wants to add to the ledger to burn real energy on a puzzle — so that writing history is expensive, and rewriting it is impossibly expensive.

The puzzle

Recall hash functions: one-way, deterministic, and impossible to predict. A block’s real contents — its transactions — are essentially fixed, but the miner is allowed to tack on one throwaway number they can set to anything they like. It’s called a nonce, short for “number used once.” The job is to find a nonce that, hashed together with the block, produces a hash starting with a long run of zeros. There’s no clever shortcut — the only way is to try a nonce, hash it, check the result, and repeat, billions of times a second, until one finally works.

That’s all a nonce is: a value you change purely so the output changes. You saw the raw material in the hash lesson — alter one character and the hash scrambles completely — so every new nonce gives a fresh, random-looking hash. Miners simply keep spinning that one dial, 1, 2, 3 and on, hunting for the rare value that lands a hash below the target.

Mine a block yourself

Set a difficulty — how many zeros the hash must start with — then hit Mine and watch the nonce race upward as the hash reshuffles completely on every single try. When one finally lands below the target, the block turns green. That frantic guessing is exactly what the whole network is doing, billions of times a second.

Target0000
Nonce0
Hash

Hard to do, trivial to check. Finding a valid nonce takes the whole network astronomical effort. But once found, anyone can verify it in a millisecond — just hash it once and see the zeros. This asymmetry is the entire trick: costly to produce, effortless to check. It’s Hashcash, scaled up to secure a global ledger.

Difficulty that self-adjusts

Bitcoin aims for one new block roughly every ten minutes. If more miners join and blocks come too fast, the network automatically makes the puzzle harder (demanding more zeros); if miners leave, it eases off. This difficulty adjustment — recalibrated every two weeks — keeps the heartbeat steady no matter how much computing power is thrown at it.

Why it secures history

Each block’s hash is baked into the next, so the blocks form a chain (the next lesson, and the blockchain demo, make this vivid). To alter an old transaction, an attacker would have to redo that block’s proof of work AND every block after it — while the honest network keeps extending the real chain. Catching up would mean out-hashing the entire planet. The deeper a transaction is buried, the more energy would have to be re-burned to change it, so old history becomes effectively set in stone.

The people running these machines, racing to find nonces, are the miners — and they’re not doing it for charity. Their incentive is what actually holds the whole system together.

Key takeaways

  • Proof of work forces anyone adding to the ledger to burn real energy finding a nonce whose block hash meets a target — costly to produce, trivial to check.
  • Difficulty auto-adjusts every ~2 weeks to keep blocks roughly ten minutes apart.

Check yourself

What is a ‘nonce’ in mining?

What makes proof of work secure?

Spotted an error or have feedback on this lesson? Suggest a correction ↗

Comments

Powered by Nostr — reply from any Nostr client, and zap the lesson over Lightning.