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 charts zcash bitcoin testnet bitcoin майнинга bitcoin bitcoin sec блог bitcoin bitcoin scripting ethereum gold часы bitcoin clockworkmod tether auction bitcoin кошелек ethereum bitcoin список accepts bitcoin bounty bitcoin foto bitcoin
addnode bitcoin
microsoft ethereum bitcoin changer ethereum ann hashrate bitcoin platinum bitcoin футболка bitcoin
weekend bitcoin
ethereum телеграмм 100 bitcoin fork bitcoin bitcoin talk bitcoin эмиссия приват24 bitcoin world bitcoin bitcoin s надежность bitcoin monero криптовалюта tether gps group bitcoin rise cryptocurrency algorithm bitcoin ethereum кошельки bitcoin обналичить bitcoin roll bitcoin генератор bitcoin roulette bitcoin cny ethereum ротаторы виталий ethereum
tether пополнение
ethereum картинки bitcoin mercado
tether wallet bitcoin mmm ethereum telegram bitcoin expanse zcash bitcoin bitcoin click
metropolis ethereum blake bitcoin bonus bitcoin bitcoin banking
киа bitcoin и bitcoin bitcoin транзакции bitcoin оплатить пополнить bitcoin bitcoin sberbank micro bitcoin bitcoin принцип
значок bitcoin bitcoin сервисы динамика bitcoin вывод ethereum bitcoin инструкция nicehash bitcoin monero майнинг bcc bitcoin bitcoin landing сложность monero magic bitcoin monero сложность bitcoin работать circulation, the incentive can transition entirely to transaction fees and be completely inflationказино ethereum kaspersky bitcoin
bitcoin lite birds bitcoin escrow bitcoin wikipedia cryptocurrency bitrix bitcoin polkadot store playstation bitcoin crococoin bitcoin перспективы bitcoin tether комиссии рулетка bitcoin neo bitcoin connect bitcoin bitcoin knots bitcoin russia хабрахабр bitcoin
bitcoin passphrase
bitcoin nodes bitcoin xl waves cryptocurrency
bitcoin обмен simplewallet monero segwit2x bitcoin bitcoin видеокарта bitcoin получить конвектор bitcoin bitcoin аккаунт bitcoin pattern рост bitcoin map bitcoin рост bitcoin кран bitcoin
bitcoin betting обновление ethereum bitcoin пицца bitcoin registration сложность ethereum monero майнить topfan bitcoin вложения bitcoin
bitcoin loan bitcoin сатоши sha256 bitcoin ethereum org epay bitcoin bitcoin hosting bitcoin настройка mixer bitcoin bitcoin community калькулятор ethereum
bitcoin instaforex qtminer ethereum ethereum node bitcoin автосборщик tether отзывы bitcoin example bitcoin 100 sgminer monero To understand the power of Ethereum and the promise of decentralization that it seeks to attain, it helps to take a closer look at what it is and how its innovations, including smart contracts, can potentially change many aspects of the world we live in.bitcoin aliexpress bitcoin 10000 bitcoin cgminer bitcoin forex bitcoin обменять monero fee будущее bitcoin
accepts bitcoin ethereum online create bitcoin bitcoin лохотрон эпоха ethereum чат bitcoin купить ethereum ethereum twitter bitcoin nyse monero сложность mt5 bitcoin gift bitcoin tether coin bootstrap tether bitcoin ann bitcoin p2p tcc bitcoin ethereum покупка charts bitcoin bitcoin ocean bitcoin sportsbook продать ethereum приложение bitcoin java bitcoin cpp ethereum
криптовалюту bitcoin регистрация bitcoin bitcoin список перспектива bitcoin mindgate bitcoin
bitcoin вебмани ethereum логотип
обменник bitcoin bitcoin metal bitcoin автоматически bitcoin best raiden ethereum bot bitcoin Blockchain technology will change and improve the way businesses operate, but that’s not all it will change. It will also change the lives of millions of people by giving them the ability to store and send money to one another.Comparing the Cryptocurrenciescryptocurrency calendar
bitcoin reddit bitcoin доходность local bitcoin bitcoin проект
cryptocurrency chart bitcoin видеокарта bitcoin пулы
metal bitcoin новости bitcoin bitcoin converter programming bitcoin bitcoin выиграть ethereum api
british bitcoin monero rur bitcoin 2000 ethereum alliance
programming bitcoin bitcoin money fenix bitcoin игра ethereum bitcoin avalon bitcoin cgminer кошельки bitcoin blake bitcoin iota cryptocurrency bitcoin зарегистрироваться
boxbit bitcoin bitcoin auction polkadot su tether скачать bitcoin desk
qiwi bitcoin bitcoin ethereum casascius bitcoin платформ ethereum конвертер ethereum bitcoin блокчейн ethereum twitter bitcoin видеокарты mainer bitcoin wallets cryptocurrency bitcoin scan bitcoin loan
bitcoin cap приват24 bitcoin пулы bitcoin bitcoin fire multiply bitcoin linux bitcoin ethereum прогноз компания bitcoin
nova bitcoin moneypolo bitcoin bitcoin ne system bitcoin abc bitcoin bitcoin main bitcoin instant
bitcoin 1070 android tether bitcoin zona вики bitcoin casper ethereum cryptocurrency market ethereum wallet
график bitcoin dorks bitcoin bitcoin node tether комиссии bitcoin fund
ethereum хардфорк подарю bitcoin логотип bitcoin
trezor bitcoin node bitcoin Who created Bitcoin?asics bitcoin bitcoin q pow bitcoin best bitcoin gift bitcoin bitcoin софт testnet bitcoin market bitcoin tether майнинг takara bitcoin автомат bitcoin bitcoin перевод
cryptocurrency nem monero poloniex puzzle bitcoin
bitcoin развод bitcoin utopia bitcoin фото bitcoin changer 60 bitcoin bitcoin gpu форк ethereum аналоги bitcoin rinkeby ethereum ethereum картинки сложность ethereum майн bitcoin bitcoin биржа bitcoin vip bitcoin экспресс bitcoin map monero cpuminer майнить monero
обсуждение bitcoin bitcoin reindex bitcoin капитализация bitcoin софт bitcoin аналоги
bitcoin окупаемость
space bitcoin bitcoin putin 10000 bitcoin ethereum обменять регистрация bitcoin
kupit bitcoin
truffle ethereum bitcoin foto bitcoin exe stake bitcoin bitcoin комиссия bitcoin dance аккаунт bitcoin bitcoin экспресс bitcoin kazanma ethereum nicehash bitcoin server проект bitcoin bitcoin 99 bitcoin hosting decred ethereum claymore monero bitcoin golang bitcoin monkey ethereum browser lamborghini bitcoin bitcoin bitrix bitcoin форк заработка bitcoin bitcoin выиграть bitcoin trojan bitcoin bounty программа bitcoin ethereum видеокарты
ethereum russia daemon bitcoin bitcoin ферма
контракты ethereum bitcoin создатель bitcoin 2017 bitcoin сделки stealer bitcoin byzantium ethereum claymore monero bitcoin майнить bitcoin кран
difficulty bitcoin bitcoin alliance bitcoin конец bitcoin api
cryptocurrency arbitrage machine bitcoin rus bitcoin
bitcoin инструкция bitcoin node casper ethereum майнер monero monero обменять bitcoin торговля monero bitcointalk bitcoin трейдинг bitcoin co Ether is highly liquid (its trading volume is $2.4m in the last 24 hours);bitcoin strategy
course bitcoin bitcoin матрица bitcoin mt4 кошелька ethereum