HOW BLOCKCHAIN
ACTUALLY WORKS

The distributed ledger technology that makes crypto possible — and why it matters beyond finance.

⛓ What is a Blockchain?

A blockchain is a chain of "blocks," each containing a batch of transaction data. Every block references the hash (fingerprint) of the previous block, creating an unbreakable chain. To alter any historical record, you'd need to recalculate every subsequent block — which would require more computing power than the rest of the network combined.

This structure makes blockchains immutable (tamper-evident), transparent (anyone can verify), and decentralised (no single point of failure).

⚙️ Consensus Mechanisms

How does a decentralised network agree on the truth? Via consensus mechanisms:

Proof of Work (PoW): Miners compete to solve complex math puzzles. The winner adds the next block and earns a reward. Energy-intensive but battle-tested. Bitcoin uses this.

Proof of Stake (PoS): Validators lock up ("stake") crypto as collateral. They're randomly chosen to validate blocks. Much more energy efficient. Ethereum, Cardano.

Delegated PoS: Token holders vote for a set of delegates who validate. Faster but more centralised (EOS, TRON).

📜 Smart Contracts

Smart contracts are self-executing programs stored on a blockchain. When predefined conditions are met, they automatically execute — no middleman needed.

Example: A smart contract for escrow holds funds until both parties fulfil their obligations, then automatically releases payment — no lawyer required.

Real-world impactSmart contracts power DeFi protocols, NFT marketplaces, DAOs, insurance, supply chain tracking, and much more.

📡 Layers Explained

Layer 0: The underlying network infrastructure (e.g. Polkadot, Cosmos).

Layer 1 (Base Layer): The main blockchain — Bitcoin, Ethereum, Solana. Handles security and consensus.

Layer 2 (Scaling): Solutions built on top of Layer 1 to increase speed and reduce fees. Examples: Lightning Network (BTC), Polygon, Arbitrum, Optimism (ETH).

Layer 3: Application layer — dApps, games, and services built on top of L2s.

The Blockchain TrilemmaEvery blockchain must make tradeoffs between Security, Scalability, and Decentralisation. Achieving all three simultaneously is the core challenge of blockchain design.

🔐 Cryptography Behind It All

Hashing: A hash function converts any data into a fixed-length string. Even changing one character completely changes the hash. Bitcoin uses SHA-256.

Public/Private Key Cryptography: Your private key mathematically generates your public key. Transactions signed with your private key can be verified by anyone using your public key — without revealing the private key.

Zero-Knowledge Proofs: Advanced cryptography that lets you prove you know something without revealing what it is. Used in privacy coins and scaling solutions.