Cointime

Download App
iOS & Android

What Is the Ethereum Virtual Machine

Validated Individual Expert

As the world’s most popular blockchain for smart contracts, Ethereum owes much of its success to the Ethereum Virtual Machine (EVM). From gas fees to smart contract execution, the Ethereum Virtual Machine is responsible for much of the magic behind the Ethereum blockchain. EVM also powers the ecosystem of other leading blockchains like Polygon, Binance Smart Chain, etc.

But what is the Ethereum Virtual Machine, and how does it work?

Let’s find out all together what it does in this article.

Defining the Ethereum Virtual Machine

Ethereum Virtual Machine is software that executes programmable code on the blockchain (smart contracts) and determines the state of Ethereum after each successful block.

As a virtual machine, EVM doesn’t have a central computer or cloud — it distributes and executes information across hundreds of computers participating in the network, also called nodes. These nodes all run the same EVM code, which makes it easier to build software on Ethereum.

Brief History of the Ethereum Virtual Machine

Before diving deep into what EVM does, let’s first understand how it came to be. Vitalik Buterin introduced the idea of Ethereum in 2013 — creating a decentralized platform for building applications. Vitalik’s idea eventually became the Ethereum network, and at the heart of that network is the EVM.

Interestingly, Vitalik claims that BitTorrent was the first decentralized app (or dApp) ever created in 2001. BitTorrent and the EVM are similar in that they are both peer-to-peer networks with no central authority, but they serve different purposes.

For instance, BitTorrent is great for a singular purpose i.e, sharing files. But EVM goes beyond just file sharing with decentralized applications (dApps).

The EVM provides a secure and reliable environment for running dApps, which is crucial, particularly while handling sensitive data or financial transactions.

What Does the Ethereum Virtual Machine Do?

Ethereum Virtual machine primarily functions as a runtime environment for smart contracts.

You can think of EVM as the “brain” behind the Ethereum network: It executes code and ensures the entire network agrees on the outcome of the code.

EVM powers many decentralized applications and NFTs on the Ethereum blockchain. Due to the flexibility and security of smart contracts, these dApps range from play-to-earn games to crypto lending and borrowing applications. With EVM, you can build these dApps in any programming language and execute timely transactions.

Further, EVM is capable of Turing completeness, which means that smart contracts can perform any combination of code and complex calculations. This includes complex computations like AI and cryptography, allowing for a wide range of use cases and applications.

Therefore, Ethereum dApps benefit from the security of a decentralized network, plus the flexibility of performing complex computations.

How the Ethereum Virtual Machine Works

The Ethereum Virtual Machine can implement smart contract logic and validate ownership of funds. To do so, it uses a stack-based architecture, which means the nodes come in a particular order. Having a strict pre-defined order helps Ethereum resist hacker attacks and increase efficiency. Further, a stack-based architecture is very versatile, and easily supports different types of instructions.

EVM supports different programming languages, but the most popular ones for developers are Vyper and Solidity. This is because developers write smart contracts and decentralized applications using these languages.

However, since EVM cannot understand English like humans, the network must translate the code before deploying it. This is where compilers come into play — software that acts as a translator between the machine and the developer.

Compilers convert human-readable Solidity code to the computer-friendly version in two components: an instruction format called “bytecode” and a specification technique called Contract ABI.

While Bytecode is the common language that the entire Ethereum network understands, Contract ABI defines how other applications can interact with each smart contract. Let’s understand how this works in the Ethereum blockchain.

First, each smart contract on the Ethereum blockchain goes through the Ethereum compiler, translating it to bytecode and Contract ABI.

Next, the bytecode and Contract ABI is deployed to the EVM, distributing it across the entire Ethereum network. Each node on the network receives and stores a copy of the bytecode, making it tamper-proof.

Now, the EVM has the job of simplifying the bytecode further for the computer. Each computer has pre-defined sets of instructions known as opcodes. Bytecode sequences correspond to and trigger these opcodes. Next the EVM executes all of the requests represented by the opcode.

Advantages of the EVM

Blockchains using the Ethereum Virtual machine are very developer-friendly, and therefore quite popular. EVM allows for a range of capabilities but here are some of the most prominent ones:

Cross Blockchain Support

The Ethereum Virtual Machine can support any blockchain with bytecode-compatible smart contracts. Therefore, several blockchains, such as Polygon and Avalanche, use EVM to power their ecosystems.

Isolated Sandbox

Although the EVM uses the same computer network for all applications, it can execute each code separately. There is no impact on the underlying blockchain or other data stored by the node computers. This allows for fast and efficient development.

Flexible Development

EVM can easily execute complex and customized smart contracts, such as those used for transactions on dApps, DeFi, games, and NFTs. It also has a large developer community that makes building software easier.

Cross-functional Across Operating Systems

