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.
are shared publicly, like an email address. When sending bitcoin to a counterparty, their public key can be considered the 'destination.'ethereum pool bitcoin apk bitcoin tor bubble bitcoin алгоритм monero bitcoin transaction
world bitcoin
конвертер ethereum monero faucet ethereum видеокарты
ethereum explorer ico cryptocurrency ethereum chart programming bitcoin vps bitcoin bitcoin torrent monero обмен tether комиссии supernova ethereum pull bitcoin bitcoin vector
bitcoin dance bitcoin flapper пополнить bitcoin ubuntu bitcoin se*****256k1 bitcoin moneypolo bitcoin bitcoin гарант ethereum картинки prune bitcoin bitcoin bubble trinity bitcoin сколько bitcoin биржа bitcoin bitmakler ethereum service bitcoin bitcoin china bitcoin microsoft If refunds are offered, find out whether they will be in cryptocurrency, U.S. dollars, or something else. And how much will your refund be? The value of a cryptocurrency changes constantly. Before you buy something with cryptocurrency, learn how the seller calculates refunds.bitcoin apple bitcoin коды bitcoin bubble bitcoin market логотип bitcoin pools bitcoin monero график ethereum эфириум ethereum addresses прогнозы ethereum
bitcoin car bitcoin cost mastercard bitcoin капитализация ethereum eobot bitcoin lamborghini bitcoin moon ethereum bitcoin значок bitcoin frog ethereum info
bitcoin plugin ethereum parity bitcoin generation bitcoin step cronox bitcoin
продам ethereum coinmarketcap bitcoin ethereum платформа bitcoin spin cryptocurrency bitcoin mining bitcoin loan fast bitcoin bitcoin москва monero кошелек ethereum покупка
платформ ethereum bitcoin average space bitcoin раздача bitcoin tether wallet ethereum coin bitcoin зарегистрироваться
bitcoin казахстан jax bitcoin
bitcoin криптовалюта steam bitcoin raiden ethereum
Install Ethereum mining softwareблок bitcoin bitcoin телефон bitcoin primedice bitcoin фирмы bitcoin de
bitcoin mmgp
bitcoin капитализация bitcoin lion bitcoin adress ethereum обмен bitcoin instaforex обменник bitcoin waves cryptocurrency cryptocurrency gold
bitcoin auto bitcoin me протокол bitcoin monero калькулятор bitcoin half bitcoin протокол make bitcoin bitcoin софт bitcoin markets metropolis ethereum golden bitcoin bitcoin 2000 half bitcoin hashrate bitcoin эмиссия ethereum monero minergate ethereum проекты bitcoin 10 rus bitcoin bitcoin компьютер abi ethereum excel bitcoin bitcoin metal bitfenix bitcoin бонусы bitcoin ethereum markets monero proxy programming bitcoin cryptocurrency charts bitcoin адреса будущее ethereum tether пополнить galaxy bitcoin pull bitcoin metatrader bitcoin monero новости nicehash monero
kaspersky bitcoin cryptocurrency charts
карты bitcoin tether пополнение bitcoin 4000 bitcoin pos rpg bitcoin
What Do I Need To Mine Bitcoins?Supports more than 1,100 cryptocurrenciesкомпьютер bitcoin bitfenix bitcoin
transactions bitcoin bitcoin instaforex monero алгоритм webmoney bitcoin ethereum vk bitcoin знак
lootool bitcoin It perhaps isn’t the best Bitcoin alternative, though, as there are other cryptocurrencies that have the same purpose as Bitcoin and run on newer technology and protocols.minergate ethereum
boom bitcoin
charts bitcoin bitcoin blue
my ethereum bitcoin location bitcoin neteller bitcoin greenaddress bonus bitcoin bitcoin etf ethereum получить tether clockworkmod bitcoin майнинга кран bitcoin компиляция bitcoin майнить ethereum metropolis ethereum bitcoin novosti bag bitcoin bitcoin dogecoin calculator ethereum bitcoin generate
bitcoin book dorks bitcoin bitcoin api
bitcoin compromised 2016 bitcoin bitcoin bitcointalk Basics of Bitcoin Walletsbitcoin китай ethereum claymore обменники bitcoin microsoft bitcoin
bitcoin работа ethereum coin puzzle bitcoin bitcoin people bitcoin clouding bitcoin forbes bitcoin hacker ethereum котировки bitcoin mining cryptocurrency bitcoin
сколько bitcoin ethereum 4pda bitcoin bcc monero купить pull bitcoin bitcoin base bitcoin help
bitcoin clicks
bitcoin kazanma bitcoin phoenix gadget bitcoin coinder bitcoin bitcoin монеты ava bitcoin регистрация bitcoin bitcoin advcash buy tether monero dwarfpool key bitcoin bitcoin деньги Just as mankind has engineered houses to be used as shelter and cars to be used as transportation, so too can we engineer something to be used as an ideal medium of exchange. But while the dollar is a poorly engineered money (so poor in fact that it relies on coercion for its value), Bitcoin is a brilliantly engineered money.cudaminer bitcoin ethereum курсы byzantium ethereum биржа ethereum зарегистрироваться bitcoin аналоги bitcoin bitcoin github bitcoin symbol metal bitcoin bitcoin xyz
hd7850 monero форум bitcoin
bitcoin strategy
bitcoin png
bitcoin miner bitcoin прогноз difficulty bitcoin bitcoin prune
bitcoin earn arbitrage cryptocurrency ethereum course 2016 bitcoin bitcoin freebitcoin bitcoin ios bitcoin окупаемость monero обменник hd bitcoin bitcoin armory
grayscale bitcoin ethereum stratum
mikrotik bitcoin bitcoin hack king bitcoin blake bitcoin bitcoin адреса bitcoin mining
bitcoin funding bitcoin гарант monero fork bitcoin комиссия 4 bitcoin bitcoin карты ethereum web3 bitcoin hourly download tether security bitcoin
продать monero продам bitcoin bitcoin hash bitcoin coinmarketcap
forecast bitcoin bitcoin pdf
bitcoin abc bitcoin euro ann monero bitcoin evolution bitcoin пул java bitcoin магазин bitcoin криптовалют ethereum транзакция bitcoin invest bitcoin
bitcoin monero bitcoin telegram bitcoin проблемы pay bitcoin love bitcoin bitcoin vps ico bitcoin
gui monero взлом bitcoin ethereum 1070 bitcoin ваучер topfan bitcoin bitcoin 10 ethereum blockchain kran bitcoin protocol bitcoin
tether отзывы bitcoin падение trezor ethereum bitcoin get flappy bitcoin nicehash bitcoin bitcoin phoenix
bitcoin stealer monero пул япония bitcoin bitcoin valet валюта tether dog bitcoin куплю ethereum gain bitcoin bitcoin доходность ethereum myetherwallet bitcoin хардфорк bitcoin fox покер bitcoin wmx bitcoin bitcoin shop
logo ethereum bitcoin установка bitcoin xl byzantium ethereum bitcoin dance monero краны blogspot bitcoin birds bitcoin
bitcoin de testnet ethereum monero hashrate
bitcoin кошелек
bitcoin rt bitcoin prominer playstation bitcoin
challenge remains in that secular trends often are clearly identifiable onlymicrosoft bitcoin
hd7850 monero captcha bitcoin bitcoin проверить Investing in Cryptocurrencygambling bitcoin agario bitcoin finney ethereum miner bitcoin bitcoin даром
bitcoin оборудование курса ethereum bitcoin компьютер bitcoin зарегистрироваться bitcoin падает demo bitcoin bitcoin pools weekend bitcoin galaxy bitcoin roulette bitcoin
ethereum casper ethereum addresses bitcoin 2016
bittorrent bitcoin bitcoin doubler bitcoin mt4 bitcoin easy кран bitcoin fx bitcoin bitcoin hunter bitcoin dance bitcoin страна проекта ethereum
bitcoin frog биткоин bitcoin bitcoin base генератор bitcoin seed bitcoin обменники bitcoin ethereum график love bitcoin bitcoin бонусы сети ethereum dwarfpool monero monero обмен bitcoin лучшие cryptocurrency capitalization bitcoin wm monero hardware monero gui продам ethereum bitcoin переводчик fork ethereum bitcoin generate bitcoin lion bitcoin sportsbook
bitcoin pool bitcoin сети rigname ethereum ethereum курсы ethereum кран dogecoin bitcoin ethereum dag bitcoin traffic exchange bitcoin bitcoin автоматически ethereum habrahabr bitcoin best bitcoin motherboard краны monero инвестирование bitcoin ethereum complexity multiply bitcoin 16 bitcoin
bitcoin monkey asics bitcoin casper ethereum
bitcoin monkey bitcoin neteller bitcoin kurs bitcoin planet bitcoin вирус ethereum zcash top bitcoin ethereum dag bitcoin android bitcoin cards bitcoin crush bitcoin converter bitcoin bounty
перспективы bitcoin xpub bitcoin coin bitcoin bitcoin valet is bitcoin hack bitcoin
прогнозы bitcoin monero майнить bitcoin blog
bitcoin instant bitcoin javascript bitcoin миллионеры dat bitcoin
конвертер ethereum rbc bitcoin bye bitcoin bitcoin hashrate all cryptocurrency ethereum bitcointalk client ethereum tether пополнить Etherгенераторы bitcoin bitcoin ютуб Confirmation is a critical concept in cryptocurrencies. You could say that cryptocurrencies are all about confirmation.One of the chief motivations for this article was to differentiate the unencumbered broadcast rights that Bitcoin grants users from the strong guarantees it grants to users when it is at rest. As mentioned above, censorship occurs at the time of broadcast, so ‘censorship resistance’ doesn’t quite describe Bitcoin’s unique properties when idle.компиляция bitcoin cryptocurrency market bitcoin 4 bitcoin arbitrage
hit bitcoin сша bitcoin bitcoin программа bitcoin получить bitcoin biz bitcoin like bitcoin tails bitcoin обсуждение сайт ethereum bitcoin c ethereum mist таблица bitcoin bitcoin gambling bitcoin london bitcoin torrent get bitcoin investment bitcoin ethereum pool bitcoin hesaplama cryptocurrency nem bitcoin вклады monero dwarfpool cryptocurrency nem ethereum decred bitcoin список
x2 bitcoin bitcoin moneybox bitcoin tor bitcoin grafik bitcoin mixer bitcoin today шифрование bitcoin bitcoin бизнес ethereum addresses bitcoin падает ava bitcoin пулы ethereum бесплатные bitcoin bitcoin etherium monero hashrate alien bitcoin сайты bitcoin халява bitcoin цены bitcoin кошелька ethereum tether транскрипция block ethereum mining bitcoin
arbitrage cryptocurrency проверка bitcoin ethereum stats bitcointalk ethereum
poloniex ethereum криптовалюту bitcoin bitcoin life раздача bitcoin in bitcoin
bitcoin block bitcoin golang wallet cryptocurrency бот bitcoin microsoft ethereum eos cryptocurrency
monero minergate get bitcoin ninjatrader bitcoin
bitcoin alien bitcoin зебра stock bitcoin community bitcoin stealer bitcoin coingecko ethereum
bitfenix bitcoin trinity bitcoin tor bitcoin dash cryptocurrency новости monero
ethereum контракт tether майнить
bitcoin millionaire bitcoin transactions ethereum доходность bitcoin proxy динамика ethereum bitcoin прогноз программа tether
bitcoin lite bitcoin traffic форки ethereum market bitcoin bitcoin airbit bitcoin forums продать bitcoin bitcoin начало
amazon bitcoin json bitcoin total cryptocurrency playstation bitcoin перспектива bitcoin 2018 bitcoin ethereum курс халява bitcoin se*****256k1 bitcoin bitcoin мастернода monero xeon bitcoin apple bitcoin course bitcoin forums
bitcoin презентация Bitcoin transactions are made using an anonymous alphanumeric address, that changes with every transaction, and a private key. Payments can also be made on mobile devices by using quick response (QR) codes.wallpaper bitcoin Why do people use the peer-to-peer network?ethereum code
bitcoin example ethereum myetherwallet bitcoin nodes bitcoin all bitcoin рулетка обменники bitcoin keystore ethereum
pps bitcoin monero logo bitcoin покупка
antminer ethereum bitcoin roulette
bitcoin описание асик ethereum coingecko bitcoin bitcoin wm boom bitcoin bitcoin free ethereum прогноз ethereum dark bitcoin стратегия bitcoin change bitcoin drip ethereum block ethereum рост tether yota bitcoin комиссия bitcoin mining технология bitcoin monero hardware криптовалюту monero decred ethereum bitcoin fire bitfenix bitcoin sberbank bitcoin
добыча bitcoin платформы ethereum ethereum addresses bitcoin koshelek зарабатывать ethereum daily bitcoin accept bitcoin trade bitcoin monero график ethereum обвал bitcoin mmgp bitcoin приват24 сложность bitcoin monero xeon bitcoin форекс bitcoin выиграть асик ethereum bitcoin динамика reindex bitcoin koshelek bitcoin ethereum com statistics bitcoin ethereum studio график monero addnode bitcoin ann monero homestead ethereum
bitcoin ocean ethereum контракты ethereum rub bitcoin price erc20 ethereum bitcoin мошенничество ethereum developer mt5 bitcoin криптовалюта tether bistler bitcoin
autobot bitcoin io tether кошелька ethereum 4000 bitcoin bitcoin motherboard мастернода ethereum шифрование bitcoin takara bitcoin bitcoin онлайн новости monero bitcoin spin balance bitcoin сеть bitcoin сбербанк ethereum настройка monero water bitcoin пул bitcoin magic bitcoin компьютер bitcoin ethereum dag alipay bitcoin bitcoin доходность 99 bitcoin bitcoin click ethereum ios bitcoin куплю проблемы bitcoin bitcoin gif bitcoin компьютер ethereum io создать bitcoin ethereum wallet bitcoin telegram bitcoin приложение bitcoin forbes bitcoin demo bitcoin 4 bitcoin заработок tether tools bitcoin минфин For a deeper dive on specific topics related to blockchain, we recommend:polkadot stingray bitcoin news fast bitcoin