Mastering Ethereum, 2nd Edition

Book description

As the first blockchain platform to introduce the concept of smart contracts, Ethereum serves as the gateway to a worldwide, decentralized computing paradigm. With this practical guide, Carlo Parisi, Alessandro Mazza, and Niccolo Pozzolini provide everything you need to know about building smart contracts and DApps on Ethereum and other virtual-machine blockchains.

You'll find comprehensive coverage of Ethereum's internal workings to help you understand not just the how but also the why of Ethereum's innovative technology. You'll dive deep into the architecture and operational mechanics of Ethereum by learning essential knowledge for building and interacting effectively with DApps and smart contracts on Ethereum and similar virtual-machine blockchains.

  • Run an Ethereum client, create and transmit basic transactions, and program smart contracts
  • Learn the essentials of public key cryptography, hashes, and digital signatures
  • Understand how "wallets" hold digital keys that control funds and smart contracts
  • Interact with Ethereum clients programmatically using JavaScript libraries and remote procedure call interfaces
  • Learn security best practices, design patterns, and antipatterns with real-world examples
  • Build simple decentralized applications using multiple peer-to-peer components
  • Learn the essentials about DeFi and zero knowledge proofs
  • Understand how the Consensus of Ethereum works and the challenges it presents
  • Read and write basic Solidity and Vyper code

Publisher resources

View/Submit Errata

Table of contents

  1. Brief Table of Contents (Not Yet Final)
  2. 1. What Is Ethereum?
    1. Compared to Bitcoin
    2. Components of a Blockchain
    3. The Birth of Ethereum
    4. Ethereum’s Stages of Development
    5. Ethereum: A General-Purpose Blockchain
    6. Ethereum’s Components
      1. Further Reading
    7. Ethereum and Turing Completeness
      1. Turing Completeness as a “Feature”
      2. Implications of Turing Completeness
    8. From General-Purpose Blockchains to Decentralized Applications (DApps)
    9. The Third Age of the Internet
    10. Ethereum’s Development Culture
    11. Why Learn Ethereum?
    12. Conclusion
  3. 2. Ethereum Basics
    1. Ether Currency Units
    2. Choosing an Ethereum Wallet
    3. Control and Responsibility
    4. Getting Started with MetaMask
      1. Creating a Wallet
      2. Switching Networks
      3. Getting Some Test Ether
      4. Sending Ether from MetaMask
      5. Exploring the Transaction History of an Address
    5. Introducing the World Computer
    6. Externally Owned Accounts (EOAs) and Contracts
    7. A Simple Contract: A Test Ether Faucet
    8. Compiling the Faucet Contract
    9. Creating the Contract on the Blockchain
    10. Interacting with the Contract
      1. Viewing the Contract Address in a Block Explorer
      2. Funding the Contract
      3. Withdrawing from Our Contract
    11. Conclusions
  4. 3. Ethereum Nodes
    1. Ethereum Nodes
    2. Ethereum Networks
      1. Should I Run a Full Node?
      2. Full Node Advantages and Disadvantages
      3. Public Testnet Advantages and Disadvantages
      4. Local Blockchain Simulation Advantages and Disadvantages
    3. Running an Ethereum Node
      1. Hardware Requirements for a Full Node
      2. Software Requirements for Building and Running a Client (Node)
      3. Preparation Phase
      4. Prysm
      5. Reth - Lighthouse
    4. The First Synchronization of Ethereum-Based Blockchains
      1. The JSON-RPC Interface
    5. Remote Ethereum Clients
      1. Mobile (Smartphone) Wallets
      2. Browser Wallets
    6. Conclusion
  5. 4. The Ethereum Virtual Machine
    1. What Is the EVM?
      1. Comparison with Existing Technology
      2. The EVM Instruction Set (Bytecode Operations)
      3. Ethereum State
      4. Merkle Patricia Trie
      5. Deep Dive into the EVM Components
      6. Compiling Solidity to EVM Bytecode
      7. Contract Deployment Code
      8. Disassembling the Bytecode
    2. Turing Completeness and Gas
    3. Gas
      1. Gas Accounting During Execution
      2. Gas Accounting Considerations
      3. Gas Cost Versus Gas Price
      4. Block Gas Limit
    4. Concrete Implementations
    5. The biggest EVM upgrade: EOF
      1. Introduction
      2. Jumpdest analysis
      3. Add and deprecate features
      4. Code and data separation
      5. Stack too deep
      6. EOF: EVM Object Format
    6. The future of the EVM
    7. Conclusions
  6. 5. Consensus
    1. Principles of Consensus
      1. Safety
      2. Finality
      3. Liveness
      4. Block Trees and Forking
    2. Consensus via Proof of Work
    3. Consensus via Proof of Stake (PoS)
    4. PoS Terminology
      1. Nodes and Validators
      2. Blocks and Attestations
    5. LMD Ghost
      1. GHOST
      2. LMD
      3. How It Works
      4. Incentives
      5. Slashing
    6. Casper FFG: the finality gadget
    7. Naming and Terminology
      1. Epochs and checkpoints
      2. Justification and finalization
      3. Sources and targets, links and conflicts
      4. Supermajority links
      5. Justification
      6. Finalization
      7. Slashing
    8. Fork choice rule
    9. The Casper commandments
    10. Accountable safety and Plausible liveness
      1. Accountable safety and Economic finality
      2. Plausible liveness
    11. A practical example: The lifecycle of a checkpoint
      1. Conflicting justification
      2. Supermajority bug
    12. Gasper: a real example
    13. Controversy and Competition
      1. Timing games
      2. Centralization of supermajority
    14. Conclusion
    15. Further Reading
  7. About the Authors

Product information

  • Title: Mastering Ethereum, 2nd Edition
  • Author(s): Carlo Parisi, Alessandro Mazza, Niccolo Pozzolini
  • Release date: December 2025
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098168421