Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

EVM (Ethereum Virtual Machine)

The Ethereum Virtual Machine (EVM) is a deterministic, sandboxed, and Turing-complete virtual machine that executes smart contract bytecode and defines the state transition logic for the Ethereum blockchain and its compatible networks.
Chainscore © 2026
definition
BLOCKCHAIN GLOSSARY

What is EVM (Ethereum Virtual Machine)?

The core computational engine that powers the Ethereum network and compatible blockchains.

The Ethereum Virtual Machine (EVM) is a globally accessible, deterministic, and sandboxed virtual state machine that executes smart contract bytecode on the Ethereum blockchain. It is the runtime environment for all smart contracts and decentralized applications (dApps) on the network, ensuring that code runs exactly as programmed without the possibility of downtime, censorship, or third-party interference. Every node in the Ethereum network runs an EVM instance, which processes and validates transactions, updating the global state of the blockchain in a synchronized manner.

The EVM is fundamentally a stack-based machine that uses a 256-bit word size, which is ideal for cryptographic operations. It operates on a low-level bytecode language, which is typically generated by compiling higher-level languages like Solidity or Vyper. The machine's execution is metered by gas, a unit that measures computational effort; each opcode (e.g., ADD, SSTORE) has a fixed gas cost. This mechanism prevents infinite loops and spam, requiring users to pay transaction fees proportional to the complexity of the computation.

A key feature of the EVM is its deterministic execution. Given the same initial state and transaction input, every EVM will produce the exact same final state, enabling global consensus. Its design is also Turing-complete, meaning it can, in theory, execute any computation given sufficient resources (gas). However, it is isolated in a sandbox, meaning it has no direct access to the host computer's network, filesystem, or other processes, which enhances security.

The EVM's architecture has become a de facto standard, forming the foundation for the EVM-compatible ecosystem. This includes Layer 2 networks (like Arbitrum and Optimism), alternative Layer 1 blockchains (such as Avalanche C-Chain and Polygon PoS), and other environments that can execute Ethereum smart contracts without modification. This compatibility has fostered immense interoperability and allowed developers to deploy dApps across multiple chains using the same tools and codebase.

Understanding the EVM is crucial for developers, as it dictates gas optimization strategies, security considerations (like reentrancy), and the limits of on-chain computation. Analysts and CTOs must grasp its role as the immutable, trustless computer that underpins decentralized finance (DeFi), non-fungible tokens (NFTs), and the broader Web3 infrastructure, making it one of the most significant innovations in blockchain technology.

how-it-works
EXECUTION ENGINE

How the EVM Works: The Execution Cycle

A step-by-step breakdown of the deterministic process by which the Ethereum Virtual Machine processes smart contract transactions, from opcode to state change.

The Ethereum Virtual Machine (EVM) execution cycle is the deterministic process that transforms a transaction's intent into a concrete state change on the Ethereum blockchain. It begins when a validated transaction, containing recipient address, calldata, and value, is passed to the EVM for processing. The EVM loads the associated smart contract bytecode into its memory and initializes a fresh execution context, including the program counter, gas counter, and stack. This cycle is entirely isolated, ensuring that execution cannot affect other processes or the underlying host system.

Execution proceeds opcode by opcode, with each instruction consuming a predefined amount of gas. The EVM is a stack-based machine; most operations pop arguments from the top of the 1024-item stack and push results back onto it. Key phases include: - Memory Expansion: Dynamically allocating volatile memory (MLOAD, MSTORE). - Storage Access: Reading from or writing to persistent contract storage (SLOAD, SSTORE), which is highly gas-intensive. - External Calls: Executing CALL, DELEGATECALL, or STATICCALL to interact with other contracts or transfer Ether, creating nested execution contexts.

The cycle concludes in one of two ways: successful completion or a revert. A successful execution applies all resultant state changes—updated storage, Ether balances, and created logs—to the blockchain's world state. If execution runs out of gas or encounters an invalid instruction (like a division by zero or a failed assertion), it triggers a revert. A revert rolls back all state changes made within that execution context, refunds any remaining gas, and marks the transaction as failed, though the gas used up to the point of failure is still paid to the miner or validator.

key-features
ARCHITECTURE

Key Features of the EVM

The Ethereum Virtual Machine (EVM) is a deterministic, sandboxed runtime environment that executes smart contract bytecode, forming the computational core of the Ethereum network and its compatible blockchains.

