Part III: Ethereum and Smart Contracts

"Whereas most technologies tend to automate workers on the periphery doing menial tasks, blockchains automate away the center. Instead of putting the taxi driver out of a job, blockchain puts Uber out of a job and lets the taxi drivers work with the customer directly." — Vitalik Buterin, co-founder of Ethereum

What This Part Covers

If Bitcoin proved that a decentralized ledger could track value transfers, Ethereum asked a far more ambitious question: what if a decentralized network could execute arbitrary programs? Part III covers the architecture, programming, and security of Ethereum and smart contracts — the technology layer that made DeFi, NFTs, DAOs, and the entire programmable blockchain ecosystem possible. These six chapters take you from Ethereum's account-based architecture through the Ethereum Virtual Machine internals, into Solidity programming from first principles, through production-grade contract patterns, deep into smart contract security (where billions of dollars have been lost to bugs and exploits), and finally into the Proof of Stake consensus mechanism that replaced mining after The Merge.

This is the most code-intensive part of the book. You will write Solidity smart contracts, deploy them to a testnet using Hardhat, test them systematically, and audit them for vulnerabilities. The security chapter is not a list of theoretical risks — it is a forensic analysis of real exploits, with code-level breakdowns of how The DAO hack, reentrancy attacks, flash loan exploits, and oracle manipulation actually work. You will learn to think like both a developer and an attacker, because smart contract security requires both perspectives.

The progression is deliberate: architecture (Chapter 11) before the virtual machine (Chapter 12) before writing code (Chapter 13) before advanced patterns (Chapter 14) before security (Chapter 15) before consensus (Chapter 16). Each layer builds on the previous one. Attempting to write secure smart contracts without understanding how the EVM executes bytecode and how gas costs shape design decisions is how expensive mistakes are made.

Chapters in This Part

Chapter Title Key Question
11 Ethereum Architecture: The World Computer Concept How does Ethereum's account model differ from Bitcoin's UTXO model, and what does "Turing-complete" actually mean for a blockchain?
12 The Ethereum Virtual Machine: How Smart Contracts Execute What happens at the opcode level when a smart contract runs, and why do gas costs matter for security?
13 Solidity Programming: Writing Your First Smart Contract How do you write, test, and deploy a smart contract from scratch?
14 Advanced Solidity: Patterns, Libraries, and Production-Grade Contracts What design patterns separate production-quality contracts from tutorial code?
15 Smart Contract Security: Vulnerabilities, Exploits, and Auditing How have billions of dollars been lost to smart contract bugs, and how do you audit code to prevent it?
16 Proof of Stake: How Ethereum Validates Without Mining How does Ethereum achieve consensus after The Merge, and what are the real tradeoffs compared to Proof of Work?

Progressive Project Milestones

Part III is where the progressive project comes alive on-chain. In Chapter 13, you write and deploy VotingToken.sol — the ERC-20 governance token for your decentralized voting and proposal system, complete with minting, delegation, and snapshot functionality. In Chapter 14, you implement a proxy upgrade pattern so your voting contracts can be improved without losing state. In Chapter 15, you conduct a systematic security audit of your own contracts, applying the vulnerability checklist and static analysis tools (Slither, Mythril) to identify and fix potential exploits before they could be exploited.

Prerequisites

You should have completed Parts I and II, or have equivalent knowledge of cryptographic primitives (hashing, digital signatures, Merkle trees), the Bitcoin protocol (transactions, blocks, consensus), and the general distributed systems concepts that underpin all blockchains. For the Solidity programming chapters, familiarity with at least one programming language with C-like syntax is helpful (JavaScript, Java, C++, or similar), though the chapters teach Solidity from first principles. You will need Node.js and npm installed for the Hardhat development environment — setup instructions are provided in Chapter 13.

Chapters in This Part