← 1-Year PathQ1 · Foundations

Week 4 — Blockchains: Trust by Math

How blockchains replace middlemen with cryptography, consensus, and incentives.

Week 4 of 52 · ~7 hours · 13 slides · exam + project

📖 Study these courses this week

Complete these two courses, then do the Deep Dive below, pass the exam, and finish the project.

The Blockchain Revolution

A trust machine that doesn't need anyone to be trustworthy.

What you will learn

  • Explain what a blockchain is in one sentence
  • Understand hashes as digital fingerprints
  • See why tampering is detectable by design

How blocks link into a tamper-evident chain

HASH 0transactionsBlock 1HASH 1transactionsBlock 2HASH 2transactionsBlock 3prevprevEach block stores the hash of the previous → tamper-evident chain
How blocks link into a tamper-evident chain

Inside a block

Block Header prev_hash (links chain) merkle_root (tx summary) timestamp nonce (PoW counter) difficulty Transactions tx_1 · from → to · amounttx_2 · from → to · amounttx_3 · from → to · amounttx_4 · from → to · amounttx_5 · from → to · amounttx_6 · from → to · amount
Inside a block

Blockchain in one sentence

A blockchain is a shared, append-only ledger where each new entry cryptographically commits to the one before it — so changing history requires redoing every subsequent entry, which the network's incentives make prohibitively expensive.

The hash: a digital fingerprint

A hash function turns any input into a fixed-length 'fingerprint.' Change one character and the hash changes completely. Hashing a block's contents gives a unique ID that proves exactly what was in it.

💡 Why tampering is obvious

Each block stores the hash of the previous block. If an attacker edits block 2, its hash changes — breaking the link to block 3, which stores the old hash. To hide the edit, they'd have to rewrite blocks 3, 4, 5… all the way to the tip, faster than everyone else adds new blocks. That's the security model.

Consensus: agreeing without a boss

Because no central authority decides the truth, the network must agree on which chain is real. Proof-of-work (compute), proof-of-stake (capital at risk), and other mechanisms align self-interest so honest participants converge on one version.

Incentives are the real security

Blockchains don't work because people are honest — they work because cheating is unprofitable. Miners/validators earn rewards for following the rules and lose money trying to rewrite history. Cryptography provides the lock; incentives provide the guard.

💡 A block, inside

A block contains: a timestamp, a list of transactions, a nonce, the previous block's hash, and its own hash. Together these make the block a sealed, timestamped, unforgeable page in the ledger.

❓ Quick check

Why is tampering with an old block detectable?

A) Blocks are encrypted
B) Each block stores the previous block's hash, so edits break the chain
C) A central authority checks
D) Blocks are very large
(Knowledge check — full exam is next)

Key takeaways

  • Blockchain = append-only ledger with cryptographic links
  • Hashes are unforgeable digital fingerprints
  • Security = cryptography + consensus + aligned incentives

📝 Weekly Exam — pass with 80% to unlock next week

10 questions. Review the Deep Dive and courses before attempting.

1. A blockchain is best described as:
Append-only, shared, and cryptographically chained.
2. A hash function:
One-way, fixed-length, deterministic fingerprint.
3. If you change one character of a block's data:
The avalanche effect: tiny input change → totally different hash.
4. Each block stores:
The chain link is the previous block's hash.
5. Consensus mechanisms exist to:
Decentralized agreement on the valid chain.
6. Blockchain security ultimately relies on:
Incentives make honest behavior the profitable path.
7. Proof-of-work secures the chain by requiring:
PoW = expensive compute that's costly to fake.
8. Proof-of-stake secures the chain by:
Validators put capital at risk; cheating forfeits it.
9. A block typically contains all EXCEPT:
Passwords are never stored in blocks.
10. 'Append-only' means:
Records are permanent and immutable in practice.
Your score: —

🛠 Weekly Project

Build and verify a tiny hash chain by hand.

1
Write a short sentence. Compute its SHA-256 hash (use any online tool or the Lab).
2
Append '2' and hash the result (hash of previous hash + new data).
3
Repeat for 3-4 links, recording each hash.
4
Now change one word in link 2 and recompute — watch the chain break.
5
Write one sentence on why this makes tampering detectable.
Open tool →
← Week 3  |  Week 5 →