Track 0 · Genesis · lesson 3
Mine a block by hand
5 min
Hashing makes tampering visible. It does not make it expensive.
An attacker who edits block 900 can recompute blocks 900 to 1,000 and present a chain where every link matches again. Consistent, and a complete fabrication.
So the second problem from lesson 1 is still open: with nobody in charge, who decides whose version is correct?
The answer is deliberately awkward. Adding a block is made artificially difficult — not difficult to verify, difficult to produce.
The rule: a block is only valid if its hash starts with some number of zeros. You cannot control what a hash comes out as, so there is exactly one way to hit that target — change something and hash again. Over and over.
The thing you change is a meaningless number called the nonce.
Do it by hand
Below is a real block and a real SHA-256. Press the button to try the next nonce. Keep going until the digest starts with four zeros.
Try at least a few by hand before you let the computer take over. The tedium is the lesson.
Mine it
target: hash starts with 4 zeros
- block data
- block 15 · alice → bob · 4 ETH
- nonce
- 0
Predict
You found a nonce that works. How long does it take someone else to check that you really did?
What this buys
Rewriting history now means redoing the work for the edited block and every block after it — while the honest network keeps extending the real chain ahead of you.
To catch up you would need more computing power than everyone else combined. Not impossible. Just expensive enough that it stops being worth it.
That is the whole security model. Not "impossible to cheat" — more profitable to participate honestly than to attack.
Check
Why does raising the difficulty (more required zeros) make the chain safer?
Proof of stake does the same job differentlyOptional
Ethereum stopped using proof of work in 2022. Burning electricity is one way to make attacking expensive, but not the only one.
Under proof of stake, validators lock up ETH as collateral. Propose a dishonest block and the network destroys part of that deposit. The cost of attacking is money you have already handed over, rather than electricity you are still buying.
Same shape of solution — make dishonesty cost more than honesty — with a different currency. Track 1 goes into how this changes finality.
Worth remembering
- Hashing makes tampering visible; proof of work makes it expensive.
- A block is valid only if its hash starts with N zeros. The only way to find one is to keep changing the nonce and re-hashing.
- Producing a proof is hard; verifying it is a single hash. That asymmetry is the whole mechanism.
- Rewriting history means out-computing the entire honest network, forever.
- Ethereum now uses proof of stake — same goal, collateral instead of electricity.