MASTERING-BITCOIN Β· Interactive Practice | Unit 13 Β· Video 3

Minting Money: How Miners Assemble a Bitcoin Block

IKey Formulas Reference

Formula Name Description
Reward=Subsidy+βˆ‘fees\text{Reward} = \text{Subsidy} + \sum \text{fees} Coinbase reward Total bitcoin paid to miner
halvings=⌊height/210,000βŒ‹\text{halvings} = \lfloor \text{height} / 210{,}000 \rfloor Halving count Number of halvings since genesis
Subsidy=50β‹…2βˆ’halvings\text{Subsidy} = 50 \cdot 2^{-\text{halvings}} BTC Block subsidy New coins created per block
80=4+32+32+4+4+480 = 4 + 32 + 32 + 4 + 4 + 4 bytes Header size Version + PrevHash + Merkle + Time + Bits + Nonce

IIVisualization 1: The Halving Schedule

Bitcoin's block subsidy starts at 50 BTC and halves every 210,000 blocks (roughly every 4 years). Use the slider below to scrub through block heights and see how the subsidy decays over time.

Conceptual question: What happens to new coin issuance as Bitcoin matures? When does the subsidy effectively reach zero?

βš™ interactive visualization β€” coming to this page format soon

Notice: Each halving cuts the subsidy in half. After ~33 halvings, the subsidy rounds down to zero satoshis. From that point on, miners are paid only by transaction fees. The total supply asymptotically approaches 21 million BTC.

IIIVisualization 2: The 80-Byte Block Header

Every Bitcoin block header is exactly 80 bytes, broken into six fields. Hover over the diagram below β€” change which field you want to highlight to learn its role.

Conceptual question: Which fields chain blocks together, which commit to the transactions, and which are tweaked during mining?

βš™ interactive visualization β€” coming to this page format soon

Reflect: The miner hashes these 80 bytes with SHA-256 twice and checks whether the result is below the target. Only the nonce (and timestamp, and parts of the coinbase) can be varied β€” everything else is fixed by the block's contents.

IVVisualization 3: Merkle Tree Construction

Thousands of transactions are compressed into a single 32-byte Merkle root by pairing and hashing leaves all the way up. Adjust the number of transactions below to see how the tree grows β€” and notice how an odd row gets a duplicated leaf.

Conceptual question: Why does changing even one byte of any transaction force the Merkle root (and therefore the entire block header) to change?

βš™ interactive visualization β€” coming to this page format soon

Notice: Every transaction's hash feeds into the root. Tamper with one byte anywhere, and the root cascades to a new value, the header changes, and the proof of work is destroyed. This is why Satoshi's genesis-block newspaper headline still sits there β€” unforgeable, fourteen years on.

VQuiz Questions

Question 1

At block height 750,000, the network has passed three halvings (at heights 210,000, 420,000, and 630,000). Transaction fees in the block sum to 0.4 BTC.

What is the total reward Jing pays herself in the coinbase transaction?

βœ… Correct! Subsidy (6.25) + fees (0.4) = 6.65 BTC.

❌ Not quite. Remember: Reward = Subsidy + Fees, and the subsidy halves every 210,000 blocks.

Show solution

Solution:

Step 1 β€” Count halvings: ⌊750,000/210,000βŒ‹=3\lfloor 750{,}000 / 210{,}000 \rfloor = 3.

Step 2 β€” Compute subsidy: 50β‹…2βˆ’3=50/8=6.2550 \cdot 2^{-3} = 50 / 8 = 6.25 BTC.

Step 3 β€” Add fees: Reward=Subsidy+βˆ‘fees=6.25+0.4=6.65Β BTC\text{Reward} = \text{Subsidy} + \sum \text{fees} = 6.25 + 0.4 = 6.65 \text{ BTC}

The coinbase output pays Jing 6.65 BTC.

  • 6.25 BTC ❌ ignores the fees
  • 12.9 BTC ❌ doubles the subsidy by mistake
  • 50.4 BTC ❌ forgets the halvings entirely

Question 2

A rogue miner publishes a block whose coinbase transaction claims 100 BTC at a height where the protocol subsidy is 6.25 BTC (with 0 fees). The miner's proof of work is valid β€” the hash is below target.

True or False: Because the proof of work is valid, the rest of the network will accept this block.

βœ… Correct! Nodes independently verify the subsidy rule and reject any block that mints more than allowed.

❌ Not quite. Proof of work isn't enough β€” the coinbase must obey the subsidy rule, which every node checks.

Show solution

Solution:

False. Proof of work is necessary but not sufficient for a valid block.

Every full node independently runs the same subsidy formula (50β‹…2βˆ’halvings50 \cdot 2^{-\text{halvings}}) and checks the coinbase output. If the claimed amount exceeds subsidy + fees, every node rejects the block on sight β€” regardless of how much hash power was burned producing it.

This is the core of consensus enforcement: monetary policy isn't a central bank's promise β€” it's a rule independently verified by thousands of nodes in parallel. The rogue miner just burns electricity and orphans their own block.

Question 3

The Bitcoin block header has exactly six fields. Which of the following lists gives the correct byte sizes in order for: Version, Previous Block Hash, Merkle Root, Timestamp, Target ('bits'), Nonce?

βœ… Correct! The header is 4 + 32 + 32 + 4 + 4 + 4 = 80 bytes.

❌ Not quite. Remember: only the two hash fields are 32 bytes; the other four (Version, Timestamp, Bits, Nonce) are 4 bytes each.

Show solution

Solution:

The block header is exactly 80 bytes, in this order:

# Field Size
1 Version 4 B
2 Previous block hash 32 B
3 Merkle root 32 B
4 Timestamp 4 B
5 Target ('bits') 4 B
6 Nonce 4 B

4+32+32+4+4+4=80Β bytes4 + 32 + 32 + 4 + 4 + 4 = 80 \text{ bytes}

These 80 bytes are what gets fed into SHA-256 twice during mining. The two 32-byte fields are hashes (the previous block's header hash, and the Merkle root). Everything else is a 4-byte integer.

Question 4

Which statement about the coinbase transaction is correct?

βœ… Correct! The coinbase has placeholder input fields (32 zero bytes, output index 0xFFFFFFFF) and mints new coins per the subsidy rule.

❌ Not quite. The coinbase doesn't spend any prior UTXO β€” it conjures new coins through consensus, not by signing or by reference to any special source.

Show solution

Solution:

The coinbase transaction is unique in Bitcoin:

  • It is always transaction #0 β€” the first transaction in every block.
  • Its single input has a previous tx ID of 32 zero bytes and an output index of 0xFFFFFFFF β€” sentinel placeholders meaning "there is no prior UTXO."
  • Because no UTXO is being unlocked, no signature is needed. The script slot is repurposed for arbitrary data (2–100 bytes), which since BIP-34 must begin with the block height.
  • Every other transaction in Bitcoin spends an existing UTXO; the coinbase is the only way new coins are minted.

There is no "Bitcoin Foundation UTXO" β€” coins are created from nothing, by protocol consensus, every ten minutes.

Solved: 0 / 4