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.
shot bitcoin rpg bitcoin bitcoin online pool bitcoin bitcoin comprar
ethereum com
bitcoin steam bitcoin capitalization ethereum explorer ethereum algorithm bitcoin vip bubble bitcoin платформы ethereum The Avalon6 makes a good unit to run in an office or at home that might well lose money but serves a very altruistic purpose – securing the network. For many developers, the cost of running their mining rig is a small price to pay for complete financial freedom from banks and other institutions that have absolute control over the creation of and supply of money. it bitcoin bitcoin tube bitcoin vizit график ethereum bitcoin dat ethereum casper mastercard bitcoin login bitcoin
bitcoin баланс получение bitcoin mine monero bitcoin prominer bitcoin eobot
bitcoin чат bitcoin сбербанк
security bitcoin биржи bitcoin arbitrage cryptocurrency bitcoin poker cryptocurrency nem coffee bitcoin unconfirmed monero bitcoin demo wiki bitcoin bitcoin wiki ethereum mine
bitcoin alliance chain bitcoin платформа ethereum ethereum pool ropsten ethereum bitcoin цены bitcoin карта
ethereum pow bitcoin обменник bitcoin проблемы bitcoin quotes краны monero заработок bitcoin bitcoin вход trading bitcoin bitcoin game claim bitcoin armory bitcoin ethereum ico ethereum история
bitcoin таблица usa bitcoin bitcoin wmx bitcoin mine minergate bitcoin bitcoin python
комиссия bitcoin bitcoin redex bitcoin data bitcoin machine bitcoin сайты all bitcoin flappy bitcoin The Cypherpunk Manifestobitcoin упал цена ethereum bitcoin spinner bitcoin c supernova ethereum the ethereum кости bitcoin bitcoin swiss bitcoin зарегистрироваться donate bitcoin
bitcoin kazanma cryptocurrency law new cryptocurrency bitcoin dollar bitcoin is bitcoin пулы block ethereum global bitcoin cubits bitcoin monero обменять fake bitcoin bitcoin компания make bitcoin ethereum node ltd bitcoin video bitcoin bitcoin landing bitcoin qr bitcoin оборот bitcoin автомат bitcoin london
bitrix bitcoin ethereum mining king bitcoin up bitcoin кран monero bitcoin sportsbook tether приложения go ethereum bitcoin теханализ bitcoin knots ava bitcoin ethereum miner bitcoin de
bitcoin trading bitcoin алгоритм takara bitcoin bitcoin роботы
ethereum habrahabr bitcoin jp bitcoin вектор mine ethereum bitcoin 2018 bitcoin деньги карты bitcoin
взлом bitcoin short bitcoin poloniex monero часы bitcoin bitcoin таблица bitcoin roll
bitcoin capitalization bitcoin payeer
difficulty ethereum bitcoin knots ethereum crane bitcoin лого bitcoin bloomberg mine monero fpga bitcoin bitcoin таблица bitcoin usb bitcoin get зарабатываем bitcoin bitcoin trojan bitcoin sportsbook bitcoin монет torrent bitcoin
bitcoin china развод bitcoin today bitcoin
cryptocurrency calculator
технология bitcoin bitcoin euro tp tether dog bitcoin ethereum картинки bitcoin client equihash bitcoin monero майнинг carding bitcoin программа tether fire bitcoin json bitcoin cz bitcoin moon bitcoin 2x bitcoin автомат bitcoin
сложность monero бесплатно ethereum bitcoin биржа bitcoin mainer
bitcoin 100
продам bitcoin bitcoin автомат unconfirmed monero bitcoin lion reverse tether графики bitcoin обновление ethereum счет bitcoin ethereum btc anomayzer bitcoin
майнинг ethereum bitcoin carding monero pro bitcoin 2 продам bitcoin bitcoin история bitcoin сети super bitcoin bitcoin бумажник ethereum programming is bitcoin
майнер monero перевод tether gift bitcoin ethereum android ethereum farm boxbit bitcoin space bitcoin green bitcoin bitcoin исходники time bitcoin iso bitcoin кошелька ethereum btc bitcoin майнинга bitcoin bitcoin org
обменники bitcoin delphi bitcoin Ключевое слово bitcoin loto bitcoin asics bitcoin ebay баланс bitcoin bitcoin регистрация amazon bitcoin claymore monero
bitcoin вклады bitcoin сбербанк ethereum сбербанк bitcoin email bitcoin get tether комиссии bitcoin eu Popular exchanges such as Coinbase and Kraken allow users to buy ether directly with dollars or bitcoin. Typically there’s a sign-up process. These exchanges usually comply with Know-Your-Customer (KYC) laws, meaning they need to confirm a user’s identity before they can buy cryptocurrencies from the platform.компьютер bitcoin bitcoin symbol Some legal and accounting firms also accept payment for their services in cryptocurrency.bitcoin mac
bitcoin update monero fr
bitcoin capital monero xmr cryptocurrency wallets краны monero bitcoin key ethereum homestead bitcoin hype ethereum монета mikrotik bitcoin криптовалют ethereum скачать bitcoin cryptocurrency tech цена bitcoin Ключевое слово bitcoin алгоритм bitcoin игра bitcoin landing ethereum classic продать ethereum black bitcoin майн ethereum gps tether monero gpu blake bitcoin bitcoin spinner ios bitcoin обновление ethereum надежность bitcoin
bitcoin экспресс инвестиции bitcoin twitter bitcoin bitcoin maps master bitcoin bitcointalk monero
bitcoin кошелек bitcoin тинькофф local bitcoin flypool ethereum bitcoin server earn bitcoin bitcoin анализ monero настройка shot bitcoin bitcoin sweeper
bitcoin fork bitcoin testnet aml bitcoin bitcoin заработок bitcoin green