Read

Edit

History

Notify

Share

Ethereum Virtual Machine (EVM)

Ethereum Virtual Machine(EVM) is a decentralized computation engine that executes on the network. EVM ensures that code within smart contracts runs exactly as intended by enforcing rules and maintaining consistency across the network. EVM is a special state machine that operates continuously and whose immutable operations determine the state of each block in the Ethereum [1][2]

Overview

A virtual machine(VM), as the name indicates, is related to the virtualization of the actual computer. The EVM blockchain is designed to be the infrastructure for smart contracts based on Ethereum. Initially, built to avoid the attacks that pose a grave threat to the crypto space. [3]

Conceptualized in 2013 by programmer , the Ethereum network owes its success as the preferred blockchain for developers to the Ethereum Virtual Machine (EVM) that was designed by during his tenure at . Written in C++ and using the LLVM Project compiler, EVM is a special state machine that operates continuously and whose immutable operations determine the state of each block in the Ethereum [1]

The Ethereum Virtual Machine (EVM) is a fundamental component of the Ethereum network. EVM is the core feature that makes Ethereum more than a “” like . Forming the backbone of the Ethereum Blockchain, EVM provides developers with a run-time environment to build DApps and other applications. EVM allows Ethereum to be a “distributed state machine,” and it’s the solution that enables developers to create and in the Solidity programming language.[1][4]


EVM has access to all nodes in the network, handles smart contracts execution and effectively handles all transactions on the Ethereum blockchain without any major downtime reported. For developers, the EVM acts as the overarching program that runs smaller executable programs which are known as smart contracts in Ethereum, while providing them the freedom to write these smart contracts in a variety of programming languages including Solidity, Vyper, Python and Yul, among others.[1]

Elements of EVM

Opcodes

EVM opcodes assist EVM in executing specific tasks of or transactions. Aiming for efficiency, EVM converts its bytecode to opcode, where each opcode is assigned one byte in bytecode. Each opcode operation requires a certain amount of gas toptimizeduted by the EVM.[4]

Smart Contracts

Every time a smart contract gets executed, the EVM computes the new state of the Ethereum network, updating the account balances, data storage of smart contracts, and transactions on the account and contract levels. All these functions are what live inside of the called state.
EVM is the environment where these smart contracts could live and interact with each other, where EVM combines the resources of thousands of CPUs connected to the Ethereum network. EVM cannot directly execute Solidity, so the code is compiled to machine instructions called opcodes, and gas is needed to use opcodes.[4][8]

Gas

The main objective of gas is to act as the fee for computing the operations of a smart contract done by each node in the Ethereum network. The computation fees prevent an attacker from deploying many complex contracts that will require long computation times to halt the network. These fees make this type of ) attack too expensive to be executed.

Gas also serves as compensation for responsible for guaranteeing that the information in the transactions is valid. When network activity is high, people will raise their gas limit to get their transaction executed and validated. This way, validators will choose from the mempool the transactions with higher gas limits.[4]

How EVM works


Virtual machines are essentially creating a level of abstraction between the executing code and the executing machine. This layer is needed to improve the portability of software, as well as to make sure applications are separated from each other, and separated from their host.

Smart contract languages like Solidity cannot be executed by the EVM directly. Instead, they are compiled to low-level machine instructions called opcodes. These opcodes allow the EVM to be Turing-complete. This means the EVM is able to compute (almost) anything, given enough resources. Because opcodes are 1 byte, there can only be a maximum of 256 (16²) opcodes.
wikiIn order to efficiently store opcodes, they are encoded to bytecode. Every opcode is allocated a byte. During execution, bytecode is split up into its bytes (1 byte equals 2 hexadecimal characters).
wikiEVM uses a 256-bit register stack from which the most recent 16 items can be accessed or manipulated at once. In total, the stack can only hold 1024 items. Because of these limitations, complicated opcodes instead use contract memory to retrieve or pass data. However, memory is not persistent. When contract execution finishes, the memory contents will not be saved. Thus, while stack can be compared to function arguments, memory can be compared to declaring variables.
In order to store data indefinitely and make it accessible for future contract executions, one can use storage.

Since all contract executions are run by everyone running an Ethereum node, an attacker could try creating contracts including lots of computationally expensive operations to slow down the network. To prevent such attacks from happening, every opcode has its own base gas cost.

