A blockchain is a linked list of blocks, each committing to a set of transactions and to the previous block’s hash, secured by proof-of-work.
Complete Step 1 // Required reading in the study plan above, then continue here.
Step 2 — Core idea: headers, merkle root, confirmations
Explorers, wallets, and payment processors must decide when a payment is “final enough.” That decision is about chain tips, confirmations, and reorg risk.
Analogy: Each block is a sealed evidence bag. The seal includes a fingerprint of the previous bag. To rewrite history, an attacker must reseal every bag after the change — and beat the honest network’s work.
A block contains:
- A header (version, previous hash, merkle root, time, bits/difficulty, nonce)
- A list of transactions (coinbase first)
The merkle root commits to all transactions so light clients can verify inclusion without downloading everything.
Loading diagram…
When your transaction appears in a block, it has 1 confirmation. Each block buried on top adds another. Deeper confirmations make reorgs that undo your payment less likely.
const confirmations = tipHeight - txBlockHeight + 1;Sometimes two miners find blocks near the same time. Nodes follow the heaviest valid chain. A short reorganization can drop a block you briefly saw — wallets should handle disappearing transactions gracefully.
Done when: You can point to prev-hash and merkle root in the Mermaid flow and define confirmations in one sentence.
Step 3 — Try it: reorg policy + header (lab)
Use the Decoding Bitcoin reorg calculator with an assumed attacker share. Then on regtest:
TIP=$(bitcoin-cli -regtest getbestblockhash)
bitcoin-cli -regtest getblockheader "$TIP"Explain how previousblockhash links the tip to history. Write one confirmation policy you would ship for a mid-size merchant payment, tied to the calculator.
Common mistakes
- Treating “seen in mempool” as settled
- Ignoring that explorers can disagree briefly during races
- Forgetting coinbase maturity when spending mining rewards on regtest
Done when: Lab evidence (calculator notes + getblockheader + confirmation policy sentence) is complete.
Next lesson
Transactions — the bytes wallets actually sign and broadcast.