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.
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.
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.
See it concretely
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.
Tempting — but wrong
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
Click to reveal answer
What is stored in a block's header vs. its body?
Click to reveal answer
You compute SHA-256('Hello, World!'). Then you change the '!' to a '.'. What happens to the output hash?