About this book
Mastering Ethereum: Building Smart Contracts and DApps was published by O'Reilly Media at the end of 2018. Its authors are Andreas M. Antonopoulos, already known for Mastering Bitcoin, and Gavin Wood, one of the founders of Ethereum and the author of its formal specification. The book is a technical guide for developers and technically minded readers who want to understand how Ethereum works, how programs run on it, and how to write those programs safely.
Ethereum was launched in 2015 as a blockchain that could run general programs, not just record transfers of a currency. By 2018 it had passed through a period of rapid growth, the wave of token sales in 2017, and a series of costly security failures. Developers were arriving in large numbers, often from web development, and many were writing contracts that held real money without understanding the platform beneath them. The documentation available was scattered across specifications, forum posts, blog articles and the formal Yellow Paper, which is precise but difficult. Mastering Ethereum gathered this knowledge into a single coherent account.
The question the book answers is practical: what is Ethereum, as a machine, and how does one build on it without being destroyed by its sharp edges? It explains the accounts and transactions that make up the system, the cryptography that secures them, the wallets that manage keys, the languages used to write contracts, the virtual machine that runs them, the standards that make tokens interoperable, the oracles that bring in outside data, and the consensus process that holds it together. Throughout, it stresses security, because on Ethereum mistakes are public, permanent and often immediately exploited.
The book was released under a Creative Commons licence, and its full text has been developed in the open on GitHub, with contributions from many readers. This mirrors the approach Antonopoulos took with Mastering Bitcoin and fits the open-source culture of the platform it describes. The published edition is still a commercial book, and this companion respects its copyright by describing and commenting rather than reproducing.
Readers should know at the outset that the book describes Ethereum as it stood in 2018. Since then the platform has changed in fundamental ways, most notably by moving from proof-of-work to proof-of-stake in 2022 and by restructuring its fee mechanism in 2021. Its core concepts, the account model, the virtual machine, gas, contracts and their security, remain largely valid. Its account of consensus and of fees is historical. This companion notes those changes where they matter.
Ethereum itself was proposed by Vitalik Buterin, then a young programmer and writer active in the Bitcoin community, who argued that blockchains should not be limited to a fixed set of transaction types. A group of co-founders, including Gavin Wood, built it over 2014 and 2015, funded by a public sale of ether. The launch in mid-2015 was followed by rapid growth in developers and applications, and by the conflicts and crises that later histories describe. Mastering Ethereum is written from inside that history by one of its participants, but its subject is the machine rather than the story.
The authors
Andreas M. Antonopoulos
Andreas Antonopoulos is a technologist and educator who became one of the best-known explainers of Bitcoin in its early years. Trained in computer science and with a background in networking and information security, he turned to Bitcoin around 2012 and devoted himself to teaching it through talks, videos and books. Mastering Bitcoin, first published in 2014, became the standard technical introduction for developers. He also published collections of talks aimed at general audiences, including The Internet of Money. His strength as a writer is clarity: he explains layered systems by building them up one concept at a time, with examples that can be run.
His perspective has been broadly that of the open, permissionless blockchain movement. He has argued that the significance of these systems lies in their neutrality and openness rather than in speculation. That view shapes Mastering Ethereum, which treats Ethereum as a public infrastructure to be understood and built on carefully, not as an investment.
Gavin Wood
Gavin Wood is a British computer scientist who was among the founders of Ethereum. He wrote the Yellow Paper, the formal mathematical specification of the Ethereum protocol and its virtual machine, and he led the development of one of the first Ethereum implementations. He also proposed Solidity, the most widely used language for Ethereum contracts. He served as the first chief technology officer of the Ethereum Foundation.
After leaving the Foundation he founded a company that built Ethereum software, including a widely used client and wallet tools, and he later led the creation of Polkadot, a separate network designed to connect multiple blockchains. He is also associated with the term Web3, which he used for a vision of internet applications built on decentralised infrastructure. His involvement gives Mastering Ethereum authority on the design of the virtual machine and the intentions behind the protocol.
How the partnership shows
The partnership is visible in the book's character. Antonopoulos contributes the teaching method: step-by-step explanation, examples using real tools, and attention to the reader who is new to the subject. Wood's presence gives confidence that the descriptions of the protocol are exact. The result is a book that is accessible but does not simplify the system into something it is not.
The shape of the argument
Mastering Ethereum is a technical guide, so its argument is less a thesis than a progression of understanding. It builds a model of Ethereum from the outside in: first what the system is and how a user interacts with it, then the cryptography and data structures underneath, then the programs that run on it, and finally the machinery that keeps everyone in agreement. Its contents can be seen as four parts.
First part: the user's view
The book begins with Ethereum as a user meets it: a wallet, an address, some test ether, a transaction sent and confirmed. It explains what ether is, what a network of nodes does, and how clients connect to that network. This is the foundation for the developer, who must understand what happens when a user presses a button in a wallet before they can design what the button should do.
Second part: keys, wallets and transactions
Next the book opens the box. It explains the public-key cryptography that identifies accounts, the hash function used throughout the system, how addresses are derived from keys, and how wallets generate and store keys, including the standards that let a single backup phrase produce many keys. It then dissects a transaction field by field, explaining what each part does and how a signature proves that the owner authorised it.
Third part: contracts
The central part concerns smart contracts. It explains what a contract is on Ethereum, how it is written in a high-level language, compiled to bytecode and deployed, and how it interacts with other contracts and accounts. It covers Solidity in detail and Vyper as an alternative designed for safety and auditability. It devotes extensive attention to security: known vulnerability patterns, real attacks and defensive practices. It then covers token standards, oracles and the structure of decentralised applications, which combine on-chain contracts with off-chain interfaces and storage.
Fourth part: the machine and its consensus
The last part descends to the lowest level: the Ethereum Virtual Machine, its instruction set, its memory model and the gas cost of each operation. It then discusses consensus, explaining proof-of-work as Ethereum used it at the time and the planned move to proof-of-stake.
A movement from use to understanding
The movement is from use to understanding. A reader can stop after the first part and use Ethereum more knowledgeably. A reader who finishes the third part can write and review contracts. A reader who finishes the fourth understands why the system behaves as it does, including the costs and limits that shape every design. The appendices, which include material on improvement proposals, opcodes, development tools and libraries, serve as reference.
Idea one: a world computer made of accounts
The book's first key idea is that Ethereum is best understood as a single shared machine with a global state. Bitcoin records unspent outputs: discrete chunks of value that are consumed and created by transactions. Ethereum records accounts: named entries, each with a balance and other data, that are updated by transactions. The state of Ethereum at any moment is the set of all accounts and their contents. Each block applies a sequence of transactions to this state and produces a new state.
Two kinds of account
There are two kinds of account. An externally owned account is controlled by a private key held by a person or a program outside the chain. It has a balance and a counter of transactions sent, called its nonce, but no code. A contract account is controlled by its code. It has a balance, code, and persistent storage, a key-value store in which the contract keeps its data. A contract account has no private key; it acts only when called, and only according to its code.
Only externally owned accounts can start a transaction. A contract can call other contracts during execution, but the chain of calls must always begin with a signed transaction from an external account. This is a simple rule with deep consequences. It means contracts never act spontaneously, they cannot schedule themselves, and every action in the system can be traced back to someone who paid for it.
An analogy
Imagine a shared spreadsheet that thousands of people keep identical copies of. Some cells hold numbers owned by individuals, who can change them by signing a request. Other cells hold small programs, which run when someone triggers them and can change other cells according to fixed rules. Everyone applies the same requests in the same order and so ends with the same spreadsheet. This is close to Ethereum's model. The difference is that the spreadsheet is enormous, its rules are enforced by cryptography and consensus rather than by an administrator, and every change costs money.
Why the model matters
The account model makes complex applications easier to write than the output model of Bitcoin, because a contract can keep and update state much as a conventional program does. It also introduces new risks. Shared mutable state means that the order of transactions matters, that one contract's call to another can change state unexpectedly, and that anyone can interact with a contract in ways its author did not anticipate. Much of the book's security discussion follows from these properties.
A common confusion is to think of a smart contract as a legal contract. It is a program stored at an address. It may encode an agreement, but it has no knowledge of intentions, no ability to interpret ambiguity, and no recourse outside its code. The phrase world computer, often used of Ethereum, is also easy to misread. It is a very slow, very expensive computer whose value lies in shared trust, not in computing power.
Holding this model in mind also clarifies what a node must store. Every full node keeps the current state of every account, and that state grows as new contracts and storage entries are created. State growth is a long-term cost for the whole network, which is why writing new storage is priced so high and why proposals to limit or expire old state are discussed. The design choice of a global, shared state brings expressive power and a permanent maintenance burden together.
Idea two: keys, addresses and wallets
Everything on Ethereum rests on public-key cryptography. A private key is a random 256-bit number. From it, a public key is computed using elliptic-curve multiplication on the curve called secp256k1, the same curve Bitcoin uses. An Ethereum address is derived from the public key by hashing it with Keccak-256 and keeping the last 20 bytes. Anyone with the private key can sign transactions from the address; no one else can.
The hash function
The book takes care over a detail that has caused real confusion. Ethereum uses Keccak-256, the version of the Keccak hash function that won the SHA-3 competition, as it was submitted. The final SHA-3 standard published later changed a small padding parameter, so standard SHA-3 libraries produce different outputs from Ethereum's Keccak. A developer who uses the wrong function will produce wrong addresses and signatures. This is a small example of the precision the platform demands.
Address formats
Addresses are usually written as hexadecimal strings. Because a single wrong character sends funds to an address no one controls, a checksum scheme was introduced that encodes a check in the capitalisation of letters, so that wallets can detect most typing errors. The book explains this as an instance of a general pattern on Ethereum: improvements are added in backward-compatible ways, through proposals adopted by the community, rather than by changing the base protocol.
Wallets
A wallet is software that manages keys, not a container of coins. The coins, in the sense of balances, live on the chain. The book explains the progression from wallets that store unrelated random keys to hierarchical deterministic wallets, in which a single seed generates a tree of keys. The seed is usually encoded as a list of common words, a mnemonic phrase, which the user writes down as a backup. These standards were developed first for Bitcoin and adopted by Ethereum, so a single phrase can back up keys for many networks.
The book's advice on wallets is practical and sober. The security of funds depends entirely on the secrecy and survival of the keys or seed. Losing the seed means losing the funds; exposing it means anyone can take them. Hardware wallets, which keep keys on a separate device that signs transactions without revealing the key, reduce the risk of theft by malware. A developer building a wallet or a contract that handles keys must treat key generation, storage and signing as the most sensitive parts of the system.
Signatures and recovery
The signature scheme is ECDSA on secp256k1, and Ethereum uses a property of that scheme that many developers find surprising: from a message and its signature, one can compute the public key that produced it, and hence the address. This is why a transaction need not carry its sender's address. Contracts can use the same property to check signed messages from users, which enables patterns such as approving an action off chain and having someone else submit it. Such patterns must include protections against replay, such as a nonce or expiry inside the signed message and an identifier for the contract and network, or a valid signature can be reused in unintended places. Several real losses have come from signature checks that omitted one of these elements.
Idea three: transactions as signed messages that change state
A transaction is a signed message from an externally owned account. It is the only thing that can change the state of Ethereum. The book dissects its structure so that a developer understands exactly what is being authorised.
The fields of a transaction
In the form described in the book, a transaction contains a nonce, which is the count of previous transactions from the sending account; a gas price and gas limit, which together set the maximum fee; a recipient address; a value in ether to transfer; a data field; and a signature from which the sender's address can be recovered. The sender's address is not stored explicitly; it is derived from the signature, which saves space and ensures that only the key holder could have produced the transaction.
The nonce and ordering
The nonce ensures that transactions from an account are processed in order and that each is processed only once. If a transaction with nonce five is pending, a transaction with nonce six must wait. This prevents replay of the same transaction and lets a sender replace a pending transaction by sending another with the same nonce and a higher fee. It also creates operational problems that developers must handle, such as stuck transactions when a lower nonce never confirms.
Value, data and the meaning of a call
The value and data fields together give a transaction its meaning. A transaction with value and no data to an external account is a simple payment. A transaction with data to a contract account is a function call: the data encodes which function to run and with what arguments, according to a standard encoding. A transaction with data and no recipient creates a new contract, with the data as its initialisation code. A single structure thus supports payments, calls and deployment.
Replay across networks
After Ethereum split into two chains in 2016, a transaction valid on one chain could be replayed on the other. The fix, adopted later, was to include a chain identifier in the signed data, so a signature is valid only on its intended network. The book uses such episodes to show that seemingly minor protocol details have practical consequences, and that a developer must know which network their transactions are valid on.
What has changed
Since 2021, Ethereum has supported newer transaction types with a different fee structure, described below in the chapter on gas, and other extensions have followed. The underlying idea is unchanged: a transaction is a signed, ordered message that triggers a state change, and every field matters.
Idea four: gas, the price of computation
Gas is the book's most distinctive idea for readers coming from conventional programming. Every operation the Ethereum Virtual Machine performs has a fixed cost in units of gas. Adding two numbers costs a little. Writing to permanent storage costs a great deal. A transaction specifies the maximum gas it may use, and the sender pays for the gas actually consumed at a price denominated in ether.
Why gas exists
Gas solves two problems. The first is the halting problem in its practical form. A general-purpose machine can run programs that never stop, and there is no general way to tell in advance whether a program will stop. If every node on the network had to run every program to completion, one infinite loop would halt the network. With gas, every execution has a budget. When it is spent, execution stops, the state changes are reverted, and the fee is still paid. The network is protected without having to analyse programs in advance.
The second problem is the allocation of a scarce shared resource. Every node must execute every transaction and store all state. Computation and storage on Ethereum are therefore extremely expensive compared with ordinary computers. Gas prices those costs so that users pay in proportion to the burden they impose, and so that block space goes to those who value it most.
Gas and design
Gas shapes design profoundly. Developers minimise storage writes, pack data tightly, avoid loops whose length depends on user input, and move as much work as possible off the chain. A contract that iterates over an unbounded list may work in testing and then fail permanently when the list grows too long to process within a block's gas limit. The book teaches readers to think about gas costs as a constraint on every design choice, much as an embedded programmer thinks about memory.
How fees changed
In the model described in the book, users bid a gas price, and miners chose the highest-paying transactions. In 2021 Ethereum changed this with a proposal known as EIP-1559. Each block now has a base fee per unit of gas, set by the protocol according to how full recent blocks were, which is burned rather than paid to block producers. Users add a tip to have their transaction prioritised. The change made fees more predictable and altered the supply dynamics of ether, since burned fees remove ether from circulation. Readers of the book should understand gas as the book explains it and then read about this change, which builds on the same unit.
Failure and refunds
A detail about failure is worth stating precisely. If a transaction runs out of gas, all its state changes are undone, but the gas used up to that point is still paid, because the network did the work. If a transaction uses less gas than its limit, the unused portion is not charged. Users therefore set limits with some margin above the expected cost. Wallets estimate gas by simulating a transaction against the current state, but the state may change before the transaction is included, so an estimate is only a guide. Contracts whose gas use depends on state that others can change are harder to estimate and easier to break.
A confusion to avoid
Gas is not ether. Gas is a measure of computational work; ether is the currency used to pay for it. Keeping the two separate allows the cost of operations to be fixed in gas while the price of gas in ether varies with demand. Confusing them leads to errors in estimating costs and in understanding why the same contract call can cost very different amounts at different times.
Idea five: smart contracts as immutable public programs
A smart contract on Ethereum is a program whose bytecode is stored at an address and whose execution is carried out identically by every node. Once deployed, its code cannot be changed. It runs exactly as written, whether or not that is what its author intended. Anyone can call its public functions. Its storage and its transaction history are visible to everyone.
The lifecycle of a contract
A developer writes a contract in a high-level language, compiles it to bytecode, and deploys it with a transaction that has no recipient. The deployment runs initialisation code, which sets up storage and returns the runtime code to be stored. From then on, the contract waits to be called. Each call runs within a transaction, uses gas, can read and write the contract's storage, can send ether, and can call other contracts. If anything fails, the whole transaction's effects are reverted, though the gas spent is lost.
Solidity and Vyper
The book explains Solidity, the dominant contract language, in depth. Solidity looks somewhat like JavaScript and supports contracts with state variables, functions, events, inheritance and libraries. Its familiarity helped Ethereum's growth, but some of its features, and some early defaults, made mistakes easy. The book also covers Vyper, a language with Python-like syntax that deliberately omits features such as inheritance and certain kinds of loops, in order to make contracts easier to read and audit. The comparison is instructive: language design is a security decision.
Immutability and its consequences
Immutability is both the point and the danger. Users can trust that the rules of a contract will not change after they deposit funds, which is valuable. But bugs cannot be patched in place. To allow upgrades, developers devised patterns in which a fixed contract forwards calls to another contract whose address can be changed. These patterns restore flexibility at the cost of reintroducing trust in whoever controls the upgrade. The book discusses such trade-offs and encourages readers to be explicit about who can change what.
There is also a facility for a contract to remove itself and send its remaining ether elsewhere. Its use and its risks are part of the history of the platform; at least one large failure involved a library contract being destroyed by a user who was able to take control of it, freezing the funds of many wallets that depended on it. The behaviour of this facility has since been restricted by protocol changes. The lesson for the developer is that every function that can alter or remove a contract must be guarded with extreme care.
Events and the outside world
Contracts cannot push information to users. Instead they emit events, which are recorded in transaction logs. Off-chain applications watch for these logs to update interfaces and databases. Logs are cheaper than storage but cannot be read by contracts. Understanding this split, between state that contracts can read and logs that only the outside world reads, is essential to designing applications that are both efficient and responsive.
Composability
Because every contract is public and can be called by any other, contracts can be combined like building blocks without anyone's permission. A lending contract can accept a token issued by another contract, price it using a third contract, and allow a fourth to liquidate positions. This property, often called composability, is a large part of why decentralised finance grew so quickly after the book appeared. It is also why failures spread. A flaw in one widely used contract affects every contract that depends on it, and an attacker can combine many contracts within a single transaction, borrowing large sums at the start and repaying them at the end, to exploit a weakness that would otherwise require capital. The book's discussion of external calls and trust boundaries is the right preparation for understanding this world.
Testing before deployment
Because deployment is permanent, the book places weight on testing. Developers run contracts on a local simulated chain, write automated tests for every function and failure path, and then deploy to public test networks where ether has no value before using the main network. Tests should cover not only what a contract does when used correctly but what happens when it is called in unexpected orders, with extreme values, or by hostile contracts. Since the book appeared, tools for fuzzing, which generate many random inputs, and for formal verification, which prove properties of code mathematically, have become common in serious projects. The principle is the one the book states: assume the contract will be attacked, and find the flaws before an attacker does.
Idea six: security as the first discipline
The chapter on smart contract security is often described as the most valuable in the book. Its message is that on Ethereum, security is not a feature added at the end but the primary constraint on design. Contracts hold value, run in public, cannot be patched, and are attacked by people who study them closely and are rewarded immediately for finding a flaw.
Reentrancy and the DAO
The best-known vulnerability is reentrancy. Suppose a contract keeps a record of balances and lets users withdraw. A naive withdraw function sends ether to the caller and then sets the caller's balance to zero. When ether is sent to a contract, that contract's code can run. A malicious contract can use this moment to call withdraw again, before its balance has been reset, and repeat until the victim is drained. The fix is to update the record before sending, a pattern often summarised as checks, then effects, then interactions, and to use guards that prevent a function from being entered again while it is running.
In 2016, a large investment contract known as The DAO, which had raised a very large amount of ether from thousands of participants, was attacked using a reentrancy flaw, and a substantial portion of its funds was moved into a contract controlled by the attacker. The Ethereum community responded by adopting a change to the protocol that moved the funds back to a recovery contract. A minority rejected this as a violation of the principle that the chain should not be altered, and continued the original chain, which became Ethereum Classic. The episode is both a technical lesson and a lesson in governance: code is not the only law on a blockchain, but changing outcomes after the fact divides communities.
Other classes of flaw
The book covers many other patterns. Arithmetic overflow and underflow, in which numbers wrap around their limits, allowed attackers to create huge token balances; later versions of Solidity check arithmetic by default. Access control errors leave sensitive functions callable by anyone. Unchecked return values from external calls let failures pass silently. Reliance on block timestamps or other values that block producers can influence makes randomness and timing predictable. Front-running exploits the fact that pending transactions are visible: an observer can see a profitable transaction and submit their own with a higher fee to be processed first. Denial of service can occur when a contract's logic depends on an external call or loop that an attacker can make fail.
Defensive practice
The defensive practices the book recommends are consistent. Keep contracts simple. Reuse well-audited libraries rather than writing common functions from scratch. Assume every external call is hostile. Favour patterns in which users withdraw funds rather than having contracts push funds to them. Test thoroughly, including with adversarial cases. Have code reviewed and audited by others. Plan for failure, with limits on how much value can be at risk and mechanisms to pause in emergencies, while recognising that such mechanisms add trust.
The wider lesson
The deeper lesson extends beyond Ethereum. In a system where code directly controls value and cannot be changed, every assumption a programmer makes becomes an attack surface. Ordinary software is protected by layers of human institutions: customer support, chargebacks, patches, courts. Smart contracts remove most of these. The result is a demanding environment that rewards careful, conservative engineering and punishes cleverness. Since the book was written, losses from contract exploits have continued, often running into very large sums each year, which confirms its emphasis.
Idea seven: tokens and shared standards
A token on Ethereum is not a native asset. It is a contract that keeps a ledger of balances and implements functions to transfer them. Because any developer can write such a contract, tokens could have had a thousand incompatible interfaces. Standards solved this by defining common functions and events that wallets, exchanges and other contracts can rely on.
Fungible tokens
The ERC-20 standard defines an interface for fungible tokens, in which every unit is interchangeable with every other, like units of a currency. It specifies functions to check balances and total supply, to transfer tokens, and to approve another address to spend tokens on one's behalf. That last pattern, approval followed by a transfer by the approved party, lets contracts such as exchanges move tokens for users. It also introduced subtle issues, including a race condition in changing approvals and the risk that users grant unlimited approvals to contracts that are later compromised.
The book also explains a weakness in the standard: if tokens are sent directly to a contract that does not know how to handle them, they can be lost forever, since the receiving contract is not notified. Later proposals tried to address this with callbacks, at the cost of reintroducing reentrancy risks. The trade-off illustrates how every convenience in contract design has a security price.
Non-fungible tokens
The ERC-721 standard defines non-fungible tokens, each with a unique identifier, so that a contract can represent ownership of distinct items: collectibles, game assets, certificates, or claims on real-world objects. The book describes this standard at an early stage of its adoption; the later boom in digital collectibles and art made it widely known. Technically, an NFT is an entry in a contract's ledger that maps an identifier to an owner. What the identifier refers to, and whether that reference is durable, depends on data often stored off the chain.
What tokens are and are not
The book encourages a clear-eyed view of tokens. A token is a programmable entry in a contract's storage. It may represent a currency, a share, a vote, access to a service, or nothing at all. Its value depends on the promises made by its issuer, the code of its contract and the market's belief. The book discusses the distinction between utility and equity-like tokens and notes the legal uncertainty surrounding token sales. A developer who understands tokens technically will be less easily impressed by them economically.
Tokens as building blocks
Standards also make tokens composable. Because every ERC-20 token exposes the same functions, an exchange contract can trade any pair of them, a lending contract can accept any of them as collateral, and a wallet can display any of them without special code. Ether itself does not follow the token standard, since it is the native currency, so a common practice is to wrap ether in a token contract that issues one token for each unit deposited. This small detail reveals the general principle: standards exist so that programs written by strangers can work together without coordination, which is the property that makes the platform more than the sum of its contracts.
Idea eight: oracles and the edge of the chain
A smart contract can see only the blockchain. It cannot query a website, read a sensor or check the price of a commodity. Yet many useful contracts depend on such information: insurance that pays when a flight is delayed, loans that liquidate when a price falls, bets on sporting results. Oracles are the mechanisms that bring external data on chain.
Why the problem is hard
The difficulty is fundamental. The chain gains its trustworthiness from the fact that every node can verify every step. External data cannot be verified this way; it must be reported by someone. Whoever reports it becomes a point of trust, and if large sums depend on a reported value, there is a strong incentive to corrupt the report.
Design patterns
The book describes several approaches. A single trusted reporter is simplest and most fragile. Multiple independent reporters with aggregation reduce reliance on any one. Cryptographic attestations, such as signed data from a trusted source or proofs from secure hardware, can show that data came from a particular origin. Reporters can be required to stake value that is lost if they report falsely. Each approach shifts trust rather than eliminating it.
Oracles in practice
Since the book appeared, oracle networks have become core infrastructure for decentralised finance, and oracle manipulation has become a major source of losses. A frequent pattern is an attacker who temporarily moves a price on a thin market, causing a contract that reads that market as its oracle to make loans or liquidations at false prices. The book's warning that oracles reintroduce trust and therefore risk has been repeatedly confirmed.
Idea nine: decentralised applications
A decentralised application, or DApp, combines smart contracts with a user interface and, often, decentralised storage and naming. The book explains how these pieces fit together and what decentralised means in each layer.
The layers of a DApp
The back end is a set of contracts on the chain, holding state and enforcing rules. The front end is usually a web application that runs in a browser and talks to the chain through a wallet, which signs transactions on the user's behalf. Large files, such as images or documents, are too expensive to store on chain and are kept in content-addressed storage systems, where a file is identified by its hash. Human-readable names can be mapped to addresses and content through a naming service built on contracts.
How decentralised is it really
The book is honest that decentralisation is uneven. Contracts may be decentralised while the front end is served from an ordinary web host that can be taken down or altered. Users often reach the chain through a small number of infrastructure providers rather than running their own nodes. Off-chain storage may depend on someone paying to keep files available. A DApp is only as decentralised as its most central component. A reader who learns to examine each layer separately will be able to assess claims of decentralisation critically.
The user's position
A decentralised application asks more of its users than a conventional one. The user must hold keys, pay fees, wait for confirmation, and read signing requests that are often hard to interpret. Many losses happen not through flaws in contracts but through users signing transactions or approvals they do not understand, often prompted by a malicious site that imitates a real one. The book's explanation of what a transaction authorises is the best defence a technical reader has. For developers, the lesson is to make signing requests as clear as possible and to request only the permissions an action needs.
Design thinking
The book encourages developers to put on chain only what must be there: the rules that need to be enforced without trust and the state those rules govern. Everything else, from presentation to analytics, belongs off chain. This minimises cost and attack surface. It also clarifies what users are actually trusting when they use the application.
Idea ten: the machine underneath and the agreement that holds it
The book's final technical part explains the Ethereum Virtual Machine and consensus. These are the layers least visible to users and most decisive for what the system can do.
The virtual machine
The EVM is a stack-based machine that operates on 256-bit words. It has a small instruction set: arithmetic, comparison, bitwise operations, hashing, access to environment information such as the caller and the value sent, control flow, and instructions to read and write memory and storage, to call other contracts and to create new ones. It has three kinds of data space: the stack for intermediate values, memory that is cleared after each call, and storage that persists between transactions. Each instruction has a gas cost that reflects its burden on the network.
The 256-bit word size suits the cryptographic operations Ethereum performs, such as hashing and handling keys, but is unusual and makes ordinary arithmetic expensive. The design is deterministic: given the same state and transaction, every node must produce the same result, so the EVM excludes sources of nondeterminism such as floating-point arithmetic and access to the outside world. The book walks through how high-level code becomes a sequence of these instructions, which helps developers understand gas costs and the behaviour of compiled contracts.
The EVM proved more influential than its designers may have expected. Many other blockchains adopted EVM compatibility so that Ethereum contracts and tools could run on them, and layer-two networks that process transactions off the main chain and post results to it also commonly run the EVM. Understanding it thus gives access to a large part of the wider blockchain world.
Clients and nodes
The machine is not a single program but a specification implemented by several independent clients, written by different teams in different languages. Running more than one client implementation is a deliberate safety measure: a bug in one client is less likely to bring down the whole network if many nodes run another. The book explains what a full node does, verifying every block and keeping the current state, and how lighter clients trade some verification for convenience. Since the move to proof-of-stake, a node consists of two cooperating pieces of software, one for execution and one for consensus, which reflects the layering the book describes at a conceptual level.
For a developer, the practical point is that most applications reach the chain through a node they do not run themselves, often operated by a commercial provider. This is convenient and usually reliable, but it means the application trusts that provider to report the chain honestly and to stay available. A developer who understands what a node verifies can decide where that trust is acceptable.
Consensus
When the book was written, Ethereum used proof-of-work, with its own mining algorithm designed to be memory-intensive in order to resist specialised hardware. The book explains this and discusses the planned transition to proof-of-stake, in which validators lock ether as collateral and are chosen to propose and attest to blocks, losing part of their stake if they act dishonestly.
That transition took place in September 2022 and is usually called the Merge. It reduced Ethereum's energy use dramatically and changed the economics of issuance and security. Readers should treat the book's consensus chapter as historical background and read a current account of proof-of-stake Ethereum for the present design. The conceptual material, why consensus is needed, what problem it solves and what trade-offs different methods involve, remains useful.
Scaling
The book also anticipated the scaling problem. Because every node executes every transaction, the main chain can process only a limited number of transactions, and fees rise when demand is high. Since 2018, the dominant approach has been to move execution to layer-two systems, especially rollups, which process many transactions off the main chain and post compressed data and proofs to it. The main chain increasingly serves as a secure base for these systems. A reader who understands the EVM, gas and consensus from this book is well prepared to understand this newer architecture.
The tradition around it
Mastering Ethereum stands in a line of technical writing about blockchains that began with the Bitcoin white paper and was developed for practitioners by Antonopoulos's own Mastering Bitcoin.
Foundations
The Ethereum white paper, written by Vitalik Buterin in late 2013, proposed a blockchain with a built-in programming language. The Yellow Paper by Gavin Wood specified it formally. These documents are the primary sources; Mastering Ethereum makes them accessible. Earlier still, the idea of smart contracts was described in the 1990s by Nick Szabo, who imagined agreements enforced by code, though without a practical platform.
Companions on this shelf
Mastering Bitcoin is the natural predecessor. It explains the cryptography, keys, transactions and consensus of Bitcoin, which Ethereum both adopts and departs from. Reading the two together shows the difference between an output-based ledger focused on money and an account-based machine focused on programs. Bitcoin and Cryptocurrency Technologies by Narayanan and colleagues provides the computer-science foundations of both. Serious Cryptography by Jean-Philippe Aumasson explains the hash functions, elliptic-curve signatures and randomness that Ethereum depends on, at the depth a security-minded developer needs.
For history and context, The Infinite Machine by Camila Russo tells the story of Ethereum's founding, early development and the DAO crisis from a journalistic perspective. The Cryptopians by Laura Shin covers the same era with attention to the people and conflicts involved. Reading either alongside Mastering Ethereum gives human context to the technical decisions. The Blockchain and the New Architecture of Trust by Kevin Werbach examines what kinds of trust blockchains create and replace, which deepens the discussion of oracles and governance. Read Write Own by Chris Dixon presents an optimistic case for building internet services on these platforms. Number Go Up by Zeke Faux and Going Infinite by Michael Lewis show what can go wrong when financial speculation outpaces engineering discipline.
How the protocol changes
The book also explains, briefly, how Ethereum changes. Proposals for improvements are written as numbered documents, discussed in public, and, if accepted, implemented by client teams and activated at a scheduled block in a coordinated upgrade. Application-level standards, such as token interfaces, follow a similar process but do not require any change to the protocol; they become standards by adoption. This combination of formal process and informal consensus is unusual and sometimes slow, but it has allowed the platform to make large changes, including the move to proof-of-stake, without splitting since the DAO episode. Understanding it helps a reader interpret the many proposal numbers that appear in technical discussion.
What came after
Since the book appeared, the Ethereum ecosystem has produced decentralised finance, large markets in digital collectibles, layer-two networks and a vast body of tooling. The security literature has grown into a professional field of auditing, with its own standards and catalogues of vulnerabilities. Much of this builds directly on the concepts the book teaches.
Questions and criticisms
What has aged
The book is dated in important places. Its consensus chapter describes a proof-of-work system Ethereum no longer uses. Its explanation of fees predates the 2021 change. Its Solidity examples reflect versions of the language that have since changed defaults, especially for arithmetic, and syntax. Its tooling sections refer to development frameworks some of which have been superseded. Layer-two scaling, now central, receives only anticipatory treatment. A reader must supplement it with current documentation. The open-source nature of the text has allowed some updating, but the printed edition reflects 2018.
What has held up
The core concepts have held up well: the account model, transactions, gas, the EVM, the nature of smart contracts and, above all, the security analysis. The vulnerability patterns it describes continue to appear in new contracts, and its defensive principles remain the right ones. The explanation of oracles as a necessary but trust-reintroducing component has been vindicated.
Scope and depth
Some readers find the book uneven: very detailed in places, such as transaction structure, and brief in others, such as decentralised application design. It is not a complete course in Solidity programming, and readers who want to become professional developers will need more practice-oriented resources. It is also not a book about the economics or governance of Ethereum, though it touches on both.
Privacy
One subject receives less attention than its importance now warrants: privacy. Every balance, every contract's storage and every transaction on Ethereum is public. Addresses are not names, but they can often be linked to people through exchanges, reused addresses and patterns of activity. A developer who builds an application on Ethereum is building on a public record, and data written to it cannot be deleted. Secret values stored in a contract are not secret, even if the variable is marked private in Solidity, because anyone can read the raw storage. The book notes this, but readers should take it further. Techniques such as zero-knowledge proofs, which allow a statement to be verified without revealing the data behind it, have become an active area since 2018 and are now used both for privacy and for scaling. A reader who finishes the book should regard public visibility as a basic design condition, to be planned for from the first line of a contract.
The same visibility has benefits that the book rightly stresses. Anyone can audit a contract's code and history, verify supply figures for a token, or trace where funds went after an exploit. Public data has helped investigators recover stolen funds and has allowed researchers to study the system in detail. Transparency and privacy pull in opposite directions, and good designs choose deliberately where to stand between them.
A deeper question
A more fundamental criticism concerns the premise. Some computer scientists and security experts argue that public smart contract platforms combine too much risk with too little benefit: code that cannot be patched, adversaries everywhere, and limited ability to reverse errors. They point to the persistent scale of losses as evidence. Supporters reply that these are the costs of a new kind of infrastructure, that practice is improving, and that the openness and composability of the platform enable things not otherwise possible. The book takes the supporters' side but is unusually frank about the risks. A reader can use it to form an independent judgement, which is a mark of its quality.
Why it is on this shelf
This shelf gathers works on Vedanta, Jyotish, science, economics and technology. In the technology bay on cryptography and blockchains, we keep books that explain how systems actually work, so that claims about them can be tested. Mastering Ethereum is here because it is the clearest full account of the most widely used smart contract platform, and because the machine it describes has become a template copied by many others.
It also teaches something general. Ethereum is an experiment in letting code directly govern value and agreements among strangers. Its successes and failures are evidence about what such systems can and cannot do. Understanding the machine allows a reader to separate genuine capability from marketing, to see why some applications work and others fail, and to judge the risks of any system that claims to replace trust with code.
Finally, the book's emphasis on security embodies a discipline we value across the whole shelf: state assumptions, consider adversaries, prefer simplicity, and treat irreversible actions with care. That discipline is as relevant to reading economic arguments or technical forecasts as to writing contracts.
How to read it
A plan for a first reading
- Read the opening chapters on what Ethereum is and its basics, and actually install a wallet and use a test network. Seeing a transaction confirm makes the later chapters concrete.
- Read the chapters on cryptography, wallets and transactions carefully. They explain what a signature authorises and why keys are everything.
- Read the Solidity chapter with a development environment open, compiling and deploying the examples to a test network. Update the syntax as needed for the current compiler.
- Read the smart contract security chapter slowly, ideally twice. For each vulnerability, write a small vulnerable contract and then fix it.
- Read the chapters on tokens, oracles and decentralised applications at moderate pace, with a current token standard document and an oracle network's documentation for comparison.
- Read the EVM chapter when you are curious about why gas costs are what they are; it can wait until after the security chapter.
- Read the consensus chapter last, as history, and then read a current explanation of proof-of-stake Ethereum and of rollups.
With a pencil
- Trace by hand how a private key becomes an address, naming each step and the function used.
- Take a simple contract and list every storage write it performs, estimating its gas cost; then see whether the design can be changed to need fewer writes.
- Draw the sequence of calls in a reentrancy attack, marking the exact moment at which the victim's state is inconsistent.
- For any DApp you use, list each layer, from contracts to front end to storage, and note who could change or stop each one.
Pace
With practical work, a chapter every three or four days is reasonable, giving six to eight weeks for the whole book. Readers who only want concepts can go faster, but the security chapter repays slow, hands-on study whatever one's goal.
Setting up to read
Before starting, install a browser wallet and a local development environment, and obtain test ether from a public test network. The specific tools named in the book may have changed; use whatever the current Ethereum developer documentation recommends. Keep that documentation and the current Solidity documentation open while reading, and treat any difference between them and the book as a lesson in how the platform has evolved rather than as an error to be ignored.
What to read next from this shelf
Read Mastering Bitcoin, if you have not, for the contrasting design. Read Serious Cryptography for the cryptographic foundations. Read Bitcoin and Cryptocurrency Technologies for the theory of consensus. Read The Infinite Machine or The Cryptopians for the history of Ethereum's people and crises. Read The Blockchain and the New Architecture of Trust for a careful account of what trust these systems actually provide.
Questions to carry
- What is the state of Ethereum, and how exactly does a transaction change it?
- Why can only externally owned accounts start transactions, and what does that prevent?
- What problems does gas solve, and what design habits does it force?
- Why is immutability both the main promise and the main danger of smart contracts?
- How does reentrancy work, and why does the order of state updates and external calls matter so much?
- What did the response to the DAO attack reveal about who governs a blockchain?
- What does an ERC-20 approval actually authorise, and how can that authorisation be abused?
- What is an NFT technically, and what about it lives off the chain?
- Why can no oracle design remove trust entirely, and where does it put that trust?
- Which layer of a given DApp is least decentralised, and what follows from that?
- Why does the EVM use 256-bit words and exclude floating-point arithmetic?
- What changed when Ethereum moved to proof-of-stake, and what stayed the same?
- Where does upgradability reintroduce the very trust that contracts were meant to remove?
- In which applications is code-enforced agreement genuinely better than institutions, and in which is it worse?
Words to know
- Ether: the native currency of Ethereum, used to pay for computation and transfer value.
- Externally owned account: an account controlled by a private key, able to start transactions.
- Contract account: an account controlled by its code, with persistent storage, acting only when called.
- State: the full set of accounts, balances, code and storage at a given moment.
- Nonce: in Ethereum, the count of transactions sent from an account, enforcing order and preventing replay.
- Keccak-256: the hash function Ethereum uses, an earlier variant of what became SHA-3.
- Mnemonic phrase: a list of words encoding the seed from which a wallet derives its keys.
- Gas: the unit measuring the computational work of operations on the EVM.
- Gas limit: the maximum gas a transaction may consume, or the maximum a block may contain.
- Base fee: since 2021, the protocol-set price per unit of gas, burned rather than paid to block producers.
- Smart contract: a program stored at an address on the chain and executed identically by all nodes.
- Solidity: the most widely used high-level language for Ethereum contracts.
- Vyper: a Python-like contract language designed for simplicity and auditability.
- Bytecode: the low-level instructions that the EVM executes.
- Ethereum Virtual Machine (EVM): the deterministic, stack-based machine that runs contract code.
- Reentrancy: a flaw in which an external call allows a contract to be re-entered before its state is updated.
- Front-running: exploiting knowledge of pending transactions by placing one's own ahead of them.
- ERC-20: the standard interface for fungible tokens on Ethereum.
- ERC-721: the standard interface for non-fungible tokens with unique identifiers.
- Oracle: a mechanism for bringing external data onto the chain.
- DApp: a decentralised application combining contracts with off-chain interfaces and storage.
- Proof-of-stake: a consensus method in which validators lock currency as collateral to propose and attest to blocks.
- Rollup: a layer-two system that executes transactions off the main chain and posts data and proofs to it.
- Hard fork: a change to protocol rules that is not compatible with old software, which can split a chain.
A note on this edition
This is a study edition written for this shelf in our own words. It explains and comments on Mastering Ethereum by Andreas M. Antonopoulos and Gavin Wood without reproducing its text, code or examples. The book itself is in copyright, though its authors have made it available under an open licence; it is well worth reading in full, from a library, a bookshop or its official open repository. Where this companion describes developments after 2018, it does so to help the reader place the book, and any errors are ours.