Blockchain & Web3 Knowledge Base
A blockchain is a replicated, append-only, hash-linked state machine whose replicas agree on the next state without trusting a coordinator. Everything else (mining, gas, wallets, NFTs, DeFi) is machinery built around that single sentence.
Core Mechanics at a Glance
Blockchain Core Mechanics
Every header embeds the hash of its parent. Changing any historic byte changes that block hash, which invalidates the parent pointer of every descendant, so an attacker must redo all subsequent work (PoW) or control a supermajority of stake (PoS).
Two Learning Paths
New Learner Path (start here)
| Step | Page | You will be able to... |
|---|---|---|
| 1 | What Is a Blockchain? | Explain blocks, hashes, nodes, wallets and why anyone cares |
| 2 | Cryptography Primitives | Understand hashing, digital signatures and Merkle trees |
| 3 | Ledger Models | Compare UTXO vs account ledgers and a normal database ledger |
| 4 | Consensus Mechanisms | Explain PoW, PoS, BFT and finality |
| 5 | Web3 Architecture | Connect a wallet to a dApp and read/write the chain |
| 6 | IPFS & Decentralized Storage | Know why NFTs and dApps keep files off-chain |
Senior Engineer Path
| Step | Page | Focus |
|---|---|---|
| 1 | Bitcoin Internals | UTXO set, script, mempool, difficulty, reorgs |
| 2 | Ethereum & the EVM | State trie, gas, opcodes, storage layout, EIP-1559, EIP-4844 |
| 3 | Smart Contract Security | Reentrancy, oracle manipulation, upgrade proxies, access control |
| 4 | Sharding, Rollups & Scaling | Trilemma, data availability, ZK vs optimistic, cross-shard atomicity |
| 5 | DeFi, AMMs & MEV | Constant-product math, flash loans, sandwich attacks |
| 6 | Permissioned Ledgers | Fabric, Corda, when a database is the right answer |
| 7 | Production Engineering | Reorg handling, nonce management, key custody, idempotency, indexers |
| 8 | Interview Questions | Junior to staff-level Q&A |
Mental Model: Where Blockchain Sits
Application layer dApps, wallets, NFTs marketplaces, DAOs (Web3)
Execution layer EVM / WASM / Move VM, smart contracts, rollups
Settlement layer L1 state transition + finality
Consensus layer PoW / PoS / BFT agreement on block order
Data availability Block bodies, blobs, IPFS / Arweave / Celestia
Network layer Gossip (libp2p / devp2p), peer discovery (Kademlia)
Crypto layer Hashes, ECDSA / EdDSA / BLS, ZK proofs
The Blockchain Trilemma (and why it is really a trade-off matrix)
| Property | Meaning | Typical cost |
|---|---|---|
| Decentralization | Anyone can run a validating node on commodity hardware | Low throughput, high latency |
| Security | Cost to rewrite history exceeds attacker gain | Redundant computation across all nodes |
| Scalability | Transactions per second grows with demand | Larger blocks or fewer verifiers |
You can optimize two; the third degrades. Solana picks throughput with heavier hardware requirements; Bitcoin picks decentralization/security with ~7 TPS; Ethereum + rollups tries to push execution off L1 while keeping L1 verification cheap.
When NOT to Use a Blockchain
A blockchain is an expensive, slow, append-only database. Use it only when all are true:
- Multiple writers who do not trust each other.
- No acceptable trusted intermediary (or its fee/risk is unacceptable).
- You need a shared, tamper-evident history that outlives any participant.
- Throughput and latency needs are modest relative to the guarantees.
Otherwise PostgreSQL + audit log + signatures is cheaper, faster and GDPR-friendly (you cannot delete from a chain).
