SOLID STATE PRESS
← Back to catalog
The Ethereum Virtual Machine (EVM) cover
Coming soon
Coming soon to Amazon
This title is in our publishing queue.
Browse available titles
Cryptocurrency & Blockchain

The Ethereum Virtual Machine (EVM)

Opcodes, Gas, and the Stack Machine That Runs Smart Contracts — A TLDR Primer

Smart contracts run the decentralized web — but most explanations stop at "it's code on the blockchain" and leave you guessing about the rest. If you're taking a blockchain development course, preparing for a web3 interview, or just trying to understand what actually happens when a transaction hits Ethereum, this guide closes the gap.

**The Ethereum Virtual Machine (EVM): Opcodes, Gas, and the Stack Machine That Runs Smart Contracts** is a focused, no-filler primer that walks you through the complete picture. You'll learn why Ethereum needed a general-purpose virtual machine when Bitcoin's simpler scripting model wasn't enough, how the EVM's stack-based architecture processes instructions one opcode at a time, and how gas fees are calculated — including the EIP-1559 base-fee mechanics that changed how users pay for computation. The guide traces a Solidity contract from source code through compilation to a live transaction, so you can see exactly how developer tools and the blockchain connect.

Designed for high school and early college students, self-taught developers exploring web3, and anyone trying to get a solid conceptual foundation before diving into deeper resources. No prior blockchain experience is assumed, though basic familiarity with programming helps. Each section is built around concrete examples — real opcodes, real numbers, real stack traces — so abstractions land instead of float.

If you've been searching for an ethereum virtual machine explained for beginners resource that doesn't assume you're already a protocol engineer, this is it. A concise primer with no filler. Read it in one sitting.

Grab your copy and finally understand what the EVM is actually doing.

What you'll learn
  • Explain what the EVM is and why Ethereum needs a virtual machine in the first place
  • Describe the EVM's stack-based architecture, including the stack, memory, storage, and calldata
  • Read simple EVM bytecode and trace how common opcodes manipulate the stack
  • Understand gas: why it exists, how it is calculated, and how it prevents infinite loops
  • Connect Solidity source code to compiled bytecode and to transactions on-chain
  • Recognize how the EVM relates to Layer 2s, EVM-compatible chains, and recent upgrades
What's inside
  1. 1. What the EVM Is and Why It Exists
    Introduces the EVM as Ethereum's global computer, contrasts it with Bitcoin's simpler scripting model, and explains determinism and replicated execution.
  2. 2. Architecture: Stack, Memory, Storage, and Calldata
    Walks through the four main data locations the EVM uses during execution and how they differ in cost, persistence, and access patterns.
  3. 3. Opcodes and Bytecode: Reading What the EVM Actually Runs
    Introduces the EVM instruction set, shows how Solidity compiles to bytecode, and traces a short program through the stack.
  4. 4. Gas: Paying for Computation
    Explains why gas exists, how gas limits and gas prices work, EIP-1559 base fee mechanics, and why some opcodes cost far more than others.
  5. 5. From Solidity to a Transaction: The Full Pipeline
    Follows a contract from Solidity source through compilation, deployment, and a function call, showing how the EVM ties developer tools and the blockchain together.
  6. 6. Beyond Mainnet: L2s, EVM-Compatible Chains, and What Comes Next
    Surveys why the EVM became a de facto standard, how rollups reuse it, and what recent upgrades like account abstraction and Verkle trees imply.
Published by Solid State Press
The Ethereum Virtual Machine (EVM) cover
TLDR STUDY GUIDES

The Ethereum Virtual Machine (EVM)

Opcodes, Gas, and the Stack Machine That Runs Smart Contracts — A TLDR Primer
Solid State Press

Contents

  1. 1 What the EVM Is and Why It Exists
  2. 2 Architecture: Stack, Memory, Storage, and Calldata
  3. 3 Opcodes and Bytecode: Reading What the EVM Actually Runs
  4. 4 Gas: Paying for Computation
  5. 5 From Solidity to a Transaction: The Full Pipeline
  6. 6 Beyond Mainnet: L2s, EVM-Compatible Chains, and What Comes Next
Chapter 1

What the EVM Is and Why It Exists

Every node in the Ethereum network — thousands of computers spread across the globe — runs the same program and arrives at the same result. The piece of software that makes that possible is the Ethereum Virtual Machine, or EVM: a sandboxed, deterministic computation engine embedded in every Ethereum client.

To understand why the EVM exists, start with what Ethereum is trying to do. Bitcoin lets users transfer a coin from one address to another. Its scripting language can attach small conditions to a transfer ("only spendable if you provide a valid signature"), but those conditions are narrow by design. Bitcoin's scripts are deliberately limited — they cannot loop indefinitely, they cannot store arbitrary data between transactions, and they are not meant to encode general-purpose programs.

Ethereum's founding insight was that a blockchain could do more if it supported smart contracts: programs that live on-chain, execute automatically when called, and can hold assets, enforce rules, and communicate with other contracts — all without a trusted intermediary. That required something Bitcoin's script couldn't provide: a full, general-purpose computation engine that every node agrees on.

The EVM as a Replicated State Machine

The Ethereum network maintains a world state: a giant mapping from addresses to account data (balances, stored values, and — for contract accounts — executable code). Every transaction potentially changes that state: it might transfer ETH, deploy new contract code, or invoke an existing contract's function.

The EVM is the engine that processes those changes. When a node receives a transaction that calls a contract, it feeds that transaction into the EVM, which reads the contract's bytecode and executes it instruction by instruction. The result is a precise change to the world state — tokens transferred, a variable updated, an event logged.

Here is the critical constraint: every node on the network must execute the same transaction and reach the identical new state. This property is called determinism. Deterministic execution means the output depends only on the input — never on the time of day, the node's operating system, a random number from the environment, or anything else that could differ between machines. If execution were non-deterministic, different nodes would disagree about the state of the ledger, and consensus would collapse.

About This Book

If you are a computer science or blockchain development student trying to get the Ethereum Virtual Machine explained for beginners, a self-taught developer puzzling over how smart contracts execute on a blockchain, or someone who just bought ETH and wants to understand what actually happens under the hood when a transaction runs, this book is for you.

This guide covers the EVM's stack-based architecture, how Solidity compilation to bytecode works step by step, EVM opcodes and the stack machine model, and blockchain gas fees explained simply and precisely. It also walks through Ethereum's storage model, the full pipeline from Solidity source to an on-chain transaction, and closes with Ethereum Layer 2 rollups as a beginner primer. Think of it as a crypto developer concepts study guide — tight, concrete, and built for someone who wants real understanding with no filler.

Read straight through for the clearest experience. Work each numbered example as you reach it, then attempt the problem set at the end to test your understanding.

Keep reading

You've read the first half of Chapter 1. The complete book covers 6 chapters in roughly fifteen pages — readable in one sitting.

Coming soon to Amazon