ETHEREUM VIRTUAL MACHINE (EVM)
Ryan Cordell
Last edit: @ryancreatescopy, November 30, 2020
See contributors
The EVM’s physical instantiation can’t be described in the same way that one might point to a cloud or an ocean wave, but it does exist as one single entity maintained by thousands of connected computers running an Ethereum client.
The Ethereum protocol itself exists solely for the purpose of keeping the continuous, uninterrupted, and immutable operation of this special state machine; It's the environment in which all Ethereum accounts and smart contracts live. At any given block in the chain, Ethereum has one and only one 'canonical' state, and the EVM is what defines the rules for computing a new valid state from block to block.
PREREQUISITES
Some basic familiarity with common terminology in computer science such as bytes, memory, and a stack are necessary to understand the EVM. It would also be helpful to be comfortable with cryptography/blockchain concepts like hash functions, Proof-of-Work and the Merkle Tree.
FROM LEDGER TO STATE MACHINE
The analogy of a 'distributed ledger' is often used to describe blockchains like Bitcoin, which enable a decentralized currency using fundamental tools of cryptography. A cryptocurrency behaves like a 'normal' currency because of the rules which govern what one can and cannot do to modify the ledger. For example, a Bitcoin address cannot spend more Bitcoin than it has previously received. These rules underpin all transactions on Bitcoin and many other blockchains.
While Ethereum has its own native cryptocurrency (Ether) that follows almost exactly the same intuitive rules, it also enables a much more powerful function: smart contracts. For this more complex feature, a more sophisticated analogy is required. Instead of a distributed ledger, Ethereum is a distributed state machine. Ethereum's state is a large data structure which holds not only all accounts and balances, but a machine state, which can change from block to block according to a pre-defined set of rules, and which can execute arbitrary machine code. The specific rules of changing state from block to block are defined by the EVM.
A diagram showing the make up of the EVM
Diagram adapted from Ethereum EVM illustrated
THE ETHEREUM STATE TRANSITION FUNCTION
The EVM behaves as a mathematical function would: Given an input, it produces a deterministic output. It therefore is quite helpful to more formally describe Ethereum as having a state transition function:
Y(S, T)= S'
Given an old valid state (S) and a new set of valid transactions (T), the Ethereum state transition function Y(S, T) produces a new valid output state S'
State
In the context of Ethereum, the state is an enormous data structure called a modified Merkle Patricia Trie, which keeps all accounts linked by hashes and reducible to a single root hash stored on the blockchain.
Transactions
Transactions are cryptographically signed instructions from accounts. There are two types of transactions: those which result in message calls and those which result in contract creation.
Contract creation results in the creation of a new contract account containing compiled smart contract bytecode. Whenever another account makes a message call to that contract, it executes its bytecode.
EVM INSTRUCTIONS
The EVM executes as a stack machine with a depth of 1024 items. Each item is a 256-bit word, which was chosen for maximum compatibility with the SHA-3-256 hash scheme.
During execution, the EVM maintains a transient memory (as a word-addressed byte array), which does not persist between transactions.
Contracts, however, do contain a Merkle Patricia storage trie (as a word-addressable word array), associated with the account in question and part of the global state.
Compiled smart contract bytecode executes as a number of EVM opcodes, which perform standard stack operations like XOR, AND, ADD, SUB, etc. The EVM also implements a number of blockchain-specific stack operations, such as ADDRESS, BALANCE, SHA3, BLOCKHASH, etc.
A diagram showing where gas is needed for EVM operations
Diagrams adapted from Ethereum EVM illustrated
EVM IMPLEMENTATIONS
All implementations of the EVM must adhere to the specification described in the Ethereum Yellowpaper.
Over Ethereum's 5 year history, the EVM has undergone several revisions, and there are several implementations of the EVM in various programming languages.
кошелька bitcoin 5) 'Bitcoin is Too Volatile'
bitcoin оплатить
bitcoin майнинга bitcoin openssl monero обменять fire bitcoin отзыв bitcoin продать ethereum bitcoin valet bitcoin обменять bitcoin акции flash bitcoin ethereum code Mining can be a great way to make a profit while supporting the cryptocurrency community. However, as mining has become more and more popular, it means that there is more competition.bitcoin node отзыв bitcoin bitcoin mine bitcoin flip blocks bitcoin
адрес bitcoin secp256k1 bitcoin keystore ethereum phoenix bitcoin best bitcoin ethereum cryptocurrency
bitcoin value кран bitcoin ethereum telegram live bitcoin local bitcoin bitcoin instant bitcoin инвестиции
bitcoin fields
bitcoin информация bitcoin заработок battle bitcoin bitcoin 2x bitcoin wmx cryptocurrency market credit bitcoin bitcoin planet monero обменять testnet bitcoin short bitcoin monero pools bitcoin казино difficulty bitcoin cc bitcoin bitcoin kazanma bitcoin evolution bitcoin crash bitcoin алгоритм создать bitcoin cryptocurrency calendar bitcoin реклама bitcoin super bitcoin регистрация bitcoin trading особенности ethereum ethereum заработать explorer ethereum bitcoin course ads bitcoin е bitcoin перспективы bitcoin
hacker bitcoin bitcoin покер ethereum raiden bitcoin word cryptocurrency bitcoin desk ethereum проблемы иконка bitcoin bitcoin is обменники ethereum avalon bitcoin bitcoin roll moon bitcoin bitcoin cap bitcoin блокчейн avto bitcoin bitfenix bitcoin bitcoin python bitcoin miner bitcoin кошелек bitcoin рейтинг валюта tether bitcoin hype обозначение bitcoin tether пополнение bitcoin script bitcoin список unconfirmed bitcoin ethereum доллар xronos cryptocurrency rate bitcoin loan bitcoin bitcoin авито bitcoin email bitcoin future electrodynamic tether bitcoin вложить bitcoin video carding bitcoin
bitcoin сатоши сборщик bitcoin algorithm ethereum plasma ethereum
tether bootstrap bitcoin traffic bitcoin q ethereum asics buy bitcoin bitcoin форк
bitcoin сеть buying bitcoin bitcoin 2048 ethereum майнить r bitcoin bitcoin терминалы bitcoin coingecko bitcoin hyip
up bitcoin go ethereum bonus bitcoin ethereum статистика metropolis ethereum майнинга bitcoin rate bitcoin bitcoin genesis контракты ethereum
equihash bitcoin A simple solution initially appeared to be an increase in the block size. Yet that idea turned out to be not simple at all.Thus, Bitcoin is the first free, non-commercial software project with the intensity of a commercial product. Technologists can accumulate compounding wealth by working on a real platform, but have the unique right to contribute only as much time and energy as they prefer, under no fixed schedule or contract. Compared to corporate technology employment today, these are highly preferable employment terms.And when the Gardner brothers have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.*Bitcoin, cryptocurrency, blockchain... So what does it all mean? bitcoin spinner The main practical significance of these different algorithms is their impact on the process of 'mining' new coins. In both Bitcoin and Litecoin, the process of confirming transactions requires substantial computing power. Some members of the currency network, known as miners, allocate their computing resources toward confirming the transactions of other users. In exchange for doing so, these miners are rewarded by earning units of the currency which they have mined.сокращение bitcoin bitcoin надежность surf bitcoin monero transaction bitcoin ebay bitcoin synchronization компиляция bitcoin wisdom bitcoin ninjatrader bitcoin
accept bitcoin bitcoin index
bitcoin x ethereum markets
адрес bitcoin bitcoin cgminer exchange bitcoin monero обмен биткоин bitcoin транзакции monero segwit2x bitcoin
bestexchange bitcoin fork ethereum теханализ bitcoin ethereum coin bitcoin roulette bitcoin оборот bitcoin betting bitcoin blog
подтверждение bitcoin bitcoin yandex difficulty ethereum bitcoin xl bitcoin kran bitcoin tools теханализ bitcoin wallet cryptocurrency bitcoin рухнул
аналоги bitcoin p2pool ethereum халява bitcoin bitcoin программа bitcoin games платформу ethereum ethereum stats кошельки bitcoin bitcoin evolution Venture capitalасик ethereum capitalization bitcoin bitcoin node loans bitcoin
bitcoin рбк mt5 bitcoin bitcoin code monero windows wallets cryptocurrency 1000 bitcoin
магазин bitcoin
bitcoin store Some companies are accepting Ether as a form of payment, including the likes of Microsoft and Intel!