MASTERING-BITCOIN Β· Unit 12 Β· Video 2

Anatomy of a Bitcoin Block: Interactive Practice

IKey Reference

Concept Value / Formula Description
Header size 4+32+32+4+4+4=804 + 32 + 32 + 4 + 4 + 4 = 80 bytes Version + PrevHash + MerkleRoot + Timestamp + Target + Nonce
Block hash SHA256(SHA256(header))\text{SHA256}(\text{SHA256}(\text{header})) 32-byte fingerprint, computed fresh by each node
Block identity Block hash (unique) vs Block height (positional) Hash is one-to-one; height can collide during forks
Genesis block Height 00, hash 000000000019d6689c085ae1...\texttt{000000000019d6689c085ae1...} Hardcoded in every Bitcoin node

IIVisualization 1: The 80-Byte Header

The block header is exactly 80 bytes, split across six fields. Use the dropdown to inspect each field and see what it does.

Conceptual question: Which two fields do the heavy structural work that makes Bitcoin tamper-evident?

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

Notice: The Previous Block Hash chains this block backward in time, while the Merkle Root commits to every transaction in the body. Together they make the chain tamper-evident β€” change anything, and the hashes downstream all change.

IIIVisualization 2: Header vs. Body Scale

The header is tiny β€” about a tweet's worth of bytes. The transaction body it commits to can be tens of thousands of times bigger. Adjust the body size below to see the ratio.

Conceptual question: How is it possible for 80 bytes to "anchor" 4 megabytes of data?

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

Reflect: The header doesn't contain the body β€” it commits to the body through the merkle root. That single 32-byte hash is a cryptographic summary of every transaction. Flip one bit anywhere in the body and the merkle root, header, and block hash all cascade into completely different values.

IVVisualization 3: Block Height vs. Block Hash During a Fork

Block height is positional β€” just a count from genesis. Block hash is the unique SHA-256 fingerprint of the 80-byte header. During a fork, two blocks can share the same height but have different hashes. Toggle the fork to see this.

Conceptual question: Why is "block 800,001" ambiguous during a fork, but the block hash never is?

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

Notice: Two competing valid blocks can both legitimately claim height N+1 for a few seconds during a race condition. Their hashes, however, are completely different β€” the hash is the unforgeable identity, the height is just a counter.

VQuiz Questions

Question 1

Sum the six fields of a Bitcoin block header: Version, Previous Block Hash, Merkle Root, Timestamp, Target, and Nonce. What is the total size of the header?

βœ… Correct! The header is exactly 80 bytes.

❌ Not quite. Remember that the two SHA-256 hashes (Prev Hash and Merkle Root) are 32 bytes each, while the other four fields are 4 bytes each.

Show solution

Solution:

The six header fields and their sizes:

  • Version: 4 bytes
  • Previous Block Hash: 32 bytes
  • Merkle Root: 32 bytes
  • Timestamp: 4 bytes
  • Target: 4 bytes
  • Nonce: 4 bytes

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

The two 32-byte fields (Previous Hash and Merkle Root) dominate the header, because SHA-256 outputs are always 32 bytes.

Question 2

A miner changes a single byte inside a transaction in the block's body (the transaction list). Which of the following is true as a result?

βœ… Correct! This cascade is what makes Bitcoin tamper-evident.

❌ Not quite. The merkle root is a cryptographic summary of the entire transaction list β€” any change to the body changes the root, which changes the header, which changes the block hash.

Show solution

Solution:

The merkle root is a hash that commits to every transaction in the body. So:

  1. One byte changes in a transaction β†’ the leaf hash changes
  2. That propagates up the merkle tree β†’ the merkle root changes
  3. The merkle root is one of the six header fields β†’ the header changes
  4. The block hash is SHA256(SHA256(header))\text{SHA256}(\text{SHA256}(\text{header})) β†’ the block hash changes
  5. Every subsequent block references this hash via Previous Block Hash β†’ the entire downstream chain breaks

That cascade is precisely why Bitcoin is tamper-evident.

Question 3

True or False: The 32-byte block hash is one of the fields physically stored inside the block.

βœ… Correct! Each node computes the block hash fresh from the header β€” it isn't stored.

❌ Not quite. The block hash is computed by each node, not stored. Storing it would defeat the trustless verification model.

Show solution

Solution:

False. The block hash is not stored inside the block. Every node computes it fresh, from the 80-byte header, when the block arrives:

blockΒ hash=SHA256(SHA256(header))\text{block hash} = \text{SHA256}(\text{SHA256}(\text{header}))

This is a critical security property: if the hash were stored, a malicious actor could lie about it. Because each node recomputes the hash independently, there's nothing to trust β€” only math to verify.

The four header fields stored in the block are Version, Previous Block Hash, Merkle Root, Timestamp, Target, and Nonce. The block's own hash is derived, not stored.

Question 4

During a brief network fork, two miners independently produce valid blocks at the same height N+1 within seconds of each other. Which statement correctly distinguishes block height from block hash?

βœ… Correct! Hash is one-to-one with a block; height is just a position counter.

❌ Not quite. Forks at the same height are exactly the case the video discussed. The blocks differ in transactions, timestamps, and nonces β€” so their hashes differ even though their heights match.

Show solution

Solution:

  • Block height is positional β€” just a count of blocks from genesis. During a fork, two competing blocks can legitimately share the same height (e.g., both are "block N+1").
  • Block hash is the SHA-256 fingerprint of the 80-byte header. Because the two competing blocks have different transactions, different timestamps, and different nonces, their headers differ β€” so their hashes differ.

So during a fork at height N+1, you might see one block with hash 00000abc... and another with hash 00000def.... Both are valid until the network converges on one chain.

This is why block hash is the unambiguous identifier of a block, while block height is only positional.

Solved: 0 / 4