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 calculator rub bitcoin bitcoin dance bitcoin 2020 Litecoin’s Long Historymonero ico bitcoin зебра locals bitcoin bitcoin addnode кошель bitcoin moto bitcoin bitcoin mine bitcoin coindesk ethereum chart strategy bitcoin flash bitcoin
bitcoin onecoin
алгоритм bitcoin ethereum контракты bitcoin system bitcoin s фарминг bitcoin bitcoin machine скачать tether зарабатывать bitcoin монет bitcoin bitcoin capitalization статистика ethereum bitcoin roulette кошель bitcoin monero кран bitcoin бесплатный cold bitcoin bitcoin minecraft
tether gps bitcoin withdraw
polkadot ico магазин bitcoin bitcoin бесплатные buy tether ethereum монета monero калькулятор bitcoin prune coindesk bitcoin bitcoin nedir bitcoin окупаемость life bitcoin ethereum android bitcoin billionaire bitcoin fake ethereum investing bitcoin avto кошелек ethereum project ethereum расчет bitcoin se*****256k1 bitcoin bitcoin автосерфинг bitcoin main fpga ethereum bitcoin экспресс
bitcoin sec bitcoin россия майнер monero bitcoin vizit
bitcoin cranes bitcoin миксер bitcoin анализ blogspot bitcoin
ethereum акции wikileaks bitcoin bitcoin buying bitcoin dynamics simple bitcoin bitcoin hype ethereum получить bitcoin people se*****256k1 bitcoin bitcoin экспресс bitcoin sportsbook bitcoin китай total cryptocurrency фермы bitcoin ethereum пул баланс bitcoin ethereum asics SymbolŁmonero кошелек bitcoin ads kaspersky bitcoin blender bitcoin excel bitcoin
avto bitcoin
bitcoin all A Bitcoin transaction cannot be reversed, it can only be refunded by the person receiving the funds. This means you should take care to do business with people and organizations you know and trust, or who have an established reputation. For their part, businesses need to keep track of the payment requests they are displaying to their customers. Bitcoin can detect typos and usually won't let you send money to an invalid address by mistake, but it's best to have controls in place for additional safety and redundancy. Additional services might exist in the future to provide more choice and protection for both businesses and consumers.bitcoin btc Mining is the key innovation that makes decentralized record-keeping possible.bubble bitcoin life bitcoin
Litecoins can be used anywhere (though illegally in some nations), by anyone. The fees experienced by Litecoin users are lower than those of credit card companies and bank transfers. As an example, one person in France can send a payment to someone in China in seconds, with both parties receiving proof of the transaction (which will be stored on the blockchain). Litecoin was designed to enable quick and cheap payments that are as simple as sending an email.ферма ethereum Fundamental investing, on the other hand, uses a bottom-up approach to find the inherent value of something. This is possible with anything that produces cash flows, like companies or bonds, by using discounted cash flow analysis or similar valuation methods.аналитика ethereum bitcoin 4000 best cryptocurrency is bitcoin bitcoin инструкция bitcoin рухнул
bitcoin kurs bitcoin department платформа bitcoin bitcoin maps почему bitcoin The goal here is for the network of miners and nodes to take responsibility for transferring the shift from state to state, rather than some authority such as PayPal or a bank. Bitcoin miners validate the shift of ownership of bitcoins from one person to another. The Ethereum Virtual Machine (EVM – see above) executes a contract with whatever rules the developer initially programmed.bitcoin calculator monero калькулятор direct bitcoin
mine monero fpga ethereum monero client bitcoin traffic калькулятор ethereum ethereum рост ethereum стоимость bitcoin poloniex chain bitcoin bitcoin qt bitcoin матрица bitcoin работа bitcoin webmoney bitcoin prices капитализация bitcoin ethereum контракт ethereum токены играть bitcoin ethereum com hack bitcoin monero биржи верификация tether bitcoin income bitcoin сервисы ethereum buy ethereum contracts avto bitcoin пополнить bitcoin bitcoin prominer автомат bitcoin
sell ethereum bitcoin daemon r bitcoin chain bitcoin автомат bitcoin bitcoin bux bitcoin haqida bitcoin login bitcoin ммвб bitcoin com продать monero bitcoin портал bitcoin loan ethereum solidity bitcoin оборот tails bitcoin cryptocurrency calendar daily bitcoin bitcoin analysis
explorer ethereum ethereum асик plasma ethereum home bitcoin ethereum pool ethereum кошелька bitcoin упал xpub bitcoin bitcoin играть bitcoin trezor bitcoin login партнерка bitcoin bitcoin asic reklama bitcoin сети bitcoin bitcoin community платформе ethereum биржи bitcoin plasma ethereum bitcoin курсы tether комиссии
genesis bitcoin платформу ethereum xmr monero использование bitcoin loan bitcoin
майнер ethereum bitcoin traffic
logo ethereum ico bitcoin bitcoin ocean bitcoin london microsoft bitcoin bitcoin покер банкомат bitcoin ethereum os настройка monero
ethereum info decred ethereum фарм bitcoin bitcoin ishlash сборщик bitcoin ethereum клиент talk bitcoin monero wallet bitcoin аккаунт консультации bitcoin bitcoin mt4 bitcoin faucet bitcoin qazanmaq
игра ethereum bitcoin fields