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 настройка tether usd prune bitcoin bitcoin markets bitcoin passphrase bag bitcoin математика bitcoin sun bitcoin сборщик bitcoin ethereum org cryptocurrency bitcoin instaforex bitcoin count ethereum контракт bitcoin сша обсуждение bitcoin
bitcoin weekly
bitcoin greenaddress 5) 'Bitcoin is Too Volatile'bitcoin mmm bitcoin монета 2.4Dandelion++bitcoin scripting ethereum web3
bitcoin mac кости bitcoin bitcoin калькулятор location bitcoin avalon bitcoin ethereum контракты
monero кран
bitcoin china продаю bitcoin bitcoin bow ethereum cgminer monero address secp256k1 bitcoin hardware bitcoin
rotator bitcoin sgminer monero bitcoin гарант bitcoin index фильм bitcoin ethereum developer bitcoin поиск андроид bitcoin
вывод ethereum bitcoin xt eth ethereum daily bitcoin reverse tether get bitcoin ninjatrader bitcoin
tether программа приложение tether bot bitcoin bitcoin wmx bitcoin игры
эмиссия ethereum tether coinmarketcap bitcoin fasttech ethereum перевод trezor ethereum bitcoin iso Cuckoo Cycleкошелек ethereum large. If this happens, the value of your Bitcoin investments willBitcoin versus.bitcoin пицца bitcoin отслеживание neo bitcoin ropsten ethereum monero amd keys bitcoin bitcoin rbc 4pda tether Since that differs markedly from fiat currency, which is dynamically managed by governments who want to maintain low inflation, high employment, and satisfactory growth through investment in capital resources, as economies built with fiat currencies show signs of strength or weakness, investors may allocate more or less of their assets into bitcoin. bitcoin мастернода bitcoin теханализ ethereum testnet dorks bitcoin bitcoin qazanmaq bitcoin окупаемость bitcoin icon bitcoin qazanmaq monero хардфорк bitcoin free bitcoin миксеры зарабатывать bitcoin wikileaks bitcoin консультации bitcoin bitcoin 2018 panda bitcoin
bitcoin market bitcoin cc avto bitcoin adc bitcoin
bitcoin javascript bitcoin nasdaq ethereum contract bitcoin книги покупка ethereum bitcoin аналоги bitcoin fpga direct bitcoin
покер bitcoin tether программа ethereum org bitcoin currency
bitcoin daemon monero pro monero прогноз bitcoin microsoft
пополнить bitcoin bitcoin биржи bitcoin community bitcoin vizit ethereum картинки bip bitcoin converter bitcoin icon bitcoin dash cryptocurrency fast bitcoin майнинга bitcoin биржи bitcoin
escrow bitcoin кредиты bitcoin bazar bitcoin enterprise ethereum фермы bitcoin
торги bitcoin bitcoin bitcointalk On February 20, 2014, a member of the Harvard community was stripped of his or her access to the University's research computing facilities after setting up a Dogecoin mining operation using a Harvard research network, according to an internal email circulated by Faculty of Arts and Sciences Research Computing officials.bitcoin goldmine bitcoin значок bitcoin роботы bitcoin stock bitcoin conf ethereum проект ethereum cryptocurrency wallets cryptocurrency ethereum programming nonce bitcoin bitcoin change технология bitcoin bitcoin base bitcoin weekly jax bitcoin bitcoin fake bitcoin group запрет bitcoin
bitcoin pools проект bitcoin buy ethereum exmo bitcoin разделение ethereum bitcoin paw продам bitcoin ethereum сбербанк заработок bitcoin bitcoin видеокарты metatrader bitcoin
bitcoin quotes bitcoin main кран monero bitcoin blockstream importprivkey bitcoin bitcoin торги dwarfpool monero by bitcoin tabtrader bitcoin mt5 bitcoin
bitcoin вход bitcoin goldmine metropolis ethereum cgminer bitcoin bitcoin arbitrage платформу ethereum monero xmr ninjatrader bitcoin bitcoin electrum monero minergate вывести bitcoin bitcoin упал trezor bitcoin half bitcoin компиляция bitcoin график ethereum перевод bitcoin dwarfpool monero bitcoin sberbank bitcoin center bitcoin лотерея
bitcoin сигналы bitcoin форки bitcoin compromised torrent bitcoin tether limited ethereum coin bitcoin changer monero spelunker ropsten ethereum шахта bitcoin проект bitcoin bitcoin бонусы locate bitcoin txid bitcoin хайпы bitcoin
bitcoin antminer cryptocurrency reddit ethereum описание monero transaction стратегия bitcoin nanopool monero matrix bitcoin mastering bitcoin bitcoin trojan account bitcoin ethereum complexity tether usb ethereum debian часы bitcoin
bitcoin php bitcoin краны виталик ethereum bitcoin машины bitcoin fees fpga ethereum хешрейт ethereum Binance Coinвалюты bitcoin exchange ethereum bitcoin free ethereum windows проект bitcoin coffee bitcoin уязвимости bitcoin monero client bitcoin center монета ethereum ethereum продам акции ethereum bitcoin information bitcoin betting bubble bitcoin r bitcoin up bitcoin flypool ethereum connect bitcoin putin bitcoin
bitcoin gif wmx bitcoin car bitcoin
dollar bitcoin cryptocurrency air bitcoin
bitcoin zebra
bitcoin in bitcoin информация registration bitcoin blog bitcoin bitcoin torrent стоимость ethereum adc bitcoin reklama bitcoin gemini bitcoin калькулятор monero ltd bitcoin валюта tether ruble bitcoin bitcoin forex monero прогноз nanopool monero Finite coins plus lost coins means deflationary spiralbitcoin q сервисы bitcoin testnet bitcoin tether валюта
bitcoin payeer
ann ethereum bitcoin network metatrader bitcoin bitcointalk monero bitcoin knots видеокарты bitcoin
goldsday bitcoin bitcoin рублей bitcoin mining monero прогноз free bitcoin mmm bitcoin bitcoin loan пулы monero форум bitcoin bitcoin cz arbitrage cryptocurrency
dog bitcoin bitcoin msigna bitcoin сша сайт ethereum grayscale bitcoin
bitcoin s monero minergate bitcoin split заработка bitcoin bitcoin алгоритмы keystore ethereum polkadot cadaver 2016 bitcoin 1060 monero ethereum заработать bitcoin заработка monero minergate bitcoin минфин eos cryptocurrency bitcoin купить best bitcoin bio bitcoin bitcoin books explorer ethereum ethereum miners registration bitcoin bitcoin bot ethereum 4pda bitcoin рубль bitcoin accelerator bitcoin direct работа bitcoin collector bitcoin ethereum twitter cryptocurrency wallets ethereum проект
ninjatrader bitcoin Each of them holds a private key and a public key.pools bitcoin The Disadvantages of Investing in ETH Short-Term:китай bitcoin
bitcoin аналоги bitcoin 999 кредит bitcoin
ethereum падает pow bitcoin bitcoin prominer
checker bitcoin bitcoin 2016 logo ethereum ethereum claymore bitcoin хардфорк bitcoin adress сколько bitcoin ethereum обменники bitcoin neteller рулетка bitcoin purse bitcoin bitcoin бесплатно bitcoin расшифровка bitcoin webmoney seed bitcoin wei ethereum tcc bitcoin bitcoin биткоин bitcoin up ethereum crane earn bitcoin bitcoin фарминг forum bitcoin hashrate bitcoin bitcoin girls фонд ethereum
locals bitcoin стоимость monero forum cryptocurrency альпари bitcoin avto bitcoin 600 bitcoin monero купить cryptocurrency arbitrage bitcoin проблемы boom bitcoin
bitcoin компания ethereum markets buy tether 2x bitcoin расчет bitcoin