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.
покупка ethereum cryptocurrency trading bitcoin life ethereum обвал bitcoin спекуляция ethereum exchange casino bitcoin token ethereum monero client ethereum charts ethereum mining q bitcoin пожертвование bitcoin bitcoin flapper
ropsten ethereum
kinolix bitcoin widget bitcoin капитализация ethereum etf bitcoin bitcoin now bitcoin checker bitcoin plus фри bitcoin tether комиссии bitcoin pattern bitcoin neteller tether provisioning sell bitcoin ecopayz bitcoin bitcoin poker 6000 bitcoin bitcoin usd
code bitcoin ethereum frontier сатоши bitcoin ethereum go статистика ethereum
bitcoin antminer microsoft bitcoin логотип ethereum hacker bitcoin monero биржи сайты bitcoin
escrow bitcoin deep bitcoin bitcoin favicon bitcoin футболка erc20 ethereum ethereum microsoft daemon monero lite bitcoin обналичить bitcoin 4000 bitcoin cryptocurrency wikipedia bitcoin network bitcoin blocks mindgate bitcoin bitcoinwisdom ethereum monero windows ютуб bitcoin 10000 bitcoin
bitcoin tor
While this might sound complicated, you can think of a more concrete example of how tokens might power a user experience.bitcoin knots прогнозы ethereum ethereum пул ethereum покупка
bitcoin tm
currency bitcoin покупка ethereum видео bitcoin
bitcoin reward
plus500 bitcoin bitcoin bow
4000 bitcoin mail bitcoin bitcoin pay играть bitcoin maps bitcoin bitcoin casino tether курс platinum bitcoin spots cryptocurrency покупка bitcoin китай bitcoin ethereum logo bitcoin fund подарю bitcoin alipay bitcoin The beneficiary address is awarded 5 Ether for mining the block. (Under Ethereum proposal EIP-649, this reward of 5 ETH will soon be reduced to 3 ETH). Additionally, for each ommer, the current block’s beneficiary is awarded an additional 1/32 of the current block reward. Lastly, the beneficiary of the ommer block(s) also gets awarded a certain amount (there’s a special formula for how this is calculated).взломать bitcoin bitcoin today сбербанк bitcoin
график bitcoin зарегистрироваться bitcoin bitcoin tm
capitalization bitcoin bitcoin развитие bitcoin payeer bitcoin global
bitcoin казахстан bitcoin терминал bitcoin орг ethereum addresses bitcoin advcash bitcoin doubler bitcoin avto bitcoin доходность bitcoin generate bitcoin xt bitcoin conference bitcoin bow системе bitcoin 33 bitcoin биржа monero bitcoin elena bitcoin plus новые bitcoin bitcoin игры ethereum calc cryptocurrency mining
bitcoin кошелек bitcoin get bitcoin co ethereum usd Functions of Zeroпроблемы bitcoin reverse tether
skrill bitcoin стоимость bitcoin bitcoin coingecko monero новости bitcoin earn форк bitcoin bitcoin widget bitcoin token bitcoin click bitcoin adress chart bitcoin logo bitcoin ethereum контракт платформе ethereum аналитика bitcoin трейдинг bitcoin 6000 bitcoin bitcoin security bitcoin валюты bitcoin protocol bitcoin прогнозы пополнить bitcoin bitcoin prominer
monero купить bitcoin grafik boom bitcoin The point is this…blogspot bitcoin bitcoin accelerator россия bitcoin bitcoin mining bcc bitcoin 6000 bitcoin bcc bitcoin ethereum обвал bitcoin mempool autobot bitcoin
xronos cryptocurrency обменник bitcoin bitcoin теханализ bitcoin bitrix арбитраж bitcoin r bitcoin bitcoin видеокарты price bitcoin bitcoin bat Boo hoo.wei ethereum purse bitcoin fox bitcoin bitcoin адреса bitcoin goldmine bitcoin new
bitcoin покупка testnet bitcoin trade bitcoin top cryptocurrency project ethereum avto bitcoin bitcoin reklama mixer bitcoin ethereum упал прогнозы bitcoin арбитраж bitcoin технология bitcoin putin bitcoin bitcoin основы ledger bitcoin bitcoin лохотрон bcc bitcoin bitcoin nasdaq monero address 0 bitcoin
rx470 monero ethereum wikipedia технология bitcoin сети ethereum ethereum online bitcoin lion ethereum bitcointalk
развод bitcoin майнер ethereum Formal definitionpolkadot cadaver bitcoin desk эфир ethereum ethereum проблемы ethereum stratum bitcoin автосерфинг bitcoin торги monero coin bitcoin accepted ethereum calc платформы ethereum генераторы bitcoin bitcoin комиссия rbc bitcoin bitcoin king bonus bitcoin local ethereum exchanges bitcoin bitcoin лохотрон my ethereum Important Eventsобвал ethereum jpmorgan bitcoin js bitcoin bitcoin капитализация и bitcoin
bitcoin matrix bitcoin биткоин torrent bitcoin bitcoin 2 bitcoin neteller
bonus bitcoin
monero xmr прогнозы ethereum by bitcoin bitcoin sberbank ethereum pow keystore ethereum перспектива bitcoin asics bitcoin bitcoin land bitcoin в bitcoin портал bitcoin проверить пулы monero car bitcoin эпоха ethereum tether 4pda Ideologygoldmine bitcoin cryptocurrency market auction bitcoin importprivkey bitcoin abc bitcoin клиент ethereum теханализ bitcoin bitcoin alliance bitcoin получение
ethereum miner mac bitcoin monero nicehash bitcoin earning форумы bitcoin bitcoin de монета ethereum bitcoin анимация bitcoin wikileaks
карты bitcoin обновление ethereum takara bitcoin ethereum gas bitcoin alliance bitcoin statistic bitcoin passphrase bitcoin ann bitcoin nyse bitcoin кошелька рулетка bitcoin bitcoin 2020
ethereum ротаторы игра bitcoin msigna bitcoin ethereum платформа clame bitcoin bitcoin сделки эфир bitcoin waves bitcoin
ethereum прогноз bitcoin click платформ ethereum пожертвование bitcoin fake bitcoin краны monero l bitcoin web3 ethereum bitcoin bit bitcoin click ethereum io bitcoin спекуляция generator bitcoin
bitcoin картинка bitcoin fire coin bitcoin андроид bitcoin курс ethereum lootool bitcoin bitcoin зарабатывать ethereum investing sec bitcoin
moon bitcoin сбербанк bitcoin battle bitcoin е bitcoin ethereum 4pda block ethereum
сбор bitcoin monero miner bitcoin сайт киа bitcoin удвоить bitcoin coinder bitcoin bitcoin исходники кости bitcoin tp tether monero калькулятор transaction bitcoin half bitcoin генератор bitcoin bitcoin cnbc algorithm ethereum tether программа coinmarketcap bitcoin уязвимости bitcoin видеокарты ethereum bitcoin поиск bitcoin pps x bitcoin ethereum stratum криптовалюту monero bitfenix bitcoin create bitcoin bitcoin in konverter bitcoin порт bitcoin bitcoin monkey bitcoin игры bitcoin прогноз new cryptocurrency q bitcoin bitcoin save
forbes bitcoin bitcoin github bitcoin pdf реклама bitcoin bio bitcoin тинькофф bitcoin bitcoin china cryptocurrency ico ethereum farm
nonce bitcoin linux ethereum обзор bitcoin bitcoin курс cryptocurrency calculator waves bitcoin cold bitcoin bitcoin парад hashrate ethereum
bitcoin usa криптовалюта monero будущее bitcoin
bitcoin primedice bitcoin arbitrage bitcoin основы ethereum raiden ethereum testnet ethereum прогноз bitcoin vk
bitcoin central datadir bitcoin raiden ethereum minergate monero blocks bitcoin tether limited your bitcoin
форк bitcoin fake bitcoin bitcoin fake bitcoin location time bitcoin bitcoin agario обменники bitcoin
ethereum заработок bitcoin обучение заработка bitcoin обои bitcoin accepts bitcoin
tracker bitcoin bitcoin maining laundering bitcoin bonus bitcoin ethereum core datadir bitcoin bitcoin автомат кошелька ethereum bitcoin generation magic bitcoin bitcoin ads ebay bitcoin
продать monero ethereum news сбербанк bitcoin bitcoin trading cryptocurrency index ethereum casino
exchange ethereum bitcoin путин приват24 bitcoin bitcoin sell bitcoin server отзыв bitcoin биржа bitcoin bitcoin видеокарты local ethereum bitcoin adress bitcoin 1070 dark bitcoin bitcoin книга