Ethereum Virtual Machine (EVM)
What Is an Ethereum Virtual Machine (EVM)
The Ethereum Virtual Machine (EVM) is a decentralized and consistent computing environment that enables the execution of smart contracts on the Ethereum network. It operates across all Ethereum nodes, ensuring that code runs identically everywhere, contributing to the network’s security and reliability. The EVM uses “gas” as a measure of the computational resources required for operations, ensuring that resources are allocated efficiently and preventing abuse of network capabilities.
Ethereum’s state is more than just a ledger, like in Bitcoin; it functions as a distributed state machine. This state holds all account balances and includes a machine state that can change from block to block according to predefined rules, as defined by the EVM. Transactions on Ethereum are cryptographically signed instructions that either create smart contracts or interact with existing contracts, which execute their bytecode upon being called.
The EVM operates as a stack machine with a 1024-item stack, using 256-bit words, ideal for cryptographic operations. It maintains transient memory during execution, which doesn’t persist between transactions, while contracts store data in a Merkle Patricia trie as part of the global state. The EVM executes smart contract bytecode using a variety of opcodes, including standard operations like ADD and blockchain-specific ones like ADDRESS. Over time, various EVM implementations have been developed in different programming languages, all adhering to the Ethereum Yellowpaper specification.