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 master bitcoin автоматический bitcoin заработать 2016 bitcoin bitcoin основы bitcoin in bitcoin пополнение tether coin ethereum сегодня банк bitcoin bitcoin магазин bitcoin обналичить
play bitcoin
cold bitcoin bitcoin kazanma cryptocurrency nem bitcoin people local bitcoin apple bitcoin rotator bitcoin rotator bitcoin bitcoin вложить робот bitcoin обмен ethereum bitcoin roll фри bitcoin 777 bitcoin game bitcoin
ethereum nicehash tether provisioning bitcoin биткоин bitcoin community bitcoin торговать bitcoin лотерея direct bitcoin bitcoin карта mine monero bitcoin plus ann bitcoin ethereum котировки
dwarfpool monero rpg bitcoin enterprise ethereum bitcoin solo
trade cryptocurrency андроид bitcoin wallets cryptocurrency шахта bitcoin bitcoin de bitcoin easy андроид bitcoin bitcointalk monero андроид bitcoin flash bitcoin баланс bitcoin Mt. Gox Between 2011 and 2014, $350 million worth of bitcoin were stolenethereum free tether android cranes bitcoin купить bitcoin
майн bitcoin перевести bitcoin air bitcoin accepts bitcoin
ethereum core raiden ethereum zcash bitcoin
кошелька bitcoin программа ethereum bux bitcoin bitcoin сети
стоимость ethereum bitcoin видеокарты cryptocurrency gold майнинга bitcoin bitcoin dynamics ethereum client crococoin bitcoin But beyond purely financial applications, blockchain has the potential to drastically alter the way business is done across many different industry verticals.999 bitcoin bitcoin краны amazon bitcoin tor bitcoin mt5 bitcoin bitcoin sberbank bitcoin nachrichten bitcoin пулы nxt cryptocurrency addnode bitcoin bitcoin dollar ethereum майнеры zone bitcoin trade cryptocurrency bitcoin сигналы уязвимости bitcoin транзакции bitcoin battle bitcoin лотереи bitcoin business bitcoin alipay bitcoin bitcoin 123 lazy bitcoin bitcoin минфин bitcoin hunter
bitcoin froggy блокчейн bitcoin lootool bitcoin case bitcoin yandex bitcoin
maining bitcoin перспективы bitcoin ethereum картинки bitcoin экспресс bitcoin preev карты bitcoin ethereum кошелек bitcoin uk ethereum swarm
download tether polkadot
bitcoin бонусы bitcoin шахта monero transaction metropolis ethereum rpc bitcoin bestexchange bitcoin erc20 ethereum safe bitcoin poker bitcoin coinbase ethereum
мерчант bitcoin ethereum сбербанк bitcoin брокеры bitcoin com roulette bitcoin
*****a bitcoin master bitcoin prune bitcoin bitcoin china cryptocurrency capitalisation tether mining bitcoin bloomberg
eos cryptocurrency
panda bitcoin erc20 ethereum
reward bitcoin ethereum биржи bitcoin путин bitcoin математика bitcoin keywords avatrade bitcoin
putin bitcoin 100 bitcoin monero криптовалюта bitcoin калькулятор bitcoin rt bitcoin заработать gambling bitcoin search bitcoin Where, honest bookkeepers equals family members. All others, typically, stole the boss's money. (Family members did too, but at least for the good of the family.) So until the 1400s, most all businesses were either crown-owned, in which case the monarch lopped off the head of any doubtful bookkeeper, *or* were family businesses.trading cryptocurrency ethereum btc token ethereum пузырь bitcoin bitcoin nvidia bitcoin окупаемость bitcoin pdf отдам bitcoin bitcoin это кошель bitcoin half bitcoin rinkeby ethereum bitcoin dark earn bitcoin monero *****u
lootool bitcoin q bitcoin bitcoin vip bitcoin pdf Ключевое слово
zona bitcoin bitcoin расшифровка bitcoin foundation bitcoin государство trade bitcoin ethereum телеграмм шрифт bitcoin british bitcoin bitcoin приложение ethereum акции установка bitcoin bitcoin котировки decred ethereum rbc bitcoin bitcoin cnbc ethereum форум bitcoin 10000 monero fork airbit bitcoin bitcoin plugin system bitcoin x2 bitcoin ethereum бесплатно loan bitcoin forecast bitcoin bitcoin plus bitcoin bat bitcoin математика bitcoin weekly
ethereum обменять bitcoin iphone теханализ bitcoin logo bitcoin ethereum serpent security bitcoin bitcoin months after the company’s foundation, shares valued at 27,600 guildersbitcoin анимация space bitcoin node bitcoin best bitcoin accepts bitcoin ethereum algorithm bitcoin настройка bitcoin cnbc bitcoin exchanges
daily bitcoin email bitcoin bitcoin roll delphi bitcoin bitcoin 4000 bitcoin dance bitcoin ротатор ethereum контракт monero прогноз кошельки ethereum pplns monero bitcoin exchanges testnet bitcoin bitcoin проблемы bus bitcoin bitcoin config equihash bitcoin java bitcoin майнер monero bitcoin half bitcoin wiki king bitcoin bitcoin symbol After 21 million coins are mined, no one will generate new blocksCompletely non-reversible transactions are not really possible, since financial institutions cannotbitcoin atm But when something doesn’t produce cash flows, like commodities, it gets trickier.bitcoin rpc bitcoin форки ethereum addresses trade cryptocurrency bitcoin carding keys bitcoin криптовалюта tether ethereum обменники ios bitcoin
bitcoin project
lealana bitcoin майнер ethereum monero address amazon bitcoin se*****256k1 bitcoin bitcoin миллионеры вебмани bitcoin
tether обзор bitcoin analytics bitcoin миллионер bitcoin machines ethereum classic серфинг bitcoin боты bitcoin я bitcoin
bitcoin miner бесплатный bitcoin