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

blocks · header · transactions · root

BlockyVSDouble-Spend Dan
Blocky saysA block bundles transactions with a header containing the previous hash and a Merkle root.

Each block has a header (previous block's hash, Merkle root of its transactions, timestamp, nonce/validator info) and a body (the transactions). The previous-hash link is what forms the chain: every block points back, so the whole history is cryptographically welded together. Change one old transaction and every subsequent block's hash breaks.

Power-ups you unlock

Double-Spend Dan attacks — common mistakes

Boss battleExplain how the prev-hash field makes the chain tamper-evident.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>block N:   { prevHash: hash(N-1), merkleRoot, txs }
edit a tx in block 5 → its hash changes
→ block 6’s prevHash no longer matches → chain breaks</pre></body></html>
▶ Open the interactive comic issue
‹ Byzantine Fault Tolerance · Pbft · TendermintThe Genesis Block · How Chains Start ›