blockmindset
Lesson 2 of 610 min

Blocks, Hashes, and Chains

Every block contains a cryptographic fingerprint of the block before it — turning a list into an unbreakable chain where altering any link instantly invalidates everything after it.

Why this matters

The block-and-hash structure is the actual mechanism that makes blockchains tamper-evident. Understanding it precisely lets you reason about what makes a blockchain secure — and where that security actually comes from.

1

The Intuition

A block is like a sealed steel safe containing a batch of transactions. Each safe also has a serial number generated from its own contents — change even one byte inside, and the serial number changes completely. The chain is formed by engraving each safe's serial number onto the door of the next safe.

Now: if someone tries to secretly replace safe #50 with a counterfeit, safe #51's door displays a completely different number than the counterfeit #50 produces. The fraud is instantly detectable — not because someone checks, but because the math doesn't lie.

2

See it concretely

Concrete example

Think of a chain of notarized documents, where each notarization stamp encodes a fingerprint of the document before it. A medieval forger could swap out a page undetected. A blockchain forger cannot — every subsequent page mathematically proves the page before it.

This is why blockchains are called 'immutable': not because the data is physically locked away, but because any modification is cryptographically self-revealing to every participant.

3

Tempting — but wrong

4

The precise version

Each block B_n is a structure: { transactions T, timestamp ts, nonce n, prev_hash = SHA256(serialize(B_{n-1})) }. The block's own hash is H(B_n) = SHA256(T ∥ ts ∥ n ∥ prev_hash), where ∥ denotes concatenation. SHA-256 satisfies the avalanche effect: flipping a single bit in input changes approximately 50% of the 256 output bits unpredictably.

Consequence: Δ(B_k) → ΔH(B_k) → mismatch at B_{k+1}.prev_hash → ΔH(B_{k+1}) → ... → ΔH(B_N). Every node in the network independently detects this cascade on their copy of the chain.

H(B_n) = \text{SHA256}\bigl(T_n \,\|\, ts_n \,\|\, \text{nonce}_n \,\|\, H(B_{n-1})\bigr)

Check your understanding

What is the 'avalanche effect' and why does it matter for blockchain?

Click to reveal answer

If you change a transaction in Block #50 of a 1,000-block chain, how many blocks are broken?

Click to reveal answer

What is stored in a block's header vs. its body?

Click to reveal answer

Before moving on
  • I understand why hash functions are one-way (not encryption)
  • I can trace how a change in one block cascades through the chain
  • I know what the avalanche effect is and why it prevents quiet tampering
?Checkpoint

You compute SHA-256('Hello, World!'). Then you change the '!' to a '.'. What happens to the output hash?