At the end of this bytecode, a Swarm hash of a metadata file created by Solidity gets appended. Swarm is a distributed storage platform and content distribution service, or, more simply stated: a decentralized file storage. The metadata file contains various information about the contract, such as the compiler version or the contract’s functions. Unfortunately, this is an experimental feature, and not many contracts have publicly uploaded their metadata to the Swarm network.[1][3][5][6]

Use cases

ERC-20

 are tokens that can be sent between addresses and have a fixed amount, and their values are the same across the Ethereum network. that follow a specified data structure on the EVM are used to create these tokens. The data structure is responsible for controlling the naming, distributions, supply amount, and monitoring of the token.[4][7]

Decentraliezd Exchanges (DEX)

deploy smart contracts to users to exchange their tokens. The main innovation behind DEXs is a solution called that allows users to contribute to of specific tokens without the need for a centraliezd agent controlling it.[4][7]

ERC-721

is smart contracts that are used to , like ERC-20 tokens; ERC-721 has unique value across the . These smart contracts are optimized to create unique artworks and provide property rights to the original art piece.[4]

ERC-1155

 is a standard for smart contracts that manage multiple token types. A deployed smart contract may include any combination of fungible, or other configurations.[4][7]

DAOs

governs the EVM. Basically, a DAO is a community project without a central authority, giving the members total control of the project. Besides being autonomous, DAOs are transparent. Smart contracts stipulate the guidelines and implement policies based on the coded instructions. Since DAO activities are accessible, verifiable, and open to public audit, the participants can learn how the protocol runs. [7]

Virtual Machines for other blockchains

Other chains, besides Ethereum, also offer their virtual machines. Some examples are the Virtual Machine (AVM), Virtual Machine (NeoVM), and Rootstock Virtual Machine (RSK), which are built on top of the network and allow developers to write code for on . [4]

Benefits and Drawbacks of EVM

Benefits

Developers can execute code without worrying about its impact on the rest of the network or the possibility of it playing truant with data or personal files hosted on any of the node computers. Additionally, they can run complex on different computing environments with distributed consensus. This ensures that the failure of a single node does not have any negative impact on the running of the or smart contract, since the EVM code remains the same across all nodes.

The sanctity of the outcome that EVM makes is well-suited to the sustainable expansion of the DApps and smart contract Ethereum ecosystem. Add to this the library of standard codes available for developers to choose from, an increasing number of EVM-compatible  blockchains and a large number of potential EVM use cases possible, and it is easy to see why the EVM is the preferred platform for  development.[1]

Drawbacks

The most important of downside that needs to be considered is the high transaction fees or gas costs associated with running a on the Ethereum network. Paid in , these fees vary depending on the complexity of the contract and the network congestion at the time of execution, making it imperative for developers and entrepreneurs to price their services accordingly.

Additionally, since Solidity is the most preferred language for coding on the EVM, it does imply that developers need to have adequate experience with it and possess a modicum of technical expertise to create efficient smart contracts by using it. If developers choose to code using other languages, they need to be careful in resolving any inherent repetitions in the code since the EVM will proceed to compile them anyway. While upgrading smart contracts is possible at a later stage, it comes with security risks associated with creating an intermediary smart contract that references the address of the original smart contract.[1]

See something wrong? Report to us.

Ethereum Virtual Machine (EVM)

Commit Info

Edited By

0xF8bD29570D276c593125205A714D2623B311D2ce
Jaewon

Edited On

May 15, 2024

Feedback

Average Rating

No ratings yet, be the first to rate!

How was your experience?

Give this wiki a quick rating to let us know!

Media

REFERENCES

Join the IQ Brainlist

Sign up for the IQ Brainlist to get early access to editing on the IQ.wiki site!

Join Now

Subscribe to our newsletter

The IQ Ecosystem Report will keep you updated on everything IQ.

Subscribe

IQ.wiki

IQ.wiki's vision is to bring blockchain knowledge to the world and knowledge onto the blockchain. A part of Brainfund group

https://twitter.com/IQWIKIhttps://www.reddit.com/r/Everipedia/https://t.me/everipediahttps://www.instagram.com/iqwiki_/https://github.com/EveripediaNetworkhttps://discord.gg/x9EWvTcPXthttps://www.facebook.com/iqdotwiki

IQ

What's IQ?StakingBonds

Company

About usCareersBrandingIQ GPTIQ Dashboard

© 2024 IQ.wiki Powered By BrainDAO & IQ