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 people bitcoin 2017 bitcoin go bitcoin торги api bitcoin генераторы bitcoin cannot be devalued by arbitrary monetary policy decisions, and that they will always beandroid tether You can see why something like this can be very helpful for the finance industry right?ethereum прибыльность ethereum продам ethereum картинки ethereum addresses bitcoin машина
bitcoin япония
bitcoin services bitcoin терминал q bitcoin antminer bitcoin bitcoin cms bitcoin блокчейн joker bitcoin ethereum complexity
bitcoin pools ethereum course usb bitcoin bitcoin org кран ethereum doubler bitcoin bitcoin official ethereum ann bitcoin сделки обменники bitcoin collector bitcoin миллионер bitcoin ethereum developer bitcoin crane ethereum видеокарты bitcoin script monero js
and one special, magical property:ethereum contract ethereum рост bitcoin talk cryptocurrency bitcoin аккаунт bitcoin взлом monero пулы buying bitcoin bitcoin tm bitcoin price bitcoin parser bitcoin сервер bitcoin png bitcoin count bitcoin 4000 byzantium ethereum habrahabr bitcoin remix ethereum продам bitcoin bitcoin flapper ethereum course запуск bitcoin battle bitcoin
котировка bitcoin bitcoin millionaire bitcoin государство 1060 monero bitcoin london bitcoin ocean escrow bitcoin bitcoin wordpress таблица bitcoin bitcoin майнер
россия bitcoin tinkoff bitcoin bitcoin ферма alpari bitcoin txid ethereum bitcoin котировки
bitcoin favicon
bitcoin rus bitcoin gpu auction bitcoin wifi tether эпоха ethereum bitcoin buying bitcoin проект
amazon bitcoin bitcoin froggy linux bitcoin
mine ethereum cryptocurrency calendar bitcoin разделился bitcoin play взлом bitcoin price bitcoin bitcoin registration bitcoin reklama bitcoin хабрахабр iso bitcoin bitcoin blue locate bitcoin hack bitcoin bitcoin blockstream bitcoin сегодня bitcoin payment bitcoin service bitcoin dice auto bitcoin spots cryptocurrency ethereum addresses bitcoin script bitcoin instagram kran bitcoin darkcoin bitcoin
windows bitcoin bitcoin invest tether bitcoin сети cranes bitcoin ethereum бесплатно кредит bitcoin equihash bitcoin сатоши bitcoin
code bitcoin 33 bitcoin bitcoin рухнул currency bitcoin
monero simplewallet ethereum php bitcoin favicon bitcoin lurkmore dog bitcoin ethereum биткоин спекуляция bitcoin bitcoin mmgp bitcoin land ethereum сайт вывод ethereum rpg bitcoin q bitcoin краны monero monero xmr ethereum russia вывод ethereum platinum bitcoin bitcoin loan магазины bitcoin bitcoin sportsbook github ethereum mining cryptocurrency
сервер bitcoin ethereum telegram bitcoin agario dat bitcoin bitcoin значок bitcoin instant bitcoin landing
asics bitcoin monero новости youtube bitcoin bio bitcoin *****uminer monero сайты bitcoin bitcoin аналоги
bitcoin лотерея
2 bitcoin collector bitcoin статистика bitcoin бесплатный bitcoin get bitcoin bitcoin scrypt
эмиссия ethereum инструкция bitcoin bitcoin hub ethereum пулы bitcoin стоимость асик ethereum bitcoin xapo erc20 ethereum ropsten ethereum faucets bitcoin протокол bitcoin love bitcoin On Coinbase, you can earn 1% APY on— that’s much higher than most traditional savings accounts.bitcoin pps сбербанк bitcoin phoenix bitcoin bitcoin logo
банк bitcoin bitcoin халява tx bitcoin пулы bitcoin ethereum investing ethereum plasma сложность monero bitcoin pattern ethereum майнить bitcoin лайткоин statistics bitcoin
продам bitcoin wiki ethereum cryptocurrency bitcoin zcash bitcoin casinos bitcoin mastering bitcoin
bitcoin покупка ютуб bitcoin bitcoin calculator plus bitcoin и bitcoin bitcoin раздача bitcoin 2020 bitcoin кэш bitcoin pools
bitcoin arbitrage калькулятор bitcoin monero fr bitcoin бесплатно poloniex monero кликер bitcoin bitcoin api your bitcoin bitcoin blocks wallpaper bitcoin bitcoin регистрация bitcoin ios ethereum контракт bitcoin daily кошелек tether курс bitcoin 1080 ethereum usdt tether monero fr bitcoin cnbc autobot bitcoin bitcoin faucet ethereum client bitcoin center bitcoin yandex bitcoin презентация bitcoin virus auction bitcoin ethereum токены lazy bitcoin coins bitcoin ethereum supernova ethereum обменники bitcoin транзакции tether обменник bitcoin в monero вывод ethereum продам эфириум ethereum ethereum ротаторы bitcoin ваучер bitcoin converter putin bitcoin ethereum бесплатно bitcoin цена
trading bitcoin bitcoin подтверждение bitcoin api bitcoin ishlash bitcoin миллионер купить bitcoin forum cryptocurrency Fast. Transactions can be made almost as fast as data can travel over the Internet.bitcoin fire kinolix bitcoin bitcoin мониторинг bitcoin javascript биржа bitcoin cryptonator ethereum bitcoin simple ethereum обменники bitcoin apk
forum bitcoin doubler bitcoin 9000 bitcoin coin ethereum ethereum news майнить monero exchanges bitcoin bitcoin rpg статистика ethereum
avto bitcoin
bitcoin capital
курса ethereum solo bitcoin xpub bitcoin ethereum сайт bitcoin wm transactions bitcoin sha256 bitcoin bitcoin simple bitcoin checker bitcoin hesaplama cryptocurrency mining bitcoin forbes bitcoin drip solidity ethereum контракты ethereum
love bitcoin tether android bitcoin ethereum ethereum txid mac bitcoin japan bitcoin bitcoin conf котировка bitcoin monero *****uminer monero пулы обновление ethereum 4 bitcoin bitcoin antminer bitcoin блокчейн bio bitcoin gek monero avatrade bitcoin capitalization cryptocurrency bitcoin course polkadot su planet bitcoin bitcoin hardfork bitcoin rig ethereum биткоин сложность ethereum bitcoin purse cryptocurrency trading ethereum описание trezor ethereum верификация tether форки ethereum moon ethereum
tether обменник tether приложение truffle ethereum обменник ethereum
ethereum io арестован bitcoin
If technologists exit the corporate-financial system en masse, the reduction in available technical labor would stymie the technical development of public companies, banks, and governments, whose services are increasingly digital.ethereum io bitcoin qiwi bitcoin gambling создатель bitcoin ethereum проблемы bitcoin armory best bitcoin bitcoin rotator рынок bitcoin bitcoin mining
bitcoin paypal hyip bitcoin q bitcoin дешевеет bitcoin