01

Deterministic Execution

The EVM guarantees that a smart contract, given the same input and state, will always produce the same output on every node. This determinism is fundamental for consensus, ensuring all network participants agree on the results of transactions and state transitions without requiring trust.

02

Gas & Resource Metering

Every computational step (opcode) in the EVM consumes gas, a unit of measurement for computational work. This system:

  • Prevents infinite loops and denial-of-service attacks by capping execution via a gas limit.
  • Requires users to pay transaction fees (gas fees) proportional to complexity.
  • Decouples the cost of computation from the volatile price of Ether.
03

Stack-Based Architecture

The EVM is a stack machine that uses a last-in, first-out (LIFO) data structure for all computations. It operates with a 256-bit word size (32 bytes), which is ideal for cryptographic operations and Ethereum's 256-bit addresses. Most opcodes pop arguments from and push results onto this stack, making execution efficient and predictable for validators.

04

Sandboxed & Isolated Environment

Smart contracts run in a completely isolated sandbox. They have no direct access to the host system's network, filesystem, or other processes. Contracts can only interact with:

  • The blockchain's own state (storage, balance).
  • The context of the current transaction (msg.sender, msg.value).
  • Other contracts via defined interfaces. This containment is critical for security and stability.
05

State & Storage Model

The EVM manages a global state trie (a Merkle Patricia Tree) that maps addresses to account states. Each account has:

  • Nonce: A transaction counter for EOAs or a creation counter for contracts.
  • Balance: Its Ether holdings.
  • Storage Root: A hash of the contract's persistent storage (a key-value store).
  • Code Hash: The immutable hash of the deployed bytecode. The state is updated after every block.
06

EVM Opcodes & Bytecode

Smart contracts are compiled from high-level languages (like Solidity) into EVM bytecode, a sequence of low-level instructions called opcodes. There are over 140 opcodes (e.g., ADD, SSTORE, CALL) that define the EVM's instruction set. This standardized bytecode is what every Ethereum node executes, ensuring compatibility across the entire network.

etymology-and-specification
DEFINITION

Etymology & Formal Specification

This section provides the formal definition, historical origin, and core technical specification of the Ethereum Virtual Machine (EVM), the deterministic state machine at the heart of Ethereum and many other blockchains.

The Ethereum Virtual Machine (EVM) is a globally accessible, quasi-Turing-complete, sandboxed virtual machine and the core execution environment for smart contracts on the Ethereum blockchain. It is a deterministic state machine, meaning that given an identical starting state and input transaction, it will always produce the same final state. The EVM is not a physical machine but a high-level abstraction defined in Ethereum's formal specification, the Yellow Paper, which details its instruction set, memory model, and gas-based execution model. Its primary function is to compute valid state transitions by processing transactions and executing the bytecode of smart contracts.

The term's etymology is straightforward: Virtual Machine denotes a software-based emulation of a computer system, and Ethereum specifies the blockchain network for which it was originally designed. The concept was formalized by Dr. Gavin Wood in the 2013-2014 Ethereum whitepaper and its subsequent technical specification. The EVM's design was heavily influenced by earlier virtual machines and the concept of a world computer, aiming to provide a secure and isolated environment where untrusted code (smart contracts) could execute with predictable resource costs. Its instruction set architecture is stack-based, similar to early computing models, and it operates on a low-level bytecode compiled from higher-level languages like Solidity.