Blockchains have a large number of computers participating in their network, each with different operating systems like MacOS, Windows etc. These operating systems are vastly different from the others, which makes it challenging to develop software. However, EVM allows us to standardize and run programs on multiple operating systems without writing separate code.

Disadvantages of the EVM

While building on Ethereum has many benefits, all good things come at a price. And in Ethereum, that price is high crypto gas fees.

The EVM has scalability limitations, meaning it can only handle a limited number of transactions per second. As a result, when the network is too crowded, the gas fees can shoot up very quickly.

Due to the popularity of Ethereum, it can become expensive to deploy custom smart contracts or bulky applications. You need to optimize your contracts for speed and efficiency, removing repetitive code or unnecessary functions. You also need to account for the fact that storage costs on Ethereum can be equally expensive.

Another disadvantage of EVM is that once you deploy a smart contract on the blockchain, you can’t change it. This can be a major problem if you discover a bug or vulnerability after deployment. In such cases, you’ll need to redeploy the entire contract, and the extra fees can add up quickly.

The Future of EVM

The future of EVM is bright, with growing adoption and exciting developments on the horizon.

For instance, with other blockchains using a common base such as EVM, interoperability is becoming easier. For instance, developers can easily create dApps compatible with multiple blockchains at once. Further, it’s easier to transfer funds between EVM-compatible blockchains, so new blockchains can scale faster.

Another exciting development for the EVM is the EOF upgrade in 2023. To explain, EOF stands for EVM Object Format and it will be the first upgrade to the Ethereum Virtual Machine since its inception in 2015. To learn more about the details, make sure you read the EOF documentation. But to give you a basic overview: EOF will significantly change how EVM works, allowing for cheaper and faster smart contracts and an overall increase in security.

Comments

All Comments

Recommended for you

  • BTC Falls Below $65,000

    Market data shows BTC has fallen below $65,000, currently reported at $64,999.23, with a 24-hour increase of 1.01%. Market volatility is high, please exercise risk control.

  • Hedge Fund AISituational Awareness's Mysterious $400 Million Investment Targets Chip Startup Source Foundry

    On August 8, sources revealed that the hedge fund Situational Awareness, managed by former OpenAI researcher Leopold Aschenbrenner, made a mysterious $400 million investment in the chip manufacturing startup Source Foundry just days after facing imminent collapse. Previously, Bloomberg reported that the hedge fund invested in a private company backed by Sequoia Capital, but did not disclose the name of the specific company. The Wall Street Journal had earlier reported that the recipient of the investment was Source Foundry, unveiling the target of this mysterious funding deployment by Situational Awareness.

  • US Spot Bitcoin ETF Sees $101.79M Net Inflow Yesterday

    On August 8, according to Trader T's monitoring, US spot bitcoin ETFs saw a net inflow of $101.79 million yesterday.

  • US Official: Ukraine Agrees to Avoid Strikes on Non-Russian Tankers and Black Sea Oil Facilities

    On August 8, according to a US official, Ukraine has agreed not to target certain non-Russian tankers and Black Sea infrastructure vital to Kazakhstan's crude oil exports. This follows ship attacks last month that caused loading disruptions. The US official said Ukraine has set up contact points so commercial shipping companies can communicate information and ensure safe passage. The commitment was reached after meetings between senior US government leaders and Ukrainian leadership, marking a potentially significant step toward increasing regional oil shipments. Previously, activity in the region had cooled significantly due to several recent attacks near the Caspian Pipeline Consortium terminal in Russia's Novorossiysk. (Jin Shi)

  • U.S. July Nonfarm Payrolls Fall by 23,000, Missing Market Expectations

    On August 7, U.S. nonfarm payrolls decreased by 23,000 in July, compared with market expectations of an increase of 80,000, and the previous value was an increase of 57,000.

  • US May and June Nonfarm Payroll Additions Revised Down by 103,000 Combined

    On August 7, the US Bureau of Labor Statistics: May nonfarm payroll additions were revised down from 129,000 to 63,000; June nonfarm payroll additions were revised down from 57,000 to 20,000. After the revisions, the combined additions for May and June were 103,000 lower than previously reported.

  • U.S. Rate Futures Market Sees Lower Odds of Fed September Hike

    On August 7, the probability of a Fed rate hike in September as priced by U.S. interest rate futures declined.

  • New York Gold Futures Top $4,400 per Ounce

    New York gold futures topped $4,400 per ounce, up 2.36% on the day.

  • Japan Finance Minister: FX Market Affected by Moves Not Driven by Actual Demand

    Japanese Finance Minister Satsuki Katayama said she and U.S. Treasury Secretary Bessent agreed that the foreign exchange market has been affected by moves not driven by actual demand.

  • BTC Breaks Through $65,000

    Market data shows BTC has broken through $65,000, currently reported at $65,007.44, with a 24-hour increase of 0.6%. The market is highly volatile, please exercise risk control.