What is Ethereum Virtual Machine (EVM)? Learn about the role EVM plays in the Ethereum network
EVM is an important part of the Ethereum ecosystem and is the decisive foundation for the execution of smart contracts on the Ethereum blockchain network. However, EVM is still facing certain challenges? So what is EVM? Join Coin68 to learn about the Ethereum Virtual Machine and the challenges EVM needs to face through the article below!
What is Ethereum Virtual Machine?
The Ethereum Virtual Machine (EVM), also known as the virtual machine for Ethereum, is a computational engine developed to manage blockchain state and enable integration with smart contracts. Each Ethereum node will have its own EVM integrated to ensure the security of blockchain decentralization.
The EVM is responsible for maintaining the state of the Ethereum blockchain, including the balances of all accounts and the code of all smart contracts. When a transaction is sent to Ethereum, it is executed by EVM on all nodes in the network. EVM ensures that all transactions are performed consistently and that blockchain activity is always up to date.
EVM is an important architecture of Ethereum, allowing the creation of decentralized applications. Dapps are applications that run on the Ethereum blockchain and are not controlled by any organization. Dapps can be used to create a variety of applications, including financial services, games, and social media platforms.
Operating model of EVM
Blockchain and the tokens belonging to that blockchain have fixed rules to help the project manage and operate securely and transparently.
For example: Users cannot spend more tokens than the number of tokens available in the blockchain wallet and cannot generate new tokens themselves.
These rules play a core role for every transaction on many different blockchains.
How EVM Works
Although Ethereum also has its own native token, ETH, and follows almost the same rules, it extends the ability to use a more powerful feature thanks to smart contracts.
To support this feature, Ethereum adopts a more complex method. Instead of just being a distributed ledger, Ethereum is actually a distributed state machine. Ethereum's state not only contains accounts and balances, but is also a computer state that changes with each block, follows set rules, and is capable of executing code. The specific rules for changing state from one block to another are defined by the EVM.
EVM works like a mathematical function: Based on the current state (S) and a set of new valid transactions (T), it creates a new valid state (S'). To describe it more formally, it can be understood that Ethereum has a state transition function as follows:
State
In Ethereum's definition, the state is a giant data structure called the Merkle Patricia Trie. It includes all accounts and balances and can be summarized into a single hash value stored on the blockchain.
Transactions
Transactions are encrypted exchanges from accounts and signed by cryptography. There are two types of transactions: Message sending transactions and contract creation transactions.
The contract creation transaction creates a new contract account containing the smart contract bytecode. When another account sends a message to that contract, it executes the contract's bytecode.
EVM execution process
The EVM execution process is visualized as a stacked computer with 1024 items per process. Each entry is a 256-bit word, designed to conform to the SHA-3-256 hashing scheme.
During execution, the EVM maintains a temporary memory (addressed as a byte array), but this memory does not persist across transactions.
The smart contract can contain 3 Merkle Patricia stores, linked to accounts and part of the global state. The bytecode of the smart contract is executed as EVM opcodes, performing standard stack operations such as XOR, AND, ADD, SUB,...
In addition, EVM also has special opcodes for blockchain, such as ADDRESS, BALANCE, SHA3, BLOCKHASH,...
Challenges of EVM
Current situation
In the current blockchain market, smart contract platforms (Smart Contract Platform) based on Ethereum Virtual Machine (EVM) are accounting for a large portion of the market share. This mainly stems from the fact that EVM blockchains have many advantages that help them attract both users and developers from Ethereum.
Besides, not only Ethereum and Layer 2, but independently developed EVM blockchains such as BNB Chain, Polygon, Avalanche C-Chain and many others have also had strong growth in 2021 and attracted a large number of people. users and total value TVL (Total Value Locked). However, these blockchains are trying to change their consensus mechanism to increase network throughput by 2023. So why is this?
Problem
The important problem is that current EVM blockchains have a major limitation, which is the sequential processing of transactions, which can form a bottleneck. This means that each time a transaction is processed, other transactions have to wait in the mempool (temporary memory), i.e. they are paused until the current transaction is completely processed. This is even the case when those transactions are completely independent of each other.
For example: When one person wants to transfer funds from BNB Chain to Ethereum, another person wants to transfer funds from Polygon to Ethereum, Ethereum's EVM still has to process each transaction and this has created a significant barrier for scalability of these networks.
Consequence
The need to process transactions sequentially is one of the major limitations of blockchains, causing bottlenecks in transaction processing. This results in transactions in blocks taking a long time to complete and increases block generation time. This even limits the number of transactions that can be included in each block. In total, it creates a limitation on the network's scalability.
The consequences of this for users are relatively large, including a significant increase in gas fees, especially during peak times or when major events take place.
A typical example is Ethereum, during peak times, gas fees can reach hundreds of USD. Furthermore, it also leads to nodes having to consume more energy during network operation, creating a significant load.
Summary
Through the above article, Coin68 has provided you with an overview of the Ethereum Virtual Machine and the problems EVM is facing. However, EVM is a virtual machine that validates the state of the network, executes smart contracts, and participates in block creation to facilitate the expansion and growth of the entire ecosystem. EVM marks an important step in building a decentralized future and could change the way we interact and work with data and applications online.