Ethereum, From First Principles
This book asks one question and refuses to stop until it is answered from the ground up: how do untrusting strangers agree on the state of a shared world computer — and what does it cost to run one? Everything else — accounts, cryptography, the EVM, gas, consensus, tries, rollups — is a consequence you can derive once you take that question seriously.
How to read it. The parts are arranged in dependency order: each one assumes the ones before it and earns the ones after, so read them in sequence rather than jumping ahead. At the end of every page, answer the Check-your-understanding prompts in your own words before moving on — if you cannot, reread rather than push forward. Favor depth over speed; the goal is to understand why Ethereum is shaped the way it is, not to memorize that it is.
Foundations — Why Ethereum Exists
- Overview
- The Ledger as a State Machine
- Bitcoin’s Deliberate Limits
- Generalizing into a World Computer
- Ether as Fuel
- Revision
Accounts, State & the World Computer
- Overview
- UTXO vs. Account Model
- EOAs and Contract Accounts
- The Account Record
- The Global State Map
- State Transitions
- Revision
Cryptography & Addresses
- Overview
- secp256k1 Keys
- Keccak-256 Hashing
- Deriving an Address
- ECDSA Signatures and Recovery
- Keystores and Mnemonics
- Revision
Transactions & the Mempool
- Overview
- Anatomy of a Transaction
- Signing and Replay Protection
- Transaction Types
- The Mempool and Propagation
- Lifecycle of a Transaction
- Revision
The EVM — Ethereum’s Virtual Machine
- Overview
- Stack Machine and Opcodes
- Where Data Lives
- Gas Metering
- Execution Context and Calls
- Determinism
- Revision
Smart Contracts & Solidity
- Overview
- What Is a Contract
- Solidity Basics
- ABI and Selectors
- Storage Slot Layout
- Events and Logs
- Deployment: CREATE / CREATE2
- Contract Lifecycle
- Revision
Gas, Fees & EIP-1559
- Overview
- Gas as a Metering Unit
- Gas Limit, Gas Used, and the Fee Formula
- First-Price Auctions Before 1559
- EIP-1559: Base Fee and Priority Fee
- Block Elasticity and the Base Fee Controller
- Fee Estimation and Blockspace Economics
- Revision
Consensus — Proof of Stake & The Merge
- Overview
- Validators and Staking
- Slots, Epochs, and Committees
- Attestations and LMD-GHOST
- Checkpoints and Finality
- The Merge
- Slashing and the Inactivity Leak
- Withdrawals and Rewards
- Revision
State — Merkle-Patricia Tries
- Overview
- Why a Trie, Not a Merkle Tree
- RLP and Nibbles
- Trie Nodes: Leaf, Extension, Branch
- The Four Tries
- Proofs and Light Clients
- Revision
Scaling — Rollups & L2s
- Overview
- The Scalability Trilemma
- The Rollup Pattern
- Optimistic vs. ZK Rollups
- Data Availability
- EIP-4844: Blobs
- The Danksharding Roadmap
- Revision
The Ecosystem — DeFi, NFTs & DAOs
- Overview
- Token Standards: ERC-20, ERC-721, ERC-1155
- AMMs and Uniswap’s x·y=k
- Lending: Aave and Compound
- Stablecoins: Collateralized vs. Algorithmic
- Oracles: Chainlink and the Trust Bridge
- DAOs, Governance, and Bridges
- Revision
Security — Reentrancy, MEV & Famous Hacks
- Overview
- Reentrancy and The DAO
- Integer Overflow (Pre-0.8)
- Access Control and the Parity Multisig
- Oracle Manipulation and Flash Loans
- MEV, Front-Running, and Flashbots
- Revision
Build Your Own EVM in Rust
- Overview
- Accounts and Addresses
- World State and the State Transition Function
- The State Root
- A Tiny Stack VM
- Gas and the Halting Problem
- Deploying and Calling a Contract
- Revision
Advanced & Frontier