June 23, 2022 - 7 min read
The Ethereum Virtual Machine (EVM) is a sandbox-style runtime environment and deterministic computation engine in which smart contracts are deployed on Ethereum. The term virtual machine is used since the EVM is an emulation of a real computer, with the EVM consisting of the collective abstractions of computation and storage of all Ethereum’s nodes. From a bird’s eye view, the EVM running can be thought of as a decentralized, global computer which contains millions of executable objects, each with its own on-chain data store.
The EVM has no physical shape, and also operates in a more limited domain than other computers. It simply defines and enforces the rules for computing smart contract transactions, reads and records the canonical state of Ethereum’s blockchain, and processes the bytecode of incoming smart contract requests. Thus, the EVM is the foundation of Ethereum’s operational structure.
Ethereum isn’t simply a distributed ledger, as is the case with Bitcoin. It is a distributed state machine. That is, Ethereum’s blockchain state at any given moment is a large data structure holding all accounts and balances held within a modified Merkle Patricia Tree.
This means that users can develop and upload complex smart contracts that are automatically enforced when their defined criteria are met. Following the execution of the smart contracts, they are bundled into the next block with many other transactions, and Ethereum’s new state is updated.
Each Ethereum node contributes to the EVM as they are responsible for executing smart contract bytecode. It is simplest to think of the EVM as enforcing the deterministic smart contracts, capturing snapshots of Ethereum’s state, and also performing the transition from one valid state to the next.
As it’s a decentralized, consensus-based computational machine, the EVM is often characterized as a quasi-Turing-complete world computer. That is, the moniker ‘quasi’ is used since the EVM is able to halt execution after a predefined amount of gas has been spent. Without gas fees limiting the EVM’s computations, it is at risk of running into the halting problem, a state where the EVM executes a program that never stops, like with denial-of-service (DoS) attacks.
Ethereum’s Turing Completeness allows it the potential for backwards and forwards compatibility and the capability to implement any smart contract, even those that have not yet been developed. This holds incredible potential, but makes Ethereum less predictable than Bitcoin’s network, for example.
For Ethereum smart contracts to be executed properly, it must be verified that prior conditions have been met. Every Ethereum node runs an EVM instance which allows them to all use the same standards for implementing smart contracts on the network so long as the bytecode is compatible with those standards. For example, ERC-20 is the standard for token compatibility while ERC-721 is the standard by which non-fungible tokens (NFTs) are implemented.
Some smart contracts involve more complex conditionality, requiring inputs from external data sources, called hybrid smart contracts. Oracles fetch and validate external data for hybrid smart contracts, enabling a variety of novel use cases aside from transacting on Ethereum’s blockchain. Other smart contracts simply request transactions between two parties, while still more call upon or otherwise are determined by other smart contracts within Ethereum’s infrastructure.
So, the EVM tracks the current state of Ethereum’s blockchain and executes the smart contracts by reaching consensus amongst the nodes running it in order to add all of the new transactions and take a snapshot of each subsequent state of the blockchain.
In practice, this means that when users enter into smart contracts with one another, the EVM is the engine that facilitates and records subsequent transfers of value in a totally decentralized manner. As smart contract conditions are met and their execution is complete, the EVM ensures that the new, current state is accurate through its nodes reaching consensus and producing the next block.
Through a VM, developers and network participants can build, process, and execute smart contracts however they want without permission from the network. They simply need to upload code which is compatible with the EVM’s standards. Thus, the EVM acts as a global processor for the Ethereum blockchain, with all of its accumulated computing power at the disposal of developers.
This is attractive for developers and users alike since the network is so powerful, yet permissionless to use. Never before have so many open-source computer software experimentations been conducted, and so we may expect never-seen-before outcomes with regards to innovation.
Unsurprisingly, many Web3 protocols have sought to join forces with Ethereum to leverage the EVM’s infrastructure, developer tools, and its broader network effects. For instance, Layer 2 scaling solutions like Arbitrum, Optimism, and Polygon have all benefited from the EVM’s permissionless compatibility.
Some have even argued that Polygon has become its own Layer 1 more recently thanks to the attention it got as an Ethereum L2. Some L1 blockchains with EVM-compatibility include Fantom’s Opera, Kusama’s Moon River, Avalanche’s C-Chain, Near Protocol’s Aurora, Cosmos’s Evmos, and Binance’s Smart Chain, just to name a few.
The EVM is an ecosystem which has given rise to a decentralized economy taking on a life of its own. Through gas incentives and permissionless P2P smart contract functionality, it sure seems it is living up to its moniker as “world computer.” Though its scalability is still in question, made obvious by outrageous gas fees, the protocol’s gas system nevertheless guarantees that fees are paid before making a request of its Mainnet, thus protecting the integrity of the system and adequately rewarding its honest participants.
By simply understanding the EVM, readers are already well on their way to more effectively taking part in Ethereum’s ecosystem as a consumer, miner, node validator, investor, developer, entrepreneur, or creator. Developers can use their creativity by writing code in a number of programming languages, and building dApps that fulfill use cases for enterprises and retail users alike.
The key to the EVM’s success is the low barrier for entry, massive network of developers and users, and its composability. That is, developers and users can build decentralized versions of any business model in which it would increase the security or user experience, and share it with the world. The opportunities for greatness are out there, and now it’s time for innovative developers and organizations to reach out and take them.
Get news, insights, and more.
Sign up for the SupraOracles newsletter for company news, industry insights, and more. You’ll also be the first to know when we come out of stealth mode.