The EVM, or Ethereum Virtual Machine, is the shared computer that runs smart contracts on Ethereum. Every node runs the same EVM code on the same inputs and gets the same result, which is how thousands of computers agree on the state of every account and contract. So many other chains copy it because copying the EVM means inheriting Ethereum's developers, tools, wallets and code, which no newer design can match.
What does the EVM actually do?
The EVM takes the current state of the blockchain, applies a transaction, and produces the new state. That's all a blockchain's execution layer needs to do.
Ethereum's documentation describes this as a function: given a valid state and a set of valid transactions, it outputs a new valid state. The state is every account's balance plus every contract's code and stored data. A smart contract is a program stored in that state, waiting to be called.
The key property is determinism. Every node, anywhere in the world, must reach exactly the same answer from the same inputs. That rules out anything unpredictable. A contract can't fetch a web page, read the clock on the node's computer, or generate a truly random number by itself.
"Virtual machine" means the EVM is a specification, not a physical chip. Each Ethereum node runs software that imitates this imaginary computer, and there are several independent implementations. Ethereum.org lists versions written in Python, C++, JavaScript and Rust.
How does the EVM run code?
The EVM is a stack machine. Instead of named variables, it works with a pile of values where the last item added is the first one used. According to ethereum.org, the stack holds up to 1,024 items, and each item is a 256-bit word. That unusually large size suits the 256-bit numbers used in Ethereum's hash functions and cryptography.
A contract has three main places to keep data while it runs:
| Area | Lasts for | Cost | Typical use |
|---|---|---|---|
| Stack | One step at a time | Very cheap | Values being worked on right now |
| Memory | One transaction, then cleared | Cheap, grows with size | Temporary data, such as building a return value |
| Storage | Permanently, in the blockchain's state | Expensive | Balances, ownership records, settings |
A fourth area, transient storage, lasts for one transaction and is shared across calls within it. It arrived in the Dencun upgrade of March 2024 through EIP-1153.
What are bytecode and opcodes?
Developers write contracts in a high-level language, most often Solidity. A compiler turns that into bytecode, a string of bytes the EVM executes. Each instruction in it is an opcode, a one-byte command such as "add" or "store."
Here is a tiny piece of bytecode, 0x6002600301, read step by step using ethereum.org's opcode table:
60 02isPUSH1 2. Put the number 2 on the stack. Cost: 3 gas.60 03isPUSH1 3. Put 3 on top of it. Cost: 3 gas.01isADD. Take the top two items, add them, and push the result, 5. Cost: 3 gas.
That's 9 gas of work. Real contracts are thousands of bytes long, but they are built from the same kind of steps. Other opcodes are specific to blockchains. CALLER returns the address that called the contract, and SLOAD and SSTORE read and write storage.
Because the bytecode is public, anyone can inspect what a contract really does. That's what a block explorer shows when it displays a contract's code, and why verified source code matters.
Why does the EVM charge gas?
Gas is the EVM's unit of computational work. Every opcode has a gas cost, and every transaction sets a limit on how much gas it may use.
Gas solves a hard problem. The EVM can run loops, so a contract could in principle run forever. No one can reliably predict in advance whether any program will finish, so the EVM doesn't try. It meters every step instead. If a transaction runs out of gas, execution stops and its changes are undone, but the fee for the work done is still paid. That makes an infinite loop expensive for its author rather than for the network.
Costs reflect the long-term burden on nodes as well as processor time. Adding two numbers costs 3 gas. Writing a non-zero value to a storage slot that was empty costs 20,000 gas, plus 2,100 more if the slot hasn't been touched yet in that transaction. That's more than 7,000 times the cost of an addition, because every node must keep that data indefinitely.
What you pay in ETH is gas used multiplied by the price per unit of gas, which is set by demand for block space. Our guide to gas fees explains how that price is set.
What does "EVM-compatible" mean?
A chain is EVM-compatible if contracts written for Ethereum can run on it with few or no changes. But compatibility comes in degrees, and the differences matter to developers.
Vitalik Buterin's 2022 classification of zkEVMs gives useful vocabulary that also applies more widely:
| Level | What matches Ethereum | What can differ |
|---|---|---|
| Ethereum-equivalent | Everything, including block and state structures | Nothing |
| EVM-equivalent | Contract behavior "from within" | Block format, state tree and other outside structures |
| EVM-equivalent except gas | Contract behavior | Gas costs of some operations |
| Almost EVM-equivalent | Most behavior | Some features, such as certain precompiles, are dropped or changed |
| Language-equivalent | Solidity or Vyper source code | The bytecode itself, which is compiled to a different machine |
The further down the table a chain sits, the more likely something breaks. A contract may deploy to a different address, a gas-dependent check may fail, or a debugging tool may misread the results. "EVM-compatible" in marketing can mean any of these rows, so developers check the chain's own list of differences before deploying.
Which chains use the EVM?
Many of the largest smart contract platforms run the EVM or a close variant:
- Ethereum's layer 2s. Most rollups, including Base and Arbitrum, execute EVM transactions and post the data to Ethereum.
- Independent layer 1s. Avalanche's C-Chain is, in Avalanche's own words, "an implementation of the Ethereum Virtual Machine," and supports contracts written in Solidity.
- New high-performance chains. Monad claims "full EVM bytecode compatibility" while running transactions in parallel, an idea we cover in what a parallel EVM is.
- Zero-knowledge rollups. These prove EVM execution with cryptography, which is why the different types of zkEVM exist.
Not every chain copies it. Solana built its own runtime designed to execute transactions in parallel. Aptos and Sui use the Move language, which treats assets as resources that can't be copied by mistake.
Why do so many chains copy the EVM?
The EVM isn't copied because it's the fastest or most elegant design. It's copied because of the network effects around it.
- Developers. A chain that runs the EVM can hire from the largest pool of smart contract developers, who already know Solidity.
- Tools. Compilers, testing frameworks, debuggers, block explorers and code libraries work with little or no change.
- Wallets. Ethereum-style accounts and addresses work across EVM chains. One private key controls the same address on each, and a wallet such as MetaMask can add a new EVM chain as a network setting.
- Code that's already been tested. Token standards and DeFi protocols can be redeployed. Their logic has already survived years of real use, though each new deployment still needs its own settings checked.
- Liquidity and users. Bridges, exchanges and stablecoin issuers already support EVM tokens, so a new EVM chain can plug in faster.
For a new chain, these advantages usually outweigh the EVM's known drawbacks. A different design must persuade developers to learn a new language and rebuild their tools before users can arrive.
What are the EVM's weaknesses?
Copying the EVM also copies its problems:
- Sequential execution. The original EVM processes transactions one after another, which limits speed. Parallel EVM projects try to fix this without breaking compatibility.
- Expensive storage. Storing data is costly by design, which pushes developers toward complex workarounds.
- Old design choices. The 256-bit word is four times the width of a typical 64-bit processor's, so even simple arithmetic takes extra work.
- Shared bugs. A coding mistake in a contract, or a security issue in a popular library, can spread to every chain where that code was deployed.
- Same-address confusion. The same address on different chains can hold different assets, so sending tokens on the wrong network is an easy mistake. Watch for signing risks too, because the approvals wallet drainers abuse work the same way on every EVM chain.
Ethereum keeps changing the EVM through upgrades. Dencun, for example, added opcodes for transient storage and copying memory. Every EVM chain then decides whether and when to follow, which is one reason "compatible" chains drift apart over time.
For more on this topic, see our smart contracts coverage and the Ethereum hub.
Key takeaways
- The EVM is a deterministic virtual computer that every Ethereum node runs, so all nodes agree on the result of every transaction.
- It's a stack machine with 256-bit words that executes one-byte opcodes from compiled bytecode.
- Gas meters every step, which stops runaway programs and makes storage far more expensive than computation.
- "EVM-compatible" covers a range, from fully Ethereum-equivalent to chains that only accept the same source code.
- Chains copy the EVM mainly for its developers, tools, wallets and battle-tested code, not because it's the most efficient design.
Sources
Get the weekly commit
New blockchain deep dives every week.

