To understand the Ethereum Virtual Machine (EVM), one must first remember its predecessor, the BitTorrent software. According to Ethereum inventor Vitalik Buterin, BitTorrent was the first-ever decentralized application (DApp): a community of independent users generating and exchanging data for each other over an open Internet.
Programmer Bram Cohen invented BitTorrent as a file-sharing protocol in 2001, and it's still going strong today, despite concerted international and multi-billion dollar efforts to destroy it. The latest movies or software can still be downloaded via the BitTorrent protocol in minutes directly to your laptop. To really stop BitTorrent, you would have to turn off every computer in every home in every country on the planet. The same is true for EVM. That's why the decentralized network Ethereum is called the "unstoppable world computer."
What is the Ethereum virtual machine?
The Ethereum Virtual Machine (EVM) is a powerful virtual sandbox stack built into each full-featured Ethereum node, responsible for executing contract bytecode. Contracts are typically written in higher-level languages, such as Solidity, and then compiled into EVM bytecode.
This means that the machine code is completely isolated from the network, file system, or any processes on the host computer. Each node on the Ethereum network runs an EVM instance, allowing them to agree on executing the same instructions. EVM is Turing-complete, which refers to a system capable of executing any logical step in a computational function. JavaScript, the programming language that powers the worldwide web, makes extensive use of Turing completeness.
Ethereum virtual machines have been successfully implemented in a variety of programming languages, including C++, Java, JavaScript, Python, Ruby and many others.
The EVM is essential to the Ethereum protocol and plays a key role in the consensus engine of the Ethereum system. It allows anyone to execute code in a trustless ecosystem in which the outcome of an execution can be guaranteed and is fully deterministic (i.e., smart contract execution).
For each instruction implemented on the EVM, a system that keeps track of the execution cost, assigns an associated cost in units of gas to the instruction. (See our article on Gas). When a user wants to initiate a transaction and thus a contract execution, he reserves a certain number of Ether, which he is willing to pay for this cost in Gas.
By using the Gas mechanism, two major problems are solved: A validator is guaranteed to receive the initial prepaid amount, even if the execution fails. An execution cannot last longer than the prepaid amount allows. Instead of looping indefinitely, the run continues until it runs out of gas.
When a transaction is sent to the network, validators can pick up the transaction, running the associated code. The validator will ensure that:
All transaction information is valid.
The sender has sufficient funds to pay for the execution of the transaction.
MVE has not encountered any exceptions during execution.
EVM achieves Turing completeness by enabling an economy that charges per executed software instruction rather than per executed financial transaction as Bitcoin does. Instead of a transaction fee, you have some sort of fee for executing programs.
Turing completeness means that Ethereum is technically a general purpose peer-to-peer global computer and could even take on the functions of the internet as we know it. Ethereum could allow us to create file-sharing economies, peer-to-peer crowdfunding events, smart contracts, marketplaces to rent out your laptop's unused hard drive space, a disintermediated Uber or Facebook (products without companies), etc. It's a bit like the internet in 1994: no one knows what the future holds.
💡 EVM compatible: This term refers to a decentralized wallet that can connect to protocols using the Ethereum core. MetaMask is an EVM compatible wallet 3.0, it allows the use of contruite blockchains with the features of the Ethereum network.
Comments