Skip to content

What is the Ethereum Virtual Machine (EVM)? The Ethereum virtual machine

May 28, 2020

As already mentioned, the functionality of Ethereum smart contracts is possible thanks to the Ethereum virtual machine. To create these smart contracts, developers use Solidity or a programming language compatible with EVMlike in the case of Vyper or Bamboo. This is possible because EVM is able to perform full Turing operations.

The operation of intelligent contracts within the EVM is easy. The contract terms are programmed the way we can interact with it, and the EVM is responsible for performing these operations. So said, it sounds very simple and straightforward, but the truth is that it contains enormous complexity.

First of all, executing smart contracts requires resources. Memory, CPU, memory, all of this is necessary. In addition, Because of the way blockchain technology works, there is a cost associated with every interaction with contracts. The first problem is solved by the EVM organizing its storage in the form of a stack. For this purpose, storage spaces are created in which the information is contained during the execution of a contract. Contracts can have space in this memory for executing execution data and other variables.

What is the Ethereum Virtual Machine (EVM)? The Ethereum virtual machineWhat is the Ethereum Virtual Machine (EVM)? The Ethereum virtual machine

On the other hand, the storage requirement is covered by a storage space outside the blockchain. DApps generally use this memory to protect information that needs to be protected between executionsand so that they are always available locally without having to carry out a transaction with the smart contract and the associated costs.

These interaction costs are measured in gas, a key figure created by Ethereum to calculate the interaction costs with the EVM. The goal of Gas is to provide security against a malicious attacker who can use the network to perform malicious acts or to simply shut it down. So í that every operation performed is costly. Using the operating code KECCAK256, for example, incurs operating costs of 30 gas. But the cost increases by the ratio of 6 gas for each word we add to this operation, the purpose of which is to hash the information we enter.

This action is maintained along with the remaining instructions that the EVM can perform. The more complex the instruction, the higher the cost of gas.

Related: iquest; Qu é are smart contracts or smart contracts?