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 монета ethereum russia рейтинг bitcoin bitcoin land bitcoin трейдинг
system bitcoin
ethereum виталий bitcoin перевод bitcoin nasdaq
mine monero bitcoin alliance bitcoin information bitcoin окупаемость
From bitcoin to blockchain to distributed ledgers, the cryptocurrency space is fast evolving, to the point where it can be difficult to see in which direction it’s headed.bitcoin service bitcoin blockchain bitcoin сервисы
bitcoin видеокарта config bitcoin будущее ethereum bitcoin 100 bitcoin trader разделение ethereum
ethereum настройка карты bitcoin bitcoin capital tether gps ethereum forum ethereum статистика bitcoin пицца bitcoin antminer bitcoin проект робот bitcoin bitcoin landing инструкция bitcoin bitcoin информация курсы bitcoin foto bitcoin bitcoin captcha lite bitcoin bitcoin fire
bitcoin софт collector bitcoin bitcoin sberbank
hourly bitcoin bitcoin xyz
hashrate ethereum yandex bitcoin
lamborghini bitcoin bank cryptocurrency
monero обмен
alpha bitcoin bank cryptocurrency tera bitcoin bitcoin golang
bitcoin litecoin ethereum news bitcoin cgminer bitcoin рынок
1 ethereum genesis bitcoin
exchange cryptocurrency bitcoin payza x2 bitcoin bitcoin hacking обменник bitcoin Payment verificationплатформ ethereum bitcoin кредит падение ethereum p2pool monero презентация bitcoin bitcoin вектор
hardware bitcoin check bitcoin tether кошелек ethereum explorer лотереи bitcoin
When transactions are initiated, they are cryptographically 'signed' by the transacting parties so that the network can validate the fact that sufficient funds are available to do as they wish. Each transaction is time-stamped for immutability and then added to a block of other transactions to be recorded by the network.foto bitcoin брокеры bitcoin bitcoin окупаемость habrahabr bitcoin decred cryptocurrency web3 ethereum masternode bitcoin
bitcoin weekly monero форум bitcoin database bitcoin banks tether apk
ethereum core opencart bitcoin трейдинг bitcoin
зарегистрироваться bitcoin ферма bitcoin get bitcoin эфир bitcoin abi ethereum ethereum падает icons bitcoin обзор bitcoin bitcoin joker форум bitcoin сбербанк bitcoin
новый bitcoin
автомат bitcoin claim bitcoin bounty bitcoin bitcoin коды 'Privacy is necessary for an open society in the electronic age. Privacy is not secrecy. A private matter is something one doesn’t want the whole world to know, but a secret matter is something one doesn’t want anybody to know. Privacy is the power to selectively reveal oneself to the world.'bitcoin cloud 33 bitcoin форекс bitcoin bitcointalk ethereum 600 bitcoin ethereum chaindata bitcoin кошелек новости bitcoin форумы bitcoin cms bitcoin ethereum swarm bitcoin авито bitcoin чат dogecoin bitcoin bitcoin testnet ethereum miners майнить ethereum bitcoin 99 In a decentralized system, the information is not stored by one single entity. In fact, everyone in the network owns the information.bitcoin ротатор Image for postLedgers, the foundation of accounting, are as ancient as writing and money.skrill bitcoin ethereum farm create bitcoin bitcoin ads bitcoin capital вебмани bitcoin анонимность bitcoin bitcoin alliance eos cryptocurrency
bitcoin avto компания bitcoin bitcoin сервисы kong bitcoin bitcoin 4096 bitcoin data доходность ethereum
ethereum картинки ico ethereum кошельки bitcoin суть bitcoin tether отзывы bitcoin click 2x bitcoin lamborghini bitcoin monero usd bitcoin рейтинг hash bitcoin
фото ethereum wired tether bitcoin monkey ethereum заработать нода ethereum bitcoin suisse форк bitcoin bitcoin etherium tether верификация bitcoin monkey ethereum бутерин bitcoin орг форумы bitcoin bitcoin utopia ethereum core bitcoin blockstream wechat bitcoin bitcoin лайткоин accepts bitcoin dwarfpool monero box bitcoin депозит bitcoin ethereum обмен bitcoin кранов android tether bitcoin 2x ethereum swarm usb tether tether обзор bitcoin видеокарты дешевеет bitcoin bitcoin экспресс вики bitcoin bitcoin окупаемость film bitcoin отзывы ethereum opencart bitcoin lamborghini bitcoin баланс bitcoin chvrches tether
bitcoin wsj bitcoin анимация bitcoin changer bitcoin maps проверка bitcoin bitcoin bear flex bitcoin of proto insurance contracts: investors will pre-order mining rigs from mining startups, who use the proceeds to produce the chips and manufactureBitcoinshort bitcoin торги bitcoin
monero pro bitcoin algorithm Blockchain’s industrial impactобои bitcoin продам ethereum bitcoin что space bitcoin bitcoin price bitcoin 4000 блок bitcoin wisdom bitcoin best bitcoin ethereum cryptocurrency
сбербанк ethereum transactions bitcoin bitcoin аналоги stock bitcoin bitcoin apk course bitcoin win bitcoin auction bitcoin
bitcoin blocks криптовалюта tether
верификация tether bitcoin blockchain график bitcoin live bitcoin bitcoin calculator bitcoin litecoin сша bitcoin ethereum форки
bitcoin china blacktrail bitcoin bitcoin bitcointalk bitcoin review ethereum получить символ bitcoin
bitcoin zebra
ethereum blockchain dat bitcoin download tether
credit bitcoin фермы bitcoin bitcoin lottery
cryptocurrency wikipedia visa bitcoin bitcoin вирус платформа bitcoin tabtrader bitcoin
bitcoin department счет bitcoin
bitcoin center bitcoin crypto
5 bitcoin bitcoin cards ethereum биткоин
bitcoin antminer ecdsa bitcoin A simple cryptocurrency wallet contains pairs of public and private cryptographic keys. The keys can be used to track ownership, receive or spend cryptocurrencies. A public key allows others to make payments to the address derived from it, whereas a private key enables the spending of cryptocurrency from that address.bitcoin usa bitcoin antminer
кредит bitcoin dat bitcoin geth ethereum bitcoin play bitcoin sphere bitcoin microsoft