Blockchain
Blockchain is a decentralized, tamper-resistant technology for recording transactions. It eliminates the need for a trusted third party by distributing a shared ledger across many computers.
Learning Objectives
- 11.1.2.6 Explain the function and operation of Blockchain
Conceptual Anchor
The Notebook Analogy
Imagine a class of 30 students. Every time money changes hands, every student writes the transaction in their notebook. To cheat, you'd have to change the record in all 30 notebooks simultaneously — virtually impossible. That's a blockchain: every participant has a copy, and all copies must agree.
Rules & Theory
Key Concepts
| Term | Definition |
|---|---|
| Block | A group of transactions bundled together |
| Chain | Blocks linked together using cryptographic hashes |
| Distributed ledger | Every node (computer) holds a full copy of the chain |
| Hash | A unique digital fingerprint of data (fixed-size output from any input) |
| Mining | Solving complex math problems to validate and add a new block |
| Consensus | All nodes must agree on the valid chain (majority rule) |
| Node | A computer in the blockchain network |
How Blockchain Works
Step 1: A transaction is requested (e.g., Alice sends 1 BTC to Bob)
Step 2: The transaction is broadcast to all nodes in the network
Step 3: Nodes validate the transaction (does Alice have enough balance?)
Step 4: Validated transactions are grouped into a new Block
Step 5: Miners compete to solve a cryptographic puzzle (Proof of Work)
Step 6: The winning miner adds the block to the chain
Step 7: All nodes update their copy of the blockchain
Step 8: The transaction is complete and permanent (immutable)Structure of a Block
| Component | Description |
|---|---|
| Block number | Sequential index (Block #0 = Genesis Block) |
| Timestamp | When the block was created |
| Transaction data | The actual records stored |
| Previous hash | Hash of the previous block → creates the chain |
| Current hash | Hash of this block's contents |
| Nonce | Number adjusted by miners to find a valid hash |
Why Is Blockchain Tamper-Proof?
Each block contains the hash of the previous block. Changing any data in Block #3 changes its hash, which invalidates Block #4's "previous hash" reference, which breaks Block #5, and so on. An attacker would need to recalculate the hash of every subsequent block across more than 50% of all nodes — computationally infeasible.
Applications Beyond Cryptocurrency
| Application | How Blockchain Is Used |
|---|---|
| Supply chain | Track products from factory to consumer |
| Healthcare | Secure, shared patient records |
| Voting | Transparent, verifiable election results |
| Smart contracts | Self-executing agreements (Ethereum) |
| Identity verification | Decentralized digital IDs |
Worked Examples
1 Visualizing the Chain
Block #0 (Genesis) Block #1 Block #2
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Prev: 0000 │ │ Prev: a3f2... │ │ Prev: 7b1e... │
│ Data: "Start" │──→│ Data: "A→B: 5" │──→│ Data: "B→C: 3" │
│ Hash: a3f2... │ │ Hash: 7b1e... │ │ Hash: d4c9... │
└──────────────────┘ └──────────────────┘ └──────────────────┘
If someone changes Block #1's data to "A→B: 500":
- Block #1's hash changes from 7b1e... to something else
- Block #2's "Prev" no longer matches → chain is broken!
- All nodes reject the altered versionCommon Pitfalls
Blockchain = Bitcoin
Bitcoin uses blockchain, but blockchain is NOT just cryptocurrency. It's a general-purpose technology for secure, distributed record-keeping.
"Impossible to Hack"
While extremely difficult, a 51% attack (controlling more than half the network) could theoretically alter the chain. Blockchain is tamper-resistant, not tamper-proof.
Tasks
List the main components of a block in a blockchain.
Explain why changing data in one block breaks the entire chain.
Describe how blockchain could be used to prevent cheating in school exam results.
Compare blockchain-based voting with traditional paper voting. What are the advantages and disadvantages of each?
Self-Check Quiz
Q1: What links blocks together in a blockchain?
Q2: What is mining?
Q3: Why is a blockchain called "distributed"?