Skip to main content

EVM

The Ethereum Virtual Machhine (EVM) functions as a world computer that powers decentralized applications (dApps) running on the Ethereum blockchain.

Every smart contract execution triggers a change to the EVM's state, aka a state transition.

  1. Contract bytecode (compiled from the source code) is loaded from the EVM's storage and executed by peer-to-peer nodes on the EVM. Nodes use the same transaction inputs, which guarantees that each node arrives at the same result (or else they cannot reach consensus).
  2. EVM Opcodes (contained in the bytecode) interact with different parts of the EVM’s state (memory, storage, and stack). Opcodes perform read-write operations—reading (getting) values from state storage and writing (sending) new values to the EVM’s storage.
  3. EVM opcodes perform computation on the values obtained from state storage before returning the new values. This update results in the EVM transitioning to a new state (transactions are called “state transitions” for this reason). This new state is replicated by other nodes and remains until another transaction is executed.

Opcodes & Gas Costs

EVM Codes Playground

Schema