Ethereum Virtual Machine (EVM): A Technical Overview

Ata Tekeli
Dev Genius
Published in
4 min readOct 16, 2022

--

The main powerhouse of the blockchain ecosystem and the preferred infrastructure for many networks.

What is Ethereum Virtual Machine?

Ethereum Virtual Machine (EVM) is a protocol responsible for executing smart contracts and computing the state of the Ethereum network. It sits on top of Ethereum’s hardware and node network layer, it runs and debugs smart contracts that can be readable by computers. Initially developed for Ethereum, many chains became EVM-compatible.

What are the attributes of the EVM?

Turing Completeness

Turing completeness defines when computers are conditioned to solve problems and compute data. It was hypothesized by Alan Turing when he thought what machines’ capabilities and they can’t think or process information like human beings.

Distributed State Machine

Ethereum is not just a ledger that keeps all the records. According to its whitepaper, it is initially designed for smart contracts and applications to be built. While it also acts as a ledger, an entire machine state is held. The contracts are programmed with Solidity and mimic human communication and are more expressive than most programming languages.

Smart Contracts

Smart contracts are agreements between parties that are written in code. They’re self-executing; removing third parties and functions without the need for trust. While these transactions are irreversible, still they’re yet to be legally compliant. To make the concept clear, let’s give an example; suppose that you want to buy water from a vending machine. First, you write the number and then you pay the price. If the amount is insufficient, the machine asks you for more funds and if the funds are more than the price, it gives you the water and the change back. After you make the transaction, you can’t take the transaction back and you have the water. But there’s a catch, the transaction is not recorded on the vending machine, but smart contracts are recorded on the blockchain, making it provable.

Deterministic

EVM provides the same output to the same set of inputs. Considering DeFi applications where large volumes of financial transactions occur, it is instrumental to know how the code will react when executed. Therefore, determinism is an important factor in EVM.

Isolated

Smart contracts run in isolated environments, making Ethereum resilient against technical problems independent of applications. It may contain attacks, bugs, and other issues so that the chain works properly.

Terminable

Ethereum uses gas to compute operations. These operations consume gas and a limit is enforced so that applications can be built efficiently. For smart contracts to work, developers should pay attention to these limits and if the amount of gas for the operation exceeds the limit, the machine stops operations or halts its processing.

How does EVM work?

Before we go down how EVM works, let’s look at what a virtual machine is. Virtual machines require CPU, memory, and storage, but they only operate computer code. In theory, they can be run by anyone, allowing flexibility and portability for decentralized networks.

Similar to how other VMs work, EVM is a decentralized nodal network to execute smart contracts embedded in the Ethereum node to execute EVM-compatible smart contracts. It requires smart contracts, nodes, opcode, and gas.

As we mentioned smart contracts in attributes, let’s mention how the rest of these functions perform:

Nodes

Nodes are simply computers on blockchain networks and they have a copy of the blockchain. In Ethereum, all nodes must agree with the next one to execute the same instructions, making it Turing Complete. Each instruction has a cost assigned to it and has an economy based on smart contracts and the costs associated with them, making them responsible for a large economy.

Opcodes

Opcodes are easily creatable by developers. While they’re not directly involved with the EVM, all programs in Ethereum are written in Solidity. Each one of them is assigned one byte and the limit is 256 opcodes.

Gas

Gas is the fuel of the Ethereum Virtual Machine. When a transaction is made, users have to pay a transaction fee. Similarly, developers pay gas fees to deploy their contracts, which is the sum of all the instructions written in smart contracts. Because contracts consume extensive amounts of gas, it helps the network withstand and prevent DDoS attacks and keep the network secure.

Which blockchains are EVM compatible?

Ethereum, Avalanche, Fantom Opera Chain, BNB Chain, Aurora, Polygon, Cardano’s Mikomeda Sidechain, Harmony, Arbitrum, and Optimism.

What do you think about EVM? Have you ever heard about EVM? Have you ever used EVM networks? Which EVM networks you’ve heard of? Share your thoughts and experiences in the comments section below.

--

--