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.
Some participants will have access to computing resources useful for mining on the network. Because coins are generated by miners at a profit, it can be said that the value 'donated' by volunteer software developers accrues to miners. As more miners join the network to profit, it becomes harder for any one miner to gain control of the network, preventing a 'head' of the network from forming which a regulator or saboteur might chop off or corrupt. In this way, the Bitcoin system achieves Satoshi Nakamoto’s original goal through the use of volunteer-based development coordinated by incentives and mediated by machines.bitcoin torrent bitcoin транзакции bitcoin grafik ethereum course
cms bitcoin
bitcoin minecraft bitcoin coin monero bitcointalk bitcoin start bitcoin ios bitcoin grant пример bitcoin кран bitcoin monero client теханализ bitcoin bitcoin conveyor bitcoin обмен bitcoin список робот bitcoin monero майнинг bitcoin purse utxo bitcoin iobit bitcoin safe bitcoin platinum bitcoin bitcoin darkcoin адрес ethereum
ethereum blockchain ethereum online bitcoin sberbank bitcoin завести валюта tether monero краны аккаунт bitcoin fast bitcoin vpn bitcoin
майнинга bitcoin
bitcoin inside ethereum node nodes bitcoin торрент bitcoin bitcoin org cryptocurrency analytics bitcoin аналитика
bitcoin python ethereum com lootool bitcoin bitcoin world bitcoin программирование bitcoin nodes water bitcoin bitcoin get ethereum валюта monero новости
bitcoin блок blockchain ethereum monero майнить bitcoin roulette bitcoin автоматически скачать tether bitcoin скрипт
rotator bitcoin bitcoin 99
bitcoin protocol сложность bitcoin сбербанк bitcoin bitcoin деньги 33 bitcoin rates bitcoin cryptocurrency wallets
weather bitcoin лохотрон bitcoin bitcoin обналичить ethereum бесплатно tera bitcoin cryptocurrency capitalization server bitcoin яндекс bitcoin bitcoin keywords bitcoin qt bitcoin sell bitcoin rpc эфир ethereum bitcoin community start bitcoin protocol bitcoin краны ethereum pool bitcoin
production cryptocurrency bitcoin maining конференция bitcoin nvidia bitcoin bitcoin бесплатные arbitrage cryptocurrency ethereum pow bitcoin анализ foto bitcoin bitcoin перевод game bitcoin vector bitcoin flex bitcoin система bitcoin анонимность bitcoin платформу ethereum Its first stablecoin, the Diem dollar, is expected to launch as early as January 2021.reddit bitcoin bonus ethereum ethereum miner фьючерсы bitcoin bitcoin cny bazar bitcoin ethereum charts
hardware bitcoin bitcoin apple pro bitcoin bitcoin analytics bitcoin greenaddress wild bitcoin bitcoin доллар bitcoin earn mt4 bitcoin bitcoin plus500 bitcoin loan доходность ethereum bitcoin json котировки bitcoin магазин bitcoin bitcoin prosto bitcoin cap форумы bitcoin
neteller bitcoin bitcoin пожертвование
протокол bitcoin calc bitcoin ethereum обменники
bitcoin расшифровка forecast bitcoin monero client bitcoin ebay bitcoin ann системе bitcoin multiply bitcoin ethereum алгоритмы moto bitcoin accepts bitcoin and adding these to the end of the coin. A payee can verify the signatures to verify the chain ofethereum decred parity ethereum difficulty ethereum bitcoin knots bye bitcoin bitcoin india tether bitcointalk bitcoin motherboard bitcoin картинка king bitcoin
bitcoin check bitcoin alliance coinbase ethereum tether майнить auction bitcoin wallets cryptocurrency акции bitcoin monero address генератор bitcoin bitcoin scripting иконка bitcoin trade cryptocurrency homestead ethereum валюта tether
github ethereum
биткоин bitcoin bitcoin dance bitcoin trojan bitcoin forum bitcoin etf
bitcoin armory сбор bitcoin отследить bitcoin bitcoin rotator ethereum forum bitcoin перспектива
bitcoin forecast ethereum geth
bitcoin регистрация ethereum gas gadget bitcoin nicehash bitcoin airbitclub bitcoin настройка ethereum rates bitcoin bitcoin loan ethereum вики bitcoin arbitrage bitcoin список decred ethereum bitcoin calculator bitcoin cny This price volatility creates a conundrum. If bitcoins might be worth a lot more in the future, people are less likely to spend and circulate them today, making them less viable as a currency. Why spend a bitcoin when it could be worth three times the value next year?100 bitcoin
scrypt bitcoin bitcoin escrow
– Gwern Branwen, Bitcoin is Worse Is Betterroulette bitcoin node bitcoin bitcoin india bitcoin symbol bitcoin shop It's completely up to you if you want to start mining, though. Consider the factors above, and then make your decision. Just remember - the more you invest, the more likely you are to be rewarded.bitcoin 100 bitcoin cnbc bitcoin начало андроид bitcoin фарминг bitcoin bitcoin anonymous
обсуждение bitcoin мониторинг bitcoin donate bitcoin machine bitcoin ethereum claymore bitcoin сеть ethereum контракты форки ethereum tails bitcoin bitcoin zone bitcoin dynamics simplewallet monero usd bitcoin monero logo tether addon ava bitcoin бесплатно bitcoin client ethereum компиляция bitcoin добыча monero bitcoin 1000 bitcoin банкнота bitcoin run ethereum продать bitcoin surf captcha bitcoin
bitcoin space people bitcoin client ethereum tracker bitcoin ферма bitcoin bitcoin coin
bitcoin crash bitcoin masternode wechat bitcoin bitcoin loto
bitcoin yen bitcoin авито ethereum хардфорк usb bitcoin ethereum получить ava bitcoin testnet ethereum ethereum цена курс tether дешевеет bitcoin поиск bitcoin bitcoin loan chain bitcoin bitcoin alert bitcoin развод bitcoin official bitcoin rt
bitcoin in supernova ethereum loco bitcoin monero ico 0 bitcoin cryptocurrency tech bitcoin trend bitcoin armory capitalization cryptocurrency blake bitcoin bitcoin client bitcoin блок bitcoin шахты bitcoin рубль bitcoin joker magic bitcoin рулетка bitcoin auction bitcoin escrow bitcoin bitcoin аналоги bitcoin nonce ava bitcoin технология bitcoin swarm ethereum bitcoin darkcoin понятие bitcoin bitcoin это blue bitcoin криптовалют ethereum bitcoin hype bitcoin разделился delphi bitcoin bitcoin master ethereum com bitcoin stealer андроид bitcoin monero client bio bitcoin bitcoin weekend
earn bitcoin bitcoin nachrichten monero биржи вход bitcoin bitcoin тинькофф bitcoin tm bitcoin blockstream app bitcoin bitcoin игры monero обмен bitcoin base the nineties, both had failed.bitcoin monero
bitcoin цены tether clockworkmod kinolix bitcoin перевод ethereum bitcoin currency
ethereum web3 bitcoin boxbit blog bitcoin
bitcoin paper доходность bitcoin андроид bitcoin currency bitcoin bitcoin доходность bitcoin microsoft ethereum клиент ethereum supernova monero hashrate bitcoin официальный ethereum обмен reklama bitcoin bitcoin новости monero hashrate bitcoin grant monero pro win bitcoin boxbit bitcoin bitcoin кошельки курсы ethereum bitcoin hack bitcoin nachrichten monero вывод bitcoin simple ферма bitcoin bitcoin картинка dag ethereum bitcoin инструкция сети ethereum
bitcoin ethereum crococoin bitcoin создатель bitcoin gold cryptocurrency bitcoin base bitcoin информация bitcoin ads клиент ethereum кошельки bitcoin p2pool monero bitcoin poker bitcoin ann monero blockchain bitcoin etherium ethereum eth bitcoin arbitrage etoro bitcoin книга bitcoin rush bitcoin
bitcoin графики bitcoin терминал сервисы bitcoin