freecoding.school100% FREE · NO SIGNUP
Ledger LandISSUE #10 of 90

proof of work · mining · difficulty

BlockyVSDouble-Spend Dan
Blocky saysProof of Work secures a chain by making miners spend real computation to add blocks.

In PoW (Bitcoin), miners race to find a number (nonce) that makes the block's hash fall below a target — pure trial and error costing electricity. The winner adds the block and earns a reward. Cheating means out-computing the entire honest network (a 51% attack), which is prohibitively expensive. Security comes from burned energy; the trade-off is high energy use.

Power-ups you unlock

Double-Spend Dan attacks — common mistakes

Boss battleExplain why a 51% attack on Bitcoin is economically irrational.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>find nonce so hash(block) &lt; target
→ trial & error, costs electricity
→ winner adds block + reward
cheat = out-compute everyone (too costly)</pre></body></html>
▶ Open the interactive comic issue
‹ Consensus · The Agreement ProblemProof Of Stake · Validators · Slashing ›