Formally, the EVM specification defines key components: the execution stack (for temporary data), volatile memory (a byte array for contract execution), and persistent storage (key-value store tied to a contract's address). Every operation, from simple addition to storage writes, has a predefined gas cost to meter computational effort and prevent infinite loops or resource exhaustion attacks. The EVM is isolated, meaning code execution cannot access the network, filesystem, or other processes on the host machine. This sandboxed environment is crucial for security, ensuring that buggy or malicious contracts cannot corrupt the core blockchain client or other contracts beyond their designated scope.

The EVM's architecture is defined to be blockchain-agnostic. While pioneered by Ethereum, its specification has been adopted by numerous other networks, including Polygon, Avalanche C-Chain, and Binance Smart Chain, creating a compatible ecosystem known as the EVM-compatible landscape. This compatibility allows developers to deploy the same contract bytecode and use the same tooling across multiple chains. The formal specification ensures that any client implementation—such as Geth, Erigon, or Nethermind—processes transactions identically, guaranteeing network consensus. The EVM's ongoing evolution, including proposals like EVM Object Format (EOF), aims to improve its efficiency, security, and feature set while maintaining backward compatibility for the vast ecosystem built upon it.

ecosystem-usage
CORE CONCEPT

EVM Ecosystem & Compatibility

The Ethereum Virtual Machine (EVM) is a globally accessible, deterministic state machine that executes smart contract bytecode, forming the foundational runtime environment for the Ethereum network and its compatible chains.

01

What is the EVM?

The Ethereum Virtual Machine (EVM) is a Turing-complete, sandboxed runtime environment that executes smart contract bytecode. It is the core computation engine of Ethereum, ensuring deterministic execution and state transition across all network nodes. Every operation has a defined gas cost, preventing infinite loops and resource exhaustion.

02

EVM Compatibility

An EVM-compatible blockchain is any network that can execute smart contracts compiled to EVM bytecode. This allows developers to deploy existing Solidity contracts and use familiar tools like MetaMask and Hardhat with minimal changes. Major examples include:

  • Layer 2s: Arbitrum, Optimism, Polygon zkEVM
  • Sidechains: Polygon PoS, Gnosis Chain
  • Alt Layer 1s: Avalanche C-Chain, BNB Smart Chain
03

Key Technical Components

The EVM's architecture is defined by several core components:

  • World State: The global state of all accounts and storage.
  • Execution Stack: A LIFO stack for bytecode operations.
  • Memory: Volatile byte array for temporary data during execution.
  • Storage: Persistent key-value store tied to a contract address.
  • Gas & Opcodes: Each computational step (opcode) consumes gas, paid for in the native currency (e.g., ETH).
04

Bytecode & Smart Contracts

Developers write smart contracts in high-level languages like Solidity or Vyper. These are compiled into EVM bytecode, a low-level instruction set the VM executes. The compiled contract creation code deploys a new contract, whose address is derived from the sender's address and nonce. Once deployed, the contract's code is immutable and publicly callable.

05

The Role of Gas

Gas is the unit measuring computational work on the EVM. Every opcode (e.g., ADD, SSTORE) has a fixed gas cost. Users specify a gas limit and gas price for transactions. Gas prevents denial-of-service attacks by making computation expensive and bounds execution time. Unused gas is refunded, while running out triggers an out-of-gas error, reverting state changes.

gas-and-execution-model
BLOCKCHAIN FUNDAMENTALS

Gas & The Execution Model

This section details the computational and economic framework that governs transaction execution on the Ethereum Virtual Machine (EVM) and similar blockchains, focusing on the concepts of gas, opcodes, and state transitions.

The Ethereum Virtual Machine (EVM) is a globally accessible, deterministic, and sandboxed virtual stack machine that executes smart contract bytecode, forming the core execution layer of the Ethereum network. It is the runtime environment where all smart contracts and transactions are processed, ensuring that code execution is isolated from the host computer's operating system and other processes. Every node on the network runs the EVM to validate and execute the same instructions, guaranteeing consensus on the resulting state changes. Its architecture is stack-based, using a 256-bit word size to facilitate cryptographic operations, and it maintains temporary memory and persistent storage for contracts.

Gas is the fundamental unit of computational work required to execute operations on the EVM, acting as a fee mechanism to allocate network resources and prevent infinite loops or spam. Each opcode (e.g., ADD, SSTORE, SHA3) has a predefined gas cost, and the total gas for a transaction is the sum of these costs. Users specify a gas limit (the maximum units they are willing to consume) and a gas price (the amount of ether they will pay per unit). The product of gas used and gas price determines the transaction fee, which is paid to the validator. If execution exhausts the gas limit before completion, all changes are reverted in an "out of gas" error, but the fee is still paid.

The execution model is a deterministic state transition function: Y(S, T) = S'. Given an old global state S and a new set of transactions T, the EVM processes T to produce a new valid state S'. This processing involves validating signatures, checking nonces, deducting upfront gas costs, and then executing the contract code step-by-step. Key components managed during execution include the program counter, stack, memory, and storage. The model ensures that any node replaying the same transactions from the same state will arrive at an identical resulting state, which is critical for network consensus and security.

Understanding gas economics is essential for developers. Writing efficient smart contracts means minimizing expensive operations like writing to storage (SSTORE), using complex cryptographic functions, or creating loops with unbounded iteration. Tools like gas profilers and testnets allow developers to estimate costs before deployment. Furthermore, mechanisms like EIP-1559 introduced a base fee that is burned and a priority fee (tip) for validators, making fee markets more predictable. This economic layer aligns the incentives of users (who want execution), developers (who write efficient code), and validators (who secure the network).

security-considerations
EVM

Security Considerations & Sandbox

The Ethereum Virtual Machine's design introduces specific security paradigms and attack vectors that developers must understand. This section covers critical considerations for building and auditing secure smart contracts.

02

Gas Limits & Loops

EVM execution has a per-transaction gas limit. Unbounded operations can exceed this limit, causing the transaction to revert and fail.

  • Out-of-Gas Risks: Loops over dynamically-sized arrays (e.g., address[]) or complex computations can consume unpredictable gas. A Denial-of-Service (DoS) attack can be mounted by making a loop iterate more times than anticipated.
  • Mitigation: Avoid unbounded loops in state-changing functions. Use pagination, limit array sizes, or shift loop logic off-chain. Consider gas costs for all possible execution paths.
03

Integer Overflow/Underflow

Prior to Solidity 0.8.0, arithmetic operations could wrap around on overflow/underflow without reverting, leading to incorrect logic (e.g., a balance becoming astronomically large).

  • Example: uint8 x = 255; x += 1; would result in x = 0 (overflow).
  • Modern Solution: Solidity 0.8.0+ has built-in checked arithmetic that reverts on overflow/underflow. For unchecked blocks, use libraries like OpenZeppelin's SafeMath (for older versions).
05

DelegateCall & Storage Collisions

The delegatecall opcode executes code from another contract within the context of the caller. This is powerful but dangerous, as it preserves the caller's storage, msg.sender, and msg.value.

  • Risk: If storage layouts between the caller and delegatee contracts are not identical, a storage collision can occur, leading to critical state corruption.
  • Best Practice: Use delegatecall only with extreme care, typically in upgradeable proxy patterns. Ensure strict alignment of storage variable declarations and ordering between contracts.
EXECUTION LAYER COMPARISON

EVM vs. Alternative Execution Environments

A technical comparison of the Ethereum Virtual Machine (EVM) with other major blockchain execution environments, focusing on architectural and developer experience differences.

FeatureEthereum Virtual Machine (EVM)Move VM (Aptos/Sui)CosmWasm (Cosmos)Fuel VM

Execution Model

Stack-based, single-threaded

Register-based, parallelizable

WebAssembly-based, single-threaded

UTXO-based, parallelizable

Smart Contract Language

Solidity, Vyper, Fe

Move

Rust, Go, AssemblyScript

Sway (Rust-like)

State Access

Global shared state

Fine-grained resource objects

Module-scoped key-value store

UTXO state model

Formal Verification

Limited (via external tools)

Native resource semantics

Via Wasm properties & audits

Native in Sway language

Developer Tooling

Extensive (Hardhat, Foundry)

Growing (Move CLI, SDKs)

Mature (CosmJS, Ignite CLI)

Emerging (Forc, Fuel TS SDK)

Cross-Chain Portability

High (via EVM equivalence)

Low (chain-specific Move forks)

High (via IBC & CosmWasm spec)

Planned (via bridging)

Gas Metering

Per-opcode, state-dependent

Per-byte & per-instruction

Wasm instruction metering

Predetermined, static gas costs

Native Account Abstraction

Via EIP-4337 (external)

Native (via Move's signer)

Not native (wallet-level)

Native (predicate/script model)

EVM

Frequently Asked Questions (FAQ)

Essential questions and answers about the Ethereum Virtual Machine, the core runtime environment for smart contracts on Ethereum and compatible blockchains.

The Ethereum Virtual Machine (EVM) is a deterministic, sandboxed runtime environment that executes smart contract bytecode on the Ethereum network. It works as a global, decentralized computer where each network node runs a local instance of the EVM to validate and execute the same instructions. When a transaction triggers a smart contract, the EVM processes the contract's compiled bytecode instruction by instruction, updating the global state (account balances, storage) according to the rules defined by the contract's code. This execution is fueled by gas, a unit of computational work, which prevents infinite loops and allocates network resources fairly. The deterministic nature ensures that all honest nodes arrive at an identical state after processing the same transactions.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team
EVM (Ethereum Virtual Machine) - Definition & Key Features | ChainScore Glossary