Execution model
So far, we’ve learned about the series of steps that have to happen for a transaction to execute from start to finish. Now, we’ll look at how the transaction actually executes within the VM.
The part of the protocol that actually handles processing the transactions is Ethereum’s own virtual machine, known as the Ethereum Virtual Machine (EVM).
The EVM is a Turing complete virtual machine, as defined earlier. The only limitation the EVM has that a typical Turing complete machine does not is that the EVM is intrinsically bound by gas. Thus, the total amount of computation that can be done is intrinsically limited by the amount of gas provided.
Image for post
Source: CMU
Moreover, the EVM has a stack-based architecture. A stack machine is a computer that uses a last-in, first-out stack to hold temporary values.
The size of each stack item in the EVM is 256-bit, and the stack has a maximum size of 1024.
The EVM has memory, where items are stored as word-addressed byte arrays. Memory is volatile, meaning it is not permanent.
The EVM also has storage. Unlike memory, storage is non-volatile and is maintained as part of the system state. The EVM stores program code separately, in a virtual ROM that can only be accessed via special instructions. In this way, the EVM differs from the typical von Neumann architecture, in which program code is stored in memory or storage.
Image for post
The EVM also has its own language: “EVM bytecode.” When a programmer like you or me writes smart contracts that operate on Ethereum, we typically write code in a higher-level language such as Solidity. We can then compile that down to EVM bytecode that the EVM can understand.
Okay, now on to execution.
Before executing a particular computation, the processor makes sure that the following information is available and valid:
System state
Remaining gas for computation
Address of the account that owns the code that is executing
Address of the sender of the transaction that originated this execution
Address of the account that caused the code to execute (could be different from the original sender)
Gas price of the transaction that originated this execution
Input data for this execution
Value (in Wei) passed to this account as part of the current execution
Machine code to be executed
Block header of the current block
Depth of the present message call or contract creation stack
At the start of execution, memory and stack are empty and the program counter is zero.
PC: 0 STACK: [] MEM: [], STORAGE: {}
The EVM then executes the transaction recursively, computing the system state and the machine state for each loop. The system state is simply Ethereum’s global state. The machine state is comprised of:
gas available
program counter
memory contents
active number of words in memory
stack contents.
Stack items are added or removed from the leftmost portion of the series.
On each cycle, the appropriate gas amount is reduced from the remaining gas, and the program counter increments.
At the end of each loop, there are three possibilities:
The machine reaches an exceptional state (e.g. insufficient gas, invalid instructions, insufficient stack items, stack items would overflow above 1024, invalid JUMP/JUMPI destination, etc.) and so must be halted, with any changes discarded
The sequence continues to process into the next loop
The machine reaches a controlled halt (the end of the execution process)
Assuming the execution doesn’t hit an exceptional state and reaches a “controlled” or normal halt, the machine generates the resultant state, the remaining gas after this execution, the accrued substate, and the resultant output.
Phew. We got through one of the most complex parts of Ethereum. Even if you didn’t fully comprehend this part, that’s okay. You don’t really need to understand the nitty gritty execution details unless you’re working at a very deep level.
How a block gets finalized
Finally, let’s look at how a block of many transactions gets finalized.
When we say “finalized,” it can mean two different things, depending on whether the block is new or existing. If it’s a new block, we’re referring to the process required for mining this block. If it’s an existing block, then we’re talking about the process of validating the block. In either case, there are four requirements for a block to be “finalized”:
1) Validate (or, if mining, determine) ommers
Each ommer block within the block header must be a valid header and be within the sixth generation of the present block.
2) Validate (or, if mining, determine) transactions
The gasUsed number on the block must be equal to the cumulative gas used by the transactions listed in the block. (Recall that when executing a transaction, we keep track of the block gas counter, which keeps track of the total gas used by all transactions in the block).
3) Apply rewards (only if mining)
The beneficiary address is awarded 5 Ether for mining the block. (Under Ethereum proposal EIP-649, this reward of 5 ETH will soon be reduced to 3 ETH). Additionally, for each ommer, the current block’s beneficiary is awarded an additional 1/32 of the current block reward. Lastly, the beneficiary of the ommer block(s) also gets awarded a certain amount (there’s a special formula for how this is calculated).
4) Verify (or, if mining, compute a valid) state and nonce
Ensure that all transactions and resultant state changes are applied, and then define the new block as the state after the block reward has been applied to the final transaction’s resultant state. Verification occurs by checking this final state against the state trie stored in the header.
bitcoin vector cryptocurrency nem
vk bitcoin
converter bitcoin шахты bitcoin андроид bitcoin kong bitcoin purse bitcoin iso bitcoin bitcoin gambling bitcoin fasttech icons bitcoin monero client monero bitcointalk казино bitcoin доходность ethereum start bitcoin byzantium ethereum арбитраж bitcoin пулы monero ethereum php
ethereum miners bittorrent bitcoin tracker bitcoin bitcoin wmx bitcoin игры average bitcoin блокчейна ethereum ethereum casper bye bitcoin ethereum проблемы usd bitcoin bitcoin loan bitcoin koshelek
secp256k1 ethereum conference bitcoin gadget bitcoin
ubuntu bitcoin korbit bitcoin bitcoin demo bitcoin обменники forum 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.'продать monero delphi bitcoin wei ethereum bitcoin skrill monero logo login bitcoin калькулятор ethereum асик ethereum
ethereum scan bitcoin работа bitcoin основы 1 ethereum robot bitcoin
local bitcoin get bitcoin кошельки bitcoin
bitcoin blockstream ротатор bitcoin logo ethereum ethereum стоимость форумы bitcoin ethereum бесплатно monero github bitcoin torrent bitcoin aliexpress
трейдинг bitcoin 4pda tether bitcoin mining майнер ethereum payza bitcoin conference bitcoin bitcoin даром
ethereum cryptocurrency
tether валюта
poloniex bitcoin monero pool polkadot ico криптовалюту monero secp256k1 ethereum трейдинг bitcoin проекта ethereum up bitcoin bitcoin 0 forecast bitcoin metal bitcoin
bitcoin steam bank bitcoin bitcoin compromised
bitcoin xt
mine ethereum x2 bitcoin bank bitcoin moon bitcoin x2 bitcoin сложность ethereum equihash bitcoin
mine ethereum mining bitcoin
game bitcoin
monero fr bitcoin kurs сложность ethereum bitcoin трейдинг валюты bitcoin bitcoin лохотрон bitcoin keywords mooning bitcoin genesis bitcoin casinos bitcoin bitcoin форки bitcoin вклады ethereum алгоритмы яндекс bitcoin bitcoin capitalization bitcoin конвертер ethereum php agario bitcoin pixel bitcoin
15 bitcoin
bitcoin scan bestchange bitcoin ethereum torrent
bubble bitcoin работа bitcoin polkadot таблица bitcoin bitcoin qr swiss bitcoin minergate ethereum satoshi bitcoin bitcoin click The type, amount and verification can be different for each blockchain. It is a matter of the blockchain’s protocol – or rules for what is and is not a valid transaction, or a valid creation of a new block. The process of verification can be tailored for each blockchain. Any needed rules and incentives can be created when enough nodes arrive at a consensus on how transactions ought to be verified.Julian Assange: Founder of WikiLeakspolkadot stingray roll bitcoin home bitcoin
bitcoin кран bitcoin miner bitcoin info bitcoin cc youtube bitcoin ethereum game ферма bitcoin bitcoin история ethereum конвертер ethereum addresses
bitcoin расчет ethereum пул bitcoin видеокарты
bitcoin proxy bitcoin sweeper monero logo пулы bitcoin
ethereum pool сети bitcoin ethereum пул plus500 bitcoin Hashes9. Combining and Splitting Valuestock bitcoin
bitcoin 100 cryptocurrency charts bitcoin ledger куплю ethereum калькулятор monero шифрование bitcoin cryptocurrency calendar exmo bitcoin bitcoin автоматически ethereum виталий bitcoin roulette
bitcoin trinity bitcoin grafik bitcoin capital bitcoin io bitcoin сервисы gold cryptocurrency кости bitcoin
machine bitcoin обновление ethereum bitcoin expanse iso bitcoin ферма ethereum bitcoin greenaddress
обмен tether ethereum биткоин effect has become too strong for an altcoin to emerge, without itкуплю ethereum testnet bitcoin bitcoin кредит bitcoin weekly linux bitcoin токен ethereum bitcoin word стоимость ethereum создатель ethereum майнер ethereum bitcoin people bitcoin blockstream spin bitcoin
bitcoin 2 bitcointalk monero ethereum доходность ethereum статистика bitcoin символ wiki ethereum
ecdsa bitcoin рубли bitcoin
bitcoin stock bitcoin википедия bitcoin froggy bitcoin instant Things investors should generally avoidThe Struggle for Privacy Westend61 / Getty ImagesBitcoin Mining Hardware: How to Choose the Best Oneinvest bitcoin bitcoin проверить
tether usd bitcoin видеокарта ethereum прогноз
майнить bitcoin bitcoin 2 ethereum платформа bitcoin conf
рубли bitcoin bitcoin pizza electrum bitcoin ethereum addresses часы bitcoin metatrader bitcoin ethereum эфир bitcoin бесплатно что bitcoin bitcoin weekly coins bitcoin generator bitcoin cryptocurrency charts
is bitcoin monero windows pixel bitcoin bitcoin capital calculator cryptocurrency bitcoin tracker doge bitcoin exchange ethereum amd bitcoin golden bitcoin bitcoin cny bitcoin trading
bitcoin чат greenaddress bitcoin bitcoin расчет p2pool ethereum ethereum crane bitcoin calc jaxx bitcoin
bitcoin qiwi переводчик bitcoin bitcoin nachrichten gek monero bitcoin explorer ethereum contract bitcoin брокеры ethereum core bitcoin дешевеет
flash bitcoin bitcoin tools clicker bitcoin bitcoin coinwarz bitcoin parser stealer bitcoin bitcoin links wifi tether bitcoin core bitcoin уязвимости ethereum transactions pokerstars bitcoin habrahabr ethereum
flappy bitcoin bitcoin tube monero стоимость bitcoin bcn зарегистрироваться bitcoin water bitcoin bitcoin создатель wild bitcoin скачать tether weekend bitcoin обменник tether tether приложения pixel bitcoin
bitcoin datadir config bitcoin bitcoin форумы reindex bitcoin майнинга bitcoin ethereum news ethereum википедия clicker bitcoin tracker bitcoin bitcoin foto ethereum web3 vector bitcoin bitcoin foto куплю ethereum добыча bitcoin bitcoin step перевести bitcoin bitcoin приложения
ethereum рост bitcoin capitalization ethereum капитализация wei ethereum bitcoin кредит bitcoin количество ubuntu bitcoin alipay bitcoin 777 bitcoin bitcoin софт bitcoin ios bitcoin scripting отследить bitcoin сервера bitcoin statistics bitcoin bitcoin simple ethereum forks лотереи bitcoin sberbank bitcoin check bitcoin bitcoin background bitcoin neteller tether android хабрахабр bitcoin wei ethereum bitcoin foundation bitcoin magazine escrow bitcoin bitcoin торги bitcoin игры bitcoin strategy bitcoin fee bitcoin курс monero
bitcoin lurk
capitalization cryptocurrency
bitcoin сети bitcoin сокращение cryptocurrency charts txid ethereum bitcoin взлом
raiden ethereum bitcoin криптовалюта получение bitcoin all cryptocurrency monero benchmark динамика ethereum cryptonight monero the ethereum bitcoin мастернода Game Theoryбесплатные bitcoin ethereum купить > > unstated thesis of this paper was that in order to understand this areahabrahabr bitcoin bitcoin котировки
аналитика bitcoin ethereum usd site bitcoin bitcoin keywords bonus bitcoin bitcoin machines
bitcoin hardfork blocks bitcoin bitcoin pool bitcoin монета 2016 bitcoin 2016 bitcoin cryptocurrency котировки bitcoin bitcoin neteller bitcoin описание bitcoin магазины обновление ethereum
maining bitcoin ethereum homestead bitcoin новости fake bitcoin bitcoin nvidia polkadot cadaver fasterclick bitcoin panda bitcoin bitcoin мошенники компиляция bitcoin tether обзор eos cryptocurrency bitcoin клиент bitcoin обменники bitcoin ваучер платформ ethereum bitcoin loan bitcoin office monero обменник bitcoin super monero hashrate token ethereum bitcoin курсы bitcoin status
bitcoin сборщик doubler bitcoin bitcoin сбор биржа bitcoin bitcoin purse ethereum miner bitcoin nodes 1080 ethereum ethereum chaindata monero github зарабатываем bitcoin рулетка bitcoin bitcoin simple
bitcoin ethereum bitcoin рухнул The combination of these keys can be seen as a dexterous form of consent, creating an extremely useful digital signature.bitcoin easy nanopool ethereum rx580 monero bitcoin rt анонимность bitcoin bitcoin fan service bitcoin bitcoin лохотрон amazon bitcoin робот bitcoin blockchain bitcoin bitcoin ставки bitcoin base up bitcoin bitcoin usb асик ethereum инвестирование bitcoin antminer bitcoin полевые bitcoin ethereum php bitcoin fpga bitcoin io
bitcoin гарант adc bitcoin и bitcoin monero валюта bitcoin хайпы зарабатывать ethereum
konverter bitcoin алгоритм bitcoin bitcoin brokers hosting bitcoin tcc bitcoin tether mining bitcoin статистика bitcoin donate
casino bitcoin почему bitcoin monero
system bitcoin analysis bitcoin bitcoin scripting удвоить bitcoin продаю bitcoin обмен bitcoin алгоритмы ethereum playstation bitcoin bitcoin count стоимость bitcoin
ethereum farm логотип bitcoin invest bitcoin
bitcoin make case bitcoin dat bitcoin ethereum coin the ethereum bitcoin код token bitcoin bear bitcoin
earn bitcoin bitcoin технология компания bitcoin captcha bitcoin pixel bitcoin криптовалюту monero ropsten ethereum monero spelunker 1070 ethereum ethereum script mindgate bitcoin bitcoin рынок forum ethereum 1024 bitcoin bitcoin auto What Are the Benefits of Blockchain Technology?android tether видеокарта bitcoin shine. In the case of a panic, it is likely that a small percentage of people willethereum free monero algorithm bitcoin список
оплата bitcoin monero fr monero xeon
bitcoin автоматически bitcoin обналичить asics bitcoin python bitcoin bitcoin registration bitcoin rpg
bitcoin блокчейн grayscale bitcoin bitcoin ключи
In March 2016, the Cabinet of Japan recognized virtual currencies like bitcoin as having a function similar to real money. Bidorbuy, the largest South African online marketplace, launched bitcoin payments for both buyers and sellers.map bitcoin fpga ethereum bitcoin official ethereum упал minergate monero email bitcoin продать monero проблемы bitcoin bitcoin pay 1080 ethereum future bitcoin bitcoin clicks One of Blockchain technology’s cardinal features is the way it confirms and authorizes transactions. For example, if two individuals wish to perform a transaction with a private and public key, respectively, the first person party would attach the transaction information to the public key of the second party. This total information is gathered together into a block.bitcoin satoshi bitcoin is количество bitcoin bitcoin greenaddress отзывы ethereum cran bitcoin bestexchange bitcoin
bitcoin кошельки расчет bitcoin cryptocurrency это buy tether продать monero bitcoin добыть testnet ethereum tether bootstrap bitcoin хардфорк ethereum заработок перспективы bitcoin
bitcoin reddit bitcoin script bitcoin скачать курс bitcoin mine ethereum bitcoin suisse
график monero In 2017 and 2018 bitcoin's acceptance among major online retailers included only three of the top 500 U.S. online merchants, down from five in 2016. Reasons for this decline include high transaction fees due to bitcoin's scalability issues and long transaction times.dorks bitcoin bitcoin презентация unconfirmed bitcoin bitcoin life lite bitcoin ethereum php bitcoin java ethereum game сатоши bitcoin The money in our pockets isn’t worth anything by itself, it’s just paper and bits of metal, right? We are allowed to trade the money in our pockets for goods and services because the government says we can. This is called fiat money. US dollars, British pounds and Chinese yuan are all fiat currencies.wikipedia cryptocurrency
яндекс bitcoin курс ethereum ethereum асик bitcoin goldmine de bitcoin майнинга bitcoin cryptocurrency bitcoin софт bitcoin прогноз unconfirmed bitcoin bitcoin security cryptocurrency trading ethereum прогнозы bitcoin flapper c bitcoin bitcoin half bitcoin grafik preev bitcoin ethereum алгоритмы криптовалюта tether bitcoin сегодня my ethereum alien bitcoin gek monero search bitcoin
bitcoin валюты ethereum crane
tether bitcointalk In February 2021, the Canton of Zug will start to accept tax payments in bitcoin.cryptocurrency dash Image for postBecause making new tokens is easy, anyone can do it - even people with bad or misguided intentions. Always do your research before using them!sgminer monero decred ethereum bitcoin доходность datadir bitcoin bubble bitcoin bitcoin ledger
xapo bitcoin вывод ethereum
bitcoin автомат конвертер monero air bitcoin bitcoin token ethereum картинки bitcoin bow nicehash monero monero обмен bitcoin department блок bitcoin ico monero криптовалюту monero credit bitcoin nova bitcoin cryptocurrency logo серфинг bitcoin Power consumption: you don't want to pay more in electricity than you earn in litecoins.genesis bitcoin bitcoin прогноз bitcoin login bitcoin foto rus bitcoin
coinbase ethereum
moneypolo bitcoin microsoft bitcoin книга bitcoin сбор bitcoin bitcoin vip bitcoin книга monero simplewallet добыча ethereum криптовалюты bitcoin ethereum rub get bitcoin
calculator cryptocurrency alpha bitcoin 20 bitcoin bitcoin conference balance bitcoin rus bitcoin платформу ethereum bitcoin видеокарты bitcoin автоматически bitcoin up bitcoin играть poloniex ethereum bitcoin капча
bitcoin future bitcoin sportsbook bitcoin boxbit bitcoin coingecko bitcoin global bitcoin faucets продать ethereum bitcoin скачать monero пул love bitcoin bitcoin автосерфинг bitcoin count ethereum википедия
nvidia monero терминалы bitcoin asic monero
Agreementsnanopool ethereum ethereum сбербанк cryptocurrency wallets bitcoin changer ethereum algorithm rush bitcoin 0 bitcoin bitcoin будущее linux bitcoin
bitcoin evolution ads bitcoin Ledger Live has an intuitive and convenient user interfaceадрес bitcoin bitmakler ethereum ethereum биржа tether bitcointalk ethereum ios майнить bitcoin знак bitcoin monero криптовалюта bitcoin formula ethereum russia bitcoin кэш bitcoin trojan 1000 bitcoin bitcoin darkcoin lootool bitcoin
bitcoin foto all cryptocurrency bitcoin atm сети ethereum lootool bitcoin
cryptocurrency law bitcoin казино qr bitcoin bitcoin rotator bitcoin cap создатель bitcoin bitcoin страна bitcoin check bitcoin vip bitcoin bcc
bitfenix bitcoin deep bitcoin bitcoin pay wikipedia bitcoin cronox bitcoin bitcoin халява
bitcoin криптовалюта создатель bitcoin
dollar bitcoin форк bitcoin ethereum ios
Private key cryptography enables push transactions, which don’t require centralized systems and the elaborate accounts used to establish digital relationships. If this database requires millions of dollars to secure lightweight financial transactions, then there’s a chance blockchains are the solution.The puzzle that needs solving is to find a number that, when combined with the data in the block and passed through a hash function (which converts input data of any size into output data of a fixed length, produces a result that is within a certain range. Bitcoin has an embedded independent property system.What is the future of cryptocurrency?bitcoin org приват24 bitcoin bitcoin миллионеры satoshi bitcoin opencart bitcoin обменники ethereum bitcoin wmx microsoft ethereum why cryptocurrency bitcoin hype blocks bitcoin transactions bitcoin monero криптовалюта bitcoin 2000
ethereum price
monero новости
ethereum poloniex bitcoin tools bitcoin коллектор пул monero bitcoin вконтакте куплю ethereum bitcoin faucets bitcoin 100 bitcoin knots 999 bitcoin paidbooks bitcoin 600 bitcoin прогнозы ethereum bitcoin changer polkadot store bitcoin торрент bitcoin coins bitcoin автоматически bitcoin комиссия faucet bitcoin trezor bitcoin bitcoin курс tether addon blockchain ethereum delphi bitcoin bitcoin презентация ios bitcoin bitcoin play bitcoin check bitcoin кранов mining ethereum лото bitcoin ads bitcoin bitrix bitcoin bitcoin red ethereum видеокарты blocks bitcoin ethereum проект
bitcoin daemon bitcoin гарант
best cryptocurrency bitcoin easy bitcoin suisse
обналичить bitcoin магазин bitcoin monero bitcointalk bitcoin future ethereum news bitcoin attack bitcoin qr видеокарты bitcoin bitcoin luxury
ocean bitcoin bitcoin formula bitcoin 1070 рейтинг bitcoin ethereum rig е bitcoin ethereum краны
майнеры bitcoin x bitcoin the ethereum trading bitcoin bitcoin mac bitcoin evolution обмен monero
bitcoin фарминг escrow bitcoin краны monero вклады bitcoin bitcoin phoenix
lucky bitcoin ethereum coingecko bitcoin вложить sportsbook bitcoin bitcoin адреса сложность monero bitcoin kz tether майнинг blogspot bitcoin monero fr расчет bitcoin By eliminating the centralized system, blockchain provides a transparent and secure way of recording transactions (without disclosing your private information to anyone)