Ethereum Virtual Machine (EVM) | ethereum.org (2024)

O

Last edit: @Otto-AA(opens in a new tab), June 21, 2024

The Ethereum Virtual Machine (EVM) is a decentralized virtual environment that executes code consistently and securely across all Ethereum nodes. Nodes run the EVM to execute smart contracts, using "gas" to measure the computational effort required for operations, ensuring efficient resource allocation and network security.

Prerequisites

Some basic familiarity with common terminology in computer science such as bytes(opens in a new tab), memory(opens in a new tab), and a stack(opens in a new tab) are necessary to understand the EVM. It would also be helpful to be comfortable with cryptography/blockchain concepts like hash functions(opens in a new tab) and the Merkle tree(opens in a new tab).

From ledger to state machine

The analogy of a 'distributed ledger' is often used to describe blockchains like Bitcoin, which enable a decentralized currency using fundamental tools of cryptography. The ledger maintains a record of activity which must adhere to a set of rules that govern what someone can and cannot do to modify the ledger. For example, a Bitcoin address cannot spend more Bitcoin than it has previously received. These rules underpin all transactions on Bitcoin and many other blockchains.

While Ethereum has its own native cryptocurrency (Ether) that follows almost exactly the same intuitive rules, it also enables a much more powerful function: smart contracts. For this more complex feature, a more sophisticated analogy is required. Instead of a distributed ledger, Ethereum is a distributed state machine(opens in a new tab). Ethereum's state is a large data structure which holds not only all accounts and balances, but a machine state, which can change from block to block according to a pre-defined set of rules, and which can execute arbitrary machine code. The specific rules of changing state from block to block are defined by the EVM.

Diagram adapted from Ethereum EVM illustrated(opens in a new tab)

The Ethereum state transition function

The EVM behaves as a mathematical function would: Given an input, it produces a deterministic output. It therefore is quite helpful to more formally describe Ethereum as having a state transition function:

1

Y(S, T)= S'

Given an old valid state (S) and a new set of valid transactions (T), the Ethereum state transition function Y(S, T) produces a new valid output state S'

State

In the context of Ethereum, the state is an enormous data structure called a modified Merkle Patricia Trie, which keeps all accounts linked by hashes and reducible to a single root hash stored on the blockchain.

Transactions

Transactions are cryptographically signed instructions from accounts. There are two types of transactions: those which result in message calls and those which result in contract creation.

Contract creation results in the creation of a new contract account containing compiled smart contract bytecode. Whenever another account makes a message call to that contract, it executes its bytecode.

EVM instructions

The EVM executes as a stack machine(opens in a new tab) with a depth of 1024 items. Each item is a 256-bit word, which was chosen for the ease of use with 256-bit cryptography (such as Keccak-256 hashes or secp256k1 signatures).

During execution, the EVM maintains a transient memory (as a word-addressed byte array), which does not persist between transactions.

Contracts, however, do contain a Merkle Patricia storage trie (as a word-addressable word array), associated with the account in question and part of the global state.

Compiled smart contract bytecode executes as a number of EVM opcodes, which perform standard stack operations like XOR, AND, ADD, SUB, etc. The EVM also implements a number of blockchain-specific stack operations, such as ADDRESS, BALANCE, BLOCKHASH, etc.

Diagrams adapted from Ethereum EVM illustrated(opens in a new tab)

EVM implementations

All implementations of the EVM must adhere to the specification described in the Ethereum Yellowpaper.

Over Ethereum's nine year history, the EVM has undergone several revisions, and there are several implementations of the EVM in various programming languages.

Ethereum execution clients include an EVM implementation. Additionally, there are multiple standalone implementations, including:

Further Reading

  • Gas
back-to-top ↑

Was this article helpful?

Ethereum Virtual Machine (EVM) | ethereum.org (2024)

FAQs

Is Ethereum virtual machine EVM-compatible? ›

EVM provides a secure and reliable platform for executing smart contracts, enabling the creation of a wide range of dApps and tokens on the Ethereum blockchain. Its compatibility with other blockchains allows developers to leverage the existing Ethereum ecosystem.

What powers the Ethereum virtual machine answer? ›

In summary, gas is the fuel that powers the Ethereum Virtual Machine (EVM). It is used to pay for the execution of smart contracts and other operations on the Ethereum network.

What are the disadvantages of Ethereum virtual machine? ›

Drawbacks of EVM
  • If the owners of these services discontinue using Ethereum, the nodes will stop doing any function, thereby crumbling the entire network.
  • Using an EVM requires certain technical proficiency. Hence, it is limited to those who do not know to code.
Jun 8, 2024

How does EVM work in Ethereum? ›

EVM executes bytecode, a set of instructions generated by compiling smart contracts. This ensures consistency across all nodes in the Ethereum network, as each node independently processes and verifies transactions. Gas, a transaction fee, is used to allocate resources and prevent abuse, maintaining network integrity.

What are the alternatives to Ethereum EVM? ›

Competitors and Alternatives to Ethereum
  • IBM Blockchain.
  • Ripple.
  • Microsoft Azure Blockchain.
  • Tangle.
  • Bitcoin.
  • Blockstream.

What is the fastest EVM compatible blockchain? ›

Solana a non-EVM blockchain takes the first spot as the fastest blockchain followed by Sui another non-EVM blockchain, going by this list the fastest EVM-compatible blockchain is BNB Smart Chain (BSC). See: What is an Ethereum Virtual Machine (EVM)?

Is EVM Turing-complete? ›

A unique aspect of the EVM is its Turing completeness. This means the EVM can theoretically execute any computation, given enough resources, which opens up endless possibilities for application development.

Is MetaMask an EVM wallet? ›

MetaMask is natively Ethereum which means it supports EVM networks like Ethereum Mainnet, L2s like Linea and Optimism, and even Polygon. Now, with Snaps, you can connect to non-EVM networks like Starknet and Solana, and even manage Bitcoin with your MetaMask wallet.

Is Hedera EVM compatible? ›

The Hedera Smart Contract service is EVM compatible to run Solidity, unchanged, on the Hedera network. Use the most ubiquitous web3 tooling, libraries, and environments, such as Ethers, HardHat, Foundry, Truffle, and more, that utilize JSON-RPC.

Why not to use virtual machines? ›

The disadvantages of virtual machines in cloud computing include the cost of cloud hosting platforms. Security Risks: Although VMs are more secure than traditional physical servers, they still come with security risks, such as malware and malicious attacks within the virtual environment.

What is the weakness of Ethereum? ›

Ethereum Weaknesses

It is constantly evolving nad updating, with 8+ years of roadmap ahead of it. Current scaling issues and rollup fragmentation limit the ability of dApps and other projects to grow and create satisfying user experiences.

Can a virtual machine fail? ›

Virtual machine may become unresponsive when the hard disk runs out of space. Guest Operating system on the Virtual machine may cause VM to appear unresponsive. The virtual machine disk controllers not set as per best practices.

Why is it difficult to use EVM? ›

Without the necessary level of detail in collecting planned and actual expenses, Earned Value Management effectiveness becomes severely compromised. The AATT Project found that the level of information gained did not justify the workload placed on the task leads and/or PIs or the AATT Systems Management staff.

Is EVM worth the effort? ›

Without EVM, you may think your project is running smoothly, only to realize later that you've burned through most of your budget or the work isn't meeting expectations. One advantage of earned value management is that it helps you catch these issues early so you can correct them before they spiral out of control.

What language does Ethereum use for EVM? ›

Solidity is a statically typed programming language designed for developing smart contracts that run on the Ethereum Virtual Machine (EVM) or compatible virtual machines.

Which crypto is EVM compatible? ›

EVM compatibility goes a long way in addressing this problem, as proven by the growth of EVM-compatible blockchains such as BNB Smart Chain (BSC), Avalanche, Polygon, and many others.

What blockchains are EVM enabled? ›

EVM compatible blockchains or EVM compatibility refers to the ability for a blockchain to run the EVM and execute Ethereum smart contracts. This means that developers can write & deploy the same smart contracts across multiple EVM blockchains, without needing to make significant changes to their code.

What is EVM virtual machine? ›

The Ethereum Virtual Machine (EVM) is a decentralized computation engine that executes smart contracts on the Ethereum network. EVM is not exclusive to Ethereum; it is also used by other blockchains like Polygon, Arbitrum, and Avalanche.

Is Hyperledger EVM compatible? ›

Hyperledger Besu is an Ethereum client designed to be enterprise-friendly for both public and private permissioned network use cases, with an extractable EVM implementation. It can also be run on test networks such as Sepolia and Görli.

Top Articles
Monthly Payment on a $100,000 Student Loan
Student Loan Calculator
Nullreferenceexception 7 Days To Die
Cranes For Sale in United States| IronPlanet
Rubratings Tampa
Online Reading Resources for Students & Teachers | Raz-Kids
Gw2 Legendary Amulet
Jesse Mckinzie Auctioneer
Locate Td Bank Near Me
Restaurants Near Paramount Theater Cedar Rapids
7 Fly Traps For Effective Pest Control
History of Osceola County
Overton Funeral Home Waterloo Iowa
Mflwer
Richland Ecampus
Accuweather Mold Count
Everything you need to know about Costco Travel (and why I love it) - The Points Guy
Publix Super Market At Rainbow Square Shopping Center Dunnellon Photos
Crawlers List Chicago
Pearson Correlation Coefficient
[PDF] NAVY RESERVE PERSONNEL MANUAL - Free Download PDF
Foolproof Module 6 Test Answers
Die 8 Rollen einer Führungskraft
4 Methods to Fix “Vortex Mods Cannot Be Deployed” Issue - MiniTool Partition Wizard
Enduring Word John 15
Stickley Furniture
Core Relief Texas
Rek Funerals
Revelry Room Seattle
Chadrad Swap Shop
The 50 Best Albums of 2023
Space Marine 2 Error Code 4: Connection Lost [Solved]
The Complete Guide To The Infamous "imskirby Incident"
Raisya Crow on LinkedIn: Breckie Hill Shower Video viral Cucumber Leaks VIDEO Click to watch full…
Aliciabibs
Rage Of Harrogath Bugged
Walgreens Agrees to Pay $106.8M to Resolve Allegations It Billed the Government for Prescriptions Never Dispensed
877-292-0545
Academy Sports New Bern Nc Coupons
What Is A K 56 Pink Pill?
Pokemon Reborn Gyms
The power of the NFL, its data, and the shift to CTV
What to Do at The 2024 Charlotte International Arts Festival | Queen City Nerve
Costner-Maloy Funeral Home Obituaries
De boeken van Val McDermid op volgorde
Strange World Showtimes Near Atlas Cinemas Great Lakes Stadium 16
Estes4Me Payroll
Anthony Weary Obituary Erie Pa
Comenity/Banter
Varsity Competition Results 2022
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 5800

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.