MASTERING-BITCOIN ยท Interactive Practice | Unit 12 ยท Video 1
| Concept | Definition | Notes |
|---|---|---|
| Block Hash | Unique cryptographic identity of a block | |
| prev_hash | Field in header pointing to parent block's hash | Creates the unbreakable chain link |
| Height | Distance from genesis block (height 0) | Tip is the highest block |
| Confirmation Depth | Number of blocks stacked above a given block | 6 = confirmed, 100 = coinbase mature |
| Reversal Probability | for blocks deep | Decays exponentially with depth (when attacker has fraction of hashrate) |
Conceptual question: If an attacker tampers with a block deep in the chain, how much work must they redo?
Use the slider to choose a block to tamper with. Watch how every block above it becomes invalid and must be recomputed.
โ interactive visualization โ coming to this page format soon
Reflect: Notice how tampering with a block deep in the chain forces the attacker to redo every block above it. The deeper the block, the more proof-of-work must be redone. This is why depth = security.
Conceptual question: How quickly does the probability of reversing a transaction drop as more blocks are added on top?
Adjust the attacker's share of global hashrate. Even with significant computing power, the probability of reversal decays exponentially with depth.
โ interactive visualization โ coming to this page format soon
Notice: Even when an attacker controls 25% of global hashrate, the probability of reversing a 6-block-deep transaction is already astronomically small. At depth 100 (coinbase maturity), it's effectively zero. This is security by compounding cost, not impossibility.
Conceptual question: What happens when two miners find a valid block at nearly the same time?
The chain temporarily splits into a fork. The branch that gets the next block first wins; the other becomes orphaned.
โ interactive visualization โ coming to this page format soon
Reflect: Forks aren't a bug โ they're a routine, self-healing feature of decentralized timing. The network always converges on the branch with the most accumulated proof-of-work.
Question 1
Each block's header contains a prev_hash field. What does this field store?
โ Correct! Each block commits to its parent via the parent's hash.
โ Not quite. Remember: prev_hash points backward in time to the block that came before.
Solution:
The prev_hash field stores the hash of the parent block's header.
This is what links each block to the one before it. Because a child's identity (its own hash) is computed from a header that includes its parent's hash, the child cryptographically commits to the parent. Change the parent by even one byte, and the parent's hash changes, which means the child's prev_hash no longer matches โ breaking the chain.
This is a cryptographic commitment, not a soft pointer.
Question 2
Suppose the Bitcoin chain is at height 800,000 (the tip). An attacker wants to alter a single transaction in the block at height 799,990. How many blocks must the attacker recompute to produce a valid chain ending at height 800,000?
โ Correct! The tampered block plus all 10 blocks above it must be recomputed.
โ Not quite. Don't forget โ the tampered block itself also needs a new valid proof-of-work, AND every block above it must be rebuilt to match the new chain of hashes.
Solution:
The tampered block is at height 799,990. The tip is at 800,000. The blocks above the tampered block are at heights 799,991 through 800,000 โ that's 10 blocks.
The attacker must recompute:
That's 11 blocks total.
Why? Changing the tampered block changes its hash. The block at 799,991 stored the old hash in its prev_hash field โ that's now wrong. So the attacker must change 799,991's prev_hash, which changes its own hash, which breaks 799,992 โ and so on, all the way up to the tip. This is the cascade.
Question 3
A miner just earned a block reward (a coinbase transaction). How many additional blocks must be mined on top before they can spend those coins?
โ Correct! Coinbase outputs require 100 blocks of maturity before they can be spent.
โ Not quite. The 6-block rule is for normal transactions. Coinbase rewards have a stricter rule to protect against reorgs erasing newly minted coins.
Solution:
Coinbase outputs are subject to the 100-block maturity rule: they cannot be spent until 100 additional blocks have been mined on top of the block that created them.
Why a stricter rule than the usual 6 confirmations?
So: 6 confirmations = normal transaction acceptance, 100 blocks = coinbase maturity.
Question 4
True or False: Bitcoin's protocol makes it mathematically impossible to rewrite the blockchain. No matter how much computing power you have, you cannot alter old blocks.
โ Correct! Bitcoin's security is economic, not mathematical. Rewriting history is allowed in principle โ it's just astronomically expensive.
โ Not quite. Bitcoin doesn't outlaw rewriting history. Instead, it makes the cost grow exponentially with depth. Security comes from compounding cost, not impossibility.
Solution:
The statement is False. Bitcoin's security is not based on mathematical impossibility โ it's based on compounding economic cost.
In principle:
In practice:
The key insight: Bitcoin replaces institutional trust with arithmetic. It's not a wall you can't climb โ it's a slope that gets steeper with every passing block, until rewriting the past costs more than the past is worth.
Solved: 0 / 4