Understanding Ethereum : Ethereum Virtual Machine (Ethereum 101)
Understanding Ethereum: Ethereum Virtual Machine (Ethereum 101) A Beginner's Guide to the World's Largest Blockchain #ether #ethereum
Welcome to our "Understanding Ethereum" where we delve into the foundational technologies and concepts behind Ethereum. In this installment, titled "Ethereum Virtual Machine (EVM) - Ethereum 101" we aim to demystify the core engine that powers the Ethereum network.
The Ethereum Virtual Machine, or EVM, is often considered the heartbeat of Ethereum. It's a powerful, sandboxed virtual stack embedded within each full Ethereum node, responsible for executing bytecode of smart contracts.
What is the Virtual Machine ?
A virtual machine is a computer file, typically called an image, that behaves like an actual computer.
VMs are often thought of as virtual computers or software-defined computers within physical servers, existing only as code. Virtualization is the process of creating a software-based, or "virtual" version of a computer, with dedicated amounts of CPU, memory, and storage that are "borrowed" from a physical host computer—such as your personal computer— and/or a remote server—such as a server in a cloud provider's datacenter. A virtual machine is a computer file, typically called an image, that behaves like an actual computer. It can run in a window as a separate computing environment, often to run a different operating system—or even to function as the user's entire computer experience—as is common on many people's work computers. The virtual machine is partitioned from the rest of the system, meaning that the software inside a VM can't interfere with the host computer's primary operating system.1
What is the Ethereum Virtual Machine ?
The EVM is the computing platform of Ethereum, kept alive by the Ethereum network and enshrined in the Ethereum blockchain.2 It is Ethereum’s computational engine that handles smart contract execution and deployment. .3
A developer writes the Solidity/Vyper code, which is then compiled into bytecode by solc (Solidity compiler), and the EVM (Ethereum Virtual Machine) executes this bytecode.4

The Ethereum Virtual Machine (EVM) is not only a virtual machine but also a “stack machine” and a “state machine.” 5
A “state machine” is a concept that takes inputs, processes them, and transforms them into a new state based on those inputs. In the case of the EVM, it reads inputs and updates the state of the Ethereum network accordingly.

The EVM is also referred to as a “stack machine” because it organizes its memory structure using a stack. A stack is a data structure where items are added or removed from the top. The EVM accesses and manipulates data in the memory using this stack-based approach.
First of all, you should keep this information in mind. EVM Stack works with LIFO method. Last in First out.6
For example, We add first “2” value to the system and add “3” value and add “4” value.
“4" will be first value which is executing by Stack.
Let’s say; respectively
PUSH1 2
PUSH1 3
PUSH1 4
values to EVM. Please try to execute it from here. Play and execute it.

Now let’s look at the reflection of the values we send on the stack. We sent lastly “4” value. You see that “4” value will be the top of the stack.
This is LIFO !
If we send an addition operation with ADD opcode after these values, the stack adds the last two variables.
4+3=7
and the stack image looks like this.
This is veridelisi representation!
At the macro level, the Ethereum Virtual Machine (EVM) is composed of three main components: the world state, machine state, and a virtual Read-Only Memory (ROM)7.
World State: The world state in EVM represents the entire state of the Ethereum network at a given point in time. It's a record of all accounts, their balances, and their storage.
Machine State: The machine state refers to the state of an individual execution of a smart contract. It includes the program counter, the stack, memory, and the storage. The machine state changes with each instruction executed by the EVM.
Virtual ROM: The virtual ROM houses the immutable code of the smart contract being executed. This is the compiled bytecode of the contract, which the EVM reads and executes.8
Engin YILMAZ (
)