MASTERING-BITCOIN · Unit 2 · Video 4 · Interactive Practice
| Formula | Name | Description |
|---|---|---|
| Hash target probability | Chance a random hash has leading hex zeros | |
| Expected attempts | Average guesses needed for leading hex zeros | |
| Attack success probability | Attacker with hashrate fraction , after confirmations | |
| Miner reward | Total incentive for finding a valid block |
A valid block requires its hash to start with a certain number of leading zeros. Each additional leading hex zero multiplies the difficulty by 16× because each hex digit has 16 possible values (0–F).
Explore: Drag the slider to see how the number of required leading zeros affects the expected number of hash attempts.
⚙ interactive visualization — coming to this page format soon
Once a transaction is buried under additional blocks, reversing it requires an attacker to secretly rebuild the entire chain from that point forward — and outpace the honest network. The probability of success decays exponentially with each confirmation.
Explore: Adjust the attacker's hashrate share and watch how quickly the attack probability collapses with each new confirmation.
⚙ interactive visualization — coming to this page format soon
Miners face a choice: mine honestly and collect guaranteed block rewards, or attempt a double-spend attack. The expected value of each strategy depends on block rewards, the value being reversed, and the attacker's share of hashpower.
Explore: Adjust all three parameters. Can you find any scenario where attacking beats honest mining after a few confirmations?
⚙ interactive visualization — coming to this page format soon
Question 1 · The Core Asymmetry
The video states that approximately 168 billion trillion hash attempts are needed to find a valid block, yet anyone can verify the solution with exactly one computation.
Which property of SHA-256 makes this "easy to verify, hard to produce" asymmetry possible?
✅ Correct! All three SHA-256 properties are essential: determinism enables one-step verification, irreversibility forces brute-force search, and unpredictability prevents any shortcut.
❌ Not quite. That property is important, but consider: would the system still work if any of the other properties were missing?
Solution:
All three properties are essential to the asymmetry:
Remove any one and the system breaks:
The answer is all three properties working together.
Question 2 · Difficulty Calculation
If the mining target requires 5 leading hex zeros in the hash output, approximately how many hash attempts are expected on average?
Recall: each hexadecimal digit has 16 possible values (0–F).
✅ Correct! Each hex zero is a 1-in-16 event, so k zeros requires 16^k = 16^5 ≈ 1 million attempts on average.
❌ Not quite. Each hex digit has 16 possible values, and requiring it to be 0 is a 1/16 probability. For k independent digits, probabilities multiply: (1/16)^k.
Solution:
Each hex digit must independently be 0 (1 chance out of 16 possibilities):
For :
Common mistakes:
Question 3 · Attack Capabilities
True or False: An attacker who controls more than 50% of the network's total hashrate can create transactions that spend other people's Bitcoin.
✅ Correct! Hashpower determines which blocks get added, but consensus rules — enforced by every node — determine which transactions are valid. No amount of mining power can forge someone else's cryptographic signature.
❌ Not quite. Remember: mining determines block ordering, but consensus rules (enforced by all nodes) determine validity. Can raw computation forge a private key signature?
Solution: False
Even with >50% hashrate, an attacker cannot:
A majority attacker can only:
The critical insight: consensus rules are enforced independently by every node on the network, regardless of who mined the block. An invalid transaction is rejected by all honest nodes, no matter how much hashpower produced the block containing it. Mining power determines which valid blocks get added — not what counts as valid.
Question 4 · Confirmation Depth Calculation
An attacker controls 30% of the network hashrate (). Using the approximation:
What is the approximate probability of successfully reversing a transaction after 6 confirmations?
✅ Correct! (3/7)^6 ≈ 0.0062 ≈ 0.6%. After 6 confirmations, even an attacker with 30% of all hashpower has less than a 1% chance of reversing the transaction.
❌ Not quite. Make sure you're raising (q/(1−q)) = (3/7) to the power z = 6 — the full number of confirmations. Each confirmation multiplies by the same factor.
Solution:
With and confirmations:
Step by step:
Why the other answers are wrong:
Each confirmation multiplies the probability by , creating dramatic exponential decay.
Solved: 0 / 4