Last lesson we said Ethereum doesn’t just move money around — it runs programs. Smart contracts, tokens, whole applications, all living on the chain. Which raises an annoying follow-up question that most explainers conveniently skip:
Where do those programs actually run?
Your laptop runs programs on its CPU. A website runs on a server somewhere. But a smart contract isn’t on anyone’s particular machine — it belongs to the whole network. So Ethereum needs a computer that everyone runs, that nobody owns, and that always agrees with itself. That computer is the EVM, and this lesson is the tour.
One Computer, a Thousand Copies
Before we explain it, a gut check.
There are thousands of Ethereum nodes around the world. How many 'computers' does a smart contract effectively run on?
The EVM (Ethereum Virtual Machine) is a virtual machine: a computer defined by rules, not by hardware. A virtual machine is a piece of software that pretends to be a CPU — it has its own instruction set, its own memory model, its own notion of what a “step” is — and any real computer can run it by following those rules. Java works this way; so do game-console emulators. The point is portability: write the rules once, and every machine that follows them behaves identically.
Ethereum takes that idea and makes it social. There is conceptually one EVM, but its state is replicated across every node on the network. Think of it as a giant shared spreadsheet — a Google Doc the size of the planet — that thousands of people have open at once. Nobody edits a cell by hand. The document only changes when a rule-following edit is submitted and everyone applies that same edit. Because they all start from the same document and apply the same edits by the same rules, they all end up looking at the same document. One computer, a thousand identical copies.
Virtual ≠ fake
“Virtual” doesn’t mean pretend. It means defined by a specification instead of by silicon. The EVM is as real as any computer — it just lives in an agreed-upon rulebook that thousands of machines obey simultaneously.
World State: What the Computer Remembers
A computer without memory is a very expensive paperweight. The EVM’s memory is called the world state.
The world state is the complete set of everything the EVM remembers at a given moment: every account and all of its data. For each account that means:
- its balance (how much ETH it holds),
- for contract accounts, the code that runs when you call it,
- and that contract’s storage (its private, persistent variables — a token contract’s “who owns how much” table lives here).
If the EVM is a game console, the world state is the save file. Press the button (send a transaction) and the save file updates. Reboot a node from scratch, replay every save up to now, and you land on the exact same save file as everyone else.
Fill in the blanks about what the world state holds.
Pick the right option for each blank, then check.
The is the set of all accounts and their data — balances, contract code, and each contract's persistent — at one moment in time. A handy analogy is the game console's .
A Transaction Is a State Transition
Here’s the single most important sentence in this entire lesson, so we’ll put it in code:
newState = EVM(oldState, transaction)
That’s the whole model. A transaction is an instruction submitted to the network (“send 3 ETH from A to B”, or “call this contract’s mint function”). The EVM takes the old world state plus that transaction and computes a new world state. Nothing more mystical than that: a transaction is a state transition — a recipe for turning one save file into the next.
And the EVM is a state machine: a system that sits in some state and moves to a new, fully-determined state when an input arrives. (Light switch: states “on” and “off”, input “flip”. Same idea, slightly more accounts.)
The magic word is deterministic. Deterministic means no surprises, ever: the same starting state plus the same transaction produces the exact same new state — on every node, every time, forever. No randomness, no “depends on the weather,” no “works on my machine.” That property is the bedrock that lets thousands of strangers agree without trusting each other.
Play with one below. Step a few preset transactions through the machine and watch the world state go from before to after. Try a plain ETH transfer first (watch two balances change), then a contract call (watch the contract’s stored number change), then hit reset and run the same sequence again — note that you get the identical result. That repeatability is determinism, live.
World state
- A10 ETHbalance
- B2 ETHbalance
- Counter contract0 ETHbalancestored count: 0
Transaction (input)
A sends 1 ETH to B
Same start + same transaction ⇒ same result, every time. That is determinism — and it's why every node on Earth agrees on the world state.
A node in Tokyo and a node in São Paulo both apply transaction T to the same starting world state S. What does determinism guarantee about their results?
A transfer, worked step by step
Say the world state has account A holding 10 ETH and account B holding 2 ETH. A signs and broadcasts the transaction “send 3 ETH to B.” The EVM does the obvious arithmetic against the old state:
| Account | Before | Change | After |
|---|---|---|---|
| A | 10 ETH | −3 | 7 ETH |
| B | 2 ETH | +3 | 5 ETH |
The new world state is “A: 7, B: 5.” Two cells in the giant spreadsheet changed; nothing else moved. (We’re ignoring the small fee for now — that’s the next lesson.) Every node that applies this transaction to that same old state lands on A: 7, B: 5. No exceptions, because there’s no room for any.
Why Every Node Re-Runs Everything (Gas Preview)
Here’s the part that sounds absurd until it clicks: every node independently re-executes every transaction. Your node doesn’t take some other node’s word for the new balances. It downloads the transaction, runs it through its own EVM, computes the result itself, and checks that everyone else got the same thing.
Picture thousands of meticulous accountants, each handed the same stack of receipts, each redoing every single sum by hand, then comparing answers. Wildly redundant — and that redundancy is the security. To cheat, you wouldn’t fool one accountant; you’d have to fool the majority of them simultaneously, all running identical, deterministic rules. Good luck.
But re-running everything has a cost, and it points straight at the next concept:
Yes — and deliberately so. The waste is the product. A normal cloud server is cheap because exactly one machine does the work and you trust it. The EVM is expensive because thousands of machines do the same work and you trust none of them individually — only their agreement. You’re not paying for raw compute; you’re paying for trustless verification.
That cost is also why every operation must be metered and paid for. If computation were free, a single attacker could submit a transaction with an infinite loop and force every node on Earth to spin forever. So the EVM charges for each step in a unit called gas, and a transaction that runs out of gas halts. Gas gets a full lesson of its own — for now, just hold the link in your head: re-execution by everyone ⇒ computation must be priced.
Bytecode and Being Turing-Complete
Nobody writes raw EVM instructions by hand (well, almost nobody, and they need a hug). Developers write contracts in high-level languages like Solidity or Vyper — readable code with functions, variables, and if-statements. A compiler then translates that down into EVM bytecode: a long string of low-level opcodes, the tiny primitive instructions the EVM actually executes (ADD, SSTORE, JUMP, and friends). Bytecode is to Solidity what machine code is to the C you’d write on your laptop — the same logic, ground down into steps a machine can chew.
The EVM is also Turing-complete. Turing-complete means it can, in principle, express any computation you can describe — loops, branches, arbitrary logic — given enough resources. That’s powerful: it’s why Ethereum can host genuinely complicated programs, not just “move coin from X to Y.”
The catch with Turing-completeness is the halting problem: a sufficiently expressive machine can write programs that loop forever, and you can’t always tell in advance whether one will. The EVM’s fix is gas (again): every step costs gas, a transaction carries a finite gas budget, and when the budget runs dry, execution halts. So the EVM is Turing-complete with a meter — it can express anything, but it can’t run anything for free or forever.
This is a deliberate contrast with Bitcoin Script, Bitcoin’s on-chain language, which is intentionally not Turing-complete. Bitcoin Script has no unbounded loops on purpose — less expressive, but easier to reason about and harder to footgun. Ethereum chose the opposite trade: maximal expressiveness, fenced in by gas.
Match each term to what it actually is.
Pick a term, then click its definition.
Sort each statement: is it true of the EVM, or not?
Place each item in the right group.
- Programs can loop forever for free
- Its state is replicated across every node
- Each node may compute a slightly different result
- It is Turing-complete (bounded by gas)
- It is deterministic — same input always gives the same output
- It runs on one central server Ethereum owns
Blocks Put the Transactions in Order
One last piece. newState = EVM(oldState, transaction) is great for one transaction — but thousands fly in every minute, and order matters. (If A has 10 ETH and tries to send 8 ETH to both B and C, which one goes through depends entirely on which is processed first.) So the EVM needs a single, agreed ordering.
That’s the job of blocks. Transactions are batched into a block; blocks are placed in a strict sequence, each one cryptographically linked to the one before it (the chain in “blockchain”). Apply the blocks in order, the transactions inside each block in order, and every node walks the same path from the genesis state to today’s state — and lands on the same world state. Determinism handles each step; block ordering handles the sequence of steps.
Chain valid — every block matches the one before it.
Each block bundles an ordered batch of transactions and links to the previous block. Same blocks, same order ⇒ same world state on every node.
Two nodes both have a deterministic EVM and the exact same set of pending transactions. What else must they share to be guaranteed the same final world state?
The Big Picture
Big picture
The EVM at a glance
- The EVM
- World state
- Accounts + balances
- Contract code + storage
- The save file
- Transaction = state transition
- newState = EVM(oldState, tx)
- Old state in, new state out
- Re-execution & determinism
- Every node re-runs everything
- Same input ⇒ same output
- Redundancy = security
- Bytecode & Turing-complete
- Solidity → bytecode → opcodes
- Can express any computation
- Gas bounds the halt
- World state
In one sentence, what is the EVM?
Check your answer to continue.
Key Takeaways
What to remember
- The EVM is one virtual machine — a computer defined by rules — whose world state is replicated identically across every node. One computer, a thousand copies.
- The world state is every account and its data (balances, contract code, contract storage): the network’s save file.
- A transaction is a state transition:
newState = EVM(oldState, transaction). The EVM is deterministic — same start + same transaction ⇒ the same result everywhere, always. - Every node re-executes every transaction. That redundancy is the security — and it’s why computation must be metered and paid for with gas.
- Contracts are written in Solidity/Vyper, compiled to EVM bytecode (opcodes). The EVM is Turing-complete (it can express any computation) but gas-bounded, so nothing loops forever — unlike intentionally-limited Bitcoin Script.
- Blocks put transactions in an agreed order, so all nodes apply the same changes in the same sequence and converge on the same world state.
We’ve talked a lot about “accounts” holding balances — but how does an account actually work? Ethereum’s answer (the account model) is strikingly different from Bitcoin’s coins-in-a-jar approach (the UTXO model). Next up: accounts vs UTXO, and why Ethereum picked the model it did.