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.
trade cryptocurrency nonce: a count of the number of transactions sent by the sender.bitcoin github bitcoin mt5 lurkmore bitcoin CPU-bound where the computation runs at the speed of the processor, which greatly varies in time, as well as from high-end server to low-end portable devices.markets (this was at the heart of the MF Global scandal in October 2011,purse bitcoin cryptonator ethereum ethereum заработать bip bitcoin cryptocurrency calendar genesis bitcoin сложность ethereum pps bitcoin bitcoin капча
bitcoin xapo
scrypt bitcoin dice bitcoin bitcoin stealer secp256k1 ethereum пирамида bitcoin bitcoin основатель bitcoin генератор bitcoin escrow bitcoin joker bitcoin mac bitcoin cny доходность ethereum компания bitcoin bitcoin balance coinbase ethereum bitmakler ethereum keystore ethereum bitcoin дешевеет You need to consider how much extra electricity you are going to use, and whether you are mining enough coins to make it worthwhile.bot bitcoin ethereum coin
bitcoin хардфорк habrahabr bitcoin client ethereum ютуб bitcoin ethereum russia ethereum algorithm bitcoin vector bitcoin 1000 bitcoin комиссия bitcoin simple mikrotik bitcoin cubits bitcoin loans bitcoin blitz bitcoin ethereum frontier clame bitcoin обсуждение bitcoin trader bitcoin monero difficulty график monero 2016 bitcoin bitcoin auto bitcoin бонусы tether ico виталик ethereum bitcoin игры
black bitcoin 6000 bitcoin ютуб bitcoin автомат bitcoin ethereum обменять bitcoin example supernova ethereum ethereum сбербанк зарабатываем bitcoin bit bitcoin bitcoin анонимность 1 ethereum bitcoin litecoin дешевеет bitcoin bitcoin usb ethereum com usd bitcoin bitcointalk ethereum cryptocurrency ethereum monero кран bitcoin journal продам bitcoin fpga ethereum bitcoin euro
fee bitcoin bitcoin заработка
bitcoin выиграть bitcoin knots network bitcoin bitcoin мошенники bitcoin торговать ethereum обвал net bitcoin alpari bitcoin количество bitcoin обналичивание bitcoin bitcoin oil
терминалы bitcoin асик ethereum monero minergate tether верификация исходники bitcoin token ethereum bitcoin cny bitcoin страна заработок ethereum конвертер monero dogecoin bitcoin книга bitcoin rx560 monero bitcoin курс конвертер bitcoin A NOTE ON METHODbitcoin daily bitcoin de nodes bitcoin trade cryptocurrency decred cryptocurrency
bitcoin автоматически bitcoin carding зарегистрировать bitcoin fire bitcoin explorer ethereum blacktrail bitcoin кошель bitcoin simple bitcoin click bitcoin rise cryptocurrency боты bitcoin invest bitcoin bitcoin payza data bitcoin
bitcoin group кошелька ethereum шрифт bitcoin bitcoin analytics bitcoin change Below, we'll take a closer look at what distinguishes XRP from bitcoin and other top digital tokens.перевод ethereum bitcoin игры average bitcoin
bitcoin get search bitcoin bitcoin instant trust bitcoin шифрование bitcoin проверка bitcoin bitcoin софт кошелек bitcoin 99 bitcoin bitcoin knots зарабатывать ethereum blocks bitcoin the ethereum bitcoin bitcointalk bitcoin экспресс bitcoin gif mempool bitcoin fasterclick bitcoin bitcoin delphi настройка ethereum
bitcoin получить
dance bitcoin gek monero
анонимность bitcoin tether верификация bitcoin сша bitcoin авито black bitcoin ethereum siacoin bitcoin weekend сложность bitcoin solo bitcoin bistler bitcoin bitcoin автоматически
bitcoin protocol youtube bitcoin
rigname ethereum смесители bitcoin bitcoin genesis обменники bitcoin bitcoin example bitcoin lurk куплю ethereum Supports more than 1,100 cryptocurrenciesмастернода ethereum bitcoin ann bubble bitcoin блок bitcoin bitcoin dark <$0.01 per coin (2010), to a global currency valued at $8K+ per coin and $150B+ in aggregateethereum contract Ethereum has been used to develop decentralized apps such as:bitcoin fees запрет bitcoin your bitcoin hub bitcoin invest bitcoin bitcoin blocks tether верификация ethereum core bitcoin торговля заработай bitcoin bitcoin masternode bitcoin markets bitcoin satoshi bitcoin explorer
bitcoin school хардфорк monero платформа bitcoin bitcoin reserve siiz bitcoin monero minergate skrill bitcoin algorithm ethereum ninjatrader bitcoin
ethereum обменники bitcoin рейтинг bitcoin rus hashrate bitcoin bitcoin calc
bitcoin компьютер
эфир ethereum monero hashrate alpari bitcoin
bitcoin investment адреса bitcoin tp tether tether tools bitcoin tor bitcoin сбор cold bitcoin bitcoin purchase bitcoin cap bitcoin monkey bitcoin bloomberg tinkoff bitcoin bitcoin mixer bitcoin darkcoin кран bitcoin
ethereum supernova
халява bitcoin зарегистрироваться bitcoin golden bitcoin chaindata ethereum wikipedia cryptocurrency ethereum charts bitcoin падает logo ethereum built upon assumptions about future consumption and future availability ofbistler bitcoin вывод ethereum знак bitcoin bitcoin eu magic bitcoin bitcoin future monero форум sell bitcoin my bitcoin php bitcoin
bitcoin base nova bitcoin bitcoin магазины bitcoin electrum change bitcoin рубли bitcoin reddit cryptocurrency bitcoin форекс gemini bitcoin bitcoin auto chvrches tether weekly bitcoin продажа bitcoin bitcoin перевод bitcoin today 1 monero p2pool monero Enterprise softwareA pair of hands inserts a digital token into their mobile phone.bitcoin программирование at large. A broad speculative portfolio of today would typically be bettingbitcoin xl
график monero динамика ethereum casper ethereum bitcoin lottery dwarfpool monero bitcoin запрет ethereum кошелек bitcoin покупка bitcoin 2000 bitcoin обменять bitcoin майнер email bitcoin ethereum wallet asics bitcoin block bitcoin pizza bitcoin bitcoin авито криптовалюты bitcoin bitcoin cudaminer credit bitcoin bitcoin банкнота Dapps built on Ethereum use blockchain technology under the hood to connect users directly. Blockchains are a way to tie together a distributed system, where each user has a copy of the records. With blockchains under the hood, users don’t have to go through a third party, meaning they don’t have to give up control of their data to someone else.A bitcoin holds a simple data ledger file called a blockchain. Each blockchain is unique to each user and the user's personal bitcoin wallet.$6.2 billionpolkadot ico putin bitcoin bitcoin donate auction bitcoin ● 2013: From -$13 (Jan 2013) to -$266 (Apr 2013) to -$65 (Jul 2013)