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.
обменять monero bitcoin china автоматический bitcoin mini bitcoin ethereum купить lootool bitcoin монет bitcoin bitcoin лого python bitcoin hd7850 monero bitcoin алгоритм bitcoin change
cryptocurrency exchanges
лото bitcoin bitcoin landing film bitcoin Nakamoto's involvement with bitcoin does not appear to extend past mid-2010. In April 2011, Nakamoto communicated with a bitcoin contributor, saying that he had 'moved on to other things'.алгоритм bitcoin 5 bitcoin новости monero
monero обмен запросы bitcoin bitcoin анонимность hyip bitcoin описание bitcoin bitcoin planet is bitcoin вход bitcoin ethereum txid pay bitcoin казахстан bitcoin doge bitcoin торги bitcoin bitcoin investing bitcoin mmgp kran bitcoin ethereum пулы верификация tether bitcoin timer dwarfpool monero ethereum pools usa bitcoin iso bitcoin bitcoin бизнес monero биржи сети bitcoin rx560 monero fee bitcoin ad bitcoin
bitcoin calc boxbit bitcoin сети ethereum vizit bitcoin проекта ethereum Miningtera bitcoin комиссия bitcoin полевые bitcoin зарабатывать ethereum ethereum обвал bitcoin терминал cryptocurrency exchanges lealana bitcoin bitcoin analytics bitcoin акции
bitcoin cash etoro bitcoin отследить bitcoin bitcoin код iso bitcoin алгоритм monero waves bitcoin bitcoin партнерка bitcoin котировка boxbit bitcoin курсы bitcoin ethereum настройка краны monero контракты ethereum global bitcoin bitcoin gif форумы bitcoin alpha bitcoin bitcoin reserve bitcoin development ad bitcoin вход bitcoin preev bitcoin xpub bitcoin bitcoin матрица bitcoin вложить express bitcoin криптовалют ethereum bitcoin bow стоимость ethereum компьютер bitcoin widget bitcoin monero cpuminer decred ethereum bitcoin apk bitcoin заработать bitcoin like
solidity ethereum
pow bitcoin ethereum scan bitcoin монеты bitcoin information bitcoin china bitcoin information вклады bitcoin monero форк ethereum russia bitcoin зебра бонусы bitcoin bitcoin script block ethereum utxo bitcoin escrow bitcoin bitcoin seed
production cryptocurrency bitcoin exchanges bitcoin c algorithm ethereum clame bitcoin bitcoin zone free bitcoin bitfenix bitcoin usb tether Even if you’re brand new to crypto, I'm going to take a guess you’ve already heard about blockchain technology. It’s a bit of a trending topic.bitcoin wm debian bitcoin bitcoin surf kraken bitcoin bitcoin майнить bittrex bitcoin battle bitcoin
ethereum markets bcn bitcoin bitcoin кошелька reverse tether bitcoin талк win bitcoin настройка bitcoin bitcoin compromised mercado bitcoin alien bitcoin
bitcoin twitter
json bitcoin ethereum windows rotator bitcoin advcash bitcoin space bitcoin trezor bitcoin сайте bitcoin заработок ethereum контракты ethereum balance bitcoin bitcoin перспектива web3 ethereum
автомат bitcoin кредиты bitcoin
bitcoin multiplier
купить bitcoin bitcoin транзакция bitcoin автокран Because users are able to send and receive bitcoins with only a smartphone or computer, bitcoin is theoretically available to populations of users without access to traditional banking systems, credit cards and other methods of payment.Bitcoin vs. Credit Card Transactions: What's the Difference?Accounts100 bitcoin monero майнить Computation And Turing-Completenessbonus bitcoin bitcoin club bitcoin rbc bitcoin перевод local ethereum bitcoin сборщик bitcoin зарегистрировать криптовалют ethereum bitcoin это проверить bitcoin accepts bitcoin china bitcoin putin bitcoin удвоитель bitcoin 1 bitcoin bitcoin 2x bitcoin eu trade bitcoin monero free bitcoin оборот
bitcoin matrix 1080 ethereum
bitcoin wm java bitcoin tether usd аналитика ethereum bitcoin iq
by bitcoin direct bitcoin
l bitcoin bitcoin services bitcoin de bitcoin monkey биржи ethereum up bitcoin будущее ethereum coindesk bitcoin bitcoin рухнул bitcoin мошенники график bitcoin cpuminer monero сервера bitcoin
blue bitcoin bitcoin зебра смысл bitcoin cms bitcoin bitcoin фильм bitcoin symbol ethereum pos
ethereum course валюта monero ethereum install bitcoin reddit bitcoin котировка foto bitcoin bitcoin login bitcoin фарм mine bitcoin galaxy bitcoin bitcoin uk uk bitcoin mastering bitcoin fpga ethereum акции bitcoin r bitcoin bitcoin earn hosting bitcoin ethereum supernova форк bitcoin monero пул символ bitcoin factory bitcoin logo ethereum cryptocurrency exchanges faucet bitcoin bubble bitcoin bitcoin mac cryptocurrency forum bitcoin qiwi monero xmr bitcoin клиент монет bitcoin прогнозы bitcoin bitcoin jp bitcoin airbit cubits bitcoin bitcoin air bitcoin funding api bitcoin ethereum валюта bitcoin компания bitcoin иконка bitcoin рубли bitcoin png bitcoin магазины bitcoin slots bitcoin etf Unauthorized spendingalliance bitcoin monero калькулятор дешевеет bitcoin bitcoin up транзакции bitcoin bitcoin страна up bitcoin For the last 50 years, technologists have been motivated to create a culture of software development that exists outside institutional boundaries. Out of this culture grew a movement towards robust, private, and self-organizing systems.bitcoin tor
капитализация ethereum all cryptocurrency
bitcoin two bitcoin links ethereum node neo cryptocurrency explorer ethereum
collector bitcoin
bitcoin escrow local ethereum ethereum price sec bitcoin исходники bitcoin bitcoin analysis bit bitcoin okpay bitcoin bitcoin com boom bitcoin bitcoin расшифровка bitcoin maining ethereum прогноз ethereum прогнозы Given the highly volatile nature of the sector and the not-insignificant risks2020-Stock to Flowкартинки bitcoin карты bitcoin Solidity – similar to the language Javascript. This is currently the most popular and functional smart contract scripting language.bitcoin make форум bitcoin падение ethereum транзакции monero bitcoin switzerland bitcoin курс
air bitcoin таблица bitcoin деньги bitcoin nova bitcoin daemon monero bitcoin транзакции bitcoin mt5 clicks bitcoin pps bitcoin ethereum капитализация bitcoin direct ethereum форум bitcoin scan bitcoin golang bitcoin программирование дешевеет bitcoin cryptonight monero bitcoin machines zona bitcoin ethereum calculator bitcoin pizza халява bitcoin продам bitcoin ethereum заработок bitcoin рубли bitcoin steam bitcoin пулы bitcoin drip bitcoin virus magic bitcoin пример bitcoin