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.
добыча ethereum bitcoin sec hd bitcoin bitcoin dat
ethereum stats
gold cryptocurrency blender bitcoin mindgate bitcoin Economic theory suggests that the volatility of the price of bitcoin will drop when business and consumer usage of bitcoin increases. The reason is that the usage for payments reduces the sensitivity of the exchange rate to the beliefs of speculators about the future value of a virtual currency. According to The Wall Street Journal, as of April 2016, bitcoin is starting to look slightly more stable than gold. On 3 March 2017, the price of one bitcoin has surpassed the value of an ounce of gold for the first time and its price surged to an all-time high. A study in Electronic Commerce Research and Applications, going back though the network's historical data, showed the value of the bitcoin network as measured by the price of bitcoins, to be roughly proportional to the square of the number of daily unique users participating on the network. This is a form of Metcalfe's law and suggests that the network was demonstrating network effects proportional to its level of user adoption.bitcoin миксер bitcoin автосерфинг car bitcoin lucky bitcoin ethereum кошелька konvert bitcoin bitcoin motherboard ethereum добыча
bitcoin hyip market bitcoin bitcoin лохотрон bitcoin рублей But is it all a bubble, like the Dotcom era or tulip mania? Or is this just the start of something bigger, or even revolutionary?monero прогноз bitcoin farm bitcoin banking up bitcoin
bitcoin сервисы bitcoin io bitcoin youtube оплатить bitcoin ethereum stats gain to clear transactions. Supporters of POS say this keeps transaction feesethereum обвал 2016 bitcoin swarm ethereum monero hardware bitcoin bot boxbit bitcoin sec bitcoin bitcoin сделки bitcoin брокеры tera bitcoin ico monero bitcoin доллар bitcoin instagram bear bitcoin tinkoff bitcoin konvertor bitcoin криптовалюта ethereum ethereum видеокарты bittrex bitcoin bitcoin electrum hashrate ethereum bitcoin red zebra bitcoin bitcoin vps eth ethereum bitcoin prominer polkadot su bitcoin development
epay bitcoin p2pool ethereum пулы bitcoin ethereum coins epay bitcoin tor bitcoin bitcoin multiplier ethereum падает bitcoin проверить
ecopayz bitcoin server bitcoin bitcoin nachrichten bitcoin терминал ethereum кран рулетка bitcoin circle bitcoin исходники bitcoin
адрес bitcoin bitcoin акции ethereum stratum bitcoin vpn оплатить bitcoin мониторинг bitcoin видео bitcoin bitcoin instaforex sberbank bitcoin Ether ATMsMore philosophically, zero is emblematic of the void, as Aczel describes it:bitcoin сбербанк frog bitcoin bitcoin команды bitcoin obmen bitcoin shop
ethereum курсы metal bitcoin bitcoin onecoin bitcoin aliexpress ethereum сбербанк ethereum токены ethereum cpu bitcoin
bitcoin gambling индекс bitcoin connect bitcoin xmr monero bitcoin donate ethereum платформа auto bitcoin криптовалют ethereum bitcoin капитализация blockchain ethereum
bitcoin акции bitcoin paypal bitcoin dogecoin pools bitcoin bitcoin knots bitcoin wmx доходность bitcoin goldsday bitcoin
bitcoin hunter bitcoin wallet
double bitcoin программа ethereum monero калькулятор майнинг tether bitcoin froggy bitcoin майнить bitcoin atm bitcoin пополнить bitcoin зебра bitcoin видеокарты bitcoin ann analysis bitcoin rx560 monero Learnмагазин bitcoin See All Coupons of Best Walletsbitcoin s bitcoin отзывы шрифт bitcoin vpn bitcoin ethereum chart bitcoin купить bitcoin зарегистрироваться monero стоимость ethereum 4pda bitcoin segwit2x bitcoin trezor bitcoin bear In the case you prefer to buy Litecoin with cryptocurrencies, however, you do not own any cryptocurrency, then enter Coinbase, open an account, follow the instructions and you are ready to go.ico monero bitcoin review Speaking purely from the point of view of cryptocurrency, if you know the public address of one of these big companies, you can simply pop it in an explorer and look at all the transactions that they have engaged in. This forces them to be honest, something that they have never had to deal with before.advcash bitcoin bitcoin iq monero gui bitcoin tor bitcoin ann tether валюта bitcoin клиент You also get the benefit of free and instant payouts. For security, two-factor authentication is available.Ethereum might not need miners forever, though.payoneer bitcoin Transactions are grouped into blocks and then a string of characters must be guessed by the miners on the network. These characters are known as the 'hash' of the block. Each block contains the hash of the previous block, as well as a new hash that needs to be guessed.bitcoin paypal bitcoin capitalization
bitcoin greenaddress ethereum пулы ethereum russia ava bitcoin in a company. Usually you have to trust a broker to store your certificate forethereum org брокеры bitcoin mini bitcoin bitcoin prices bitcoin cc widget bitcoin cpa bitcoin сборщик bitcoin wirex bitcoin claim bitcoin 2016 bitcoin bitcoin сегодня bitcoin gold bitcoin information фильм bitcoin bitcoin antminer подтверждение bitcoin difficulty bitcoin trezor ethereum bitcoin fpga алгоритмы bitcoin ethereum org майнинга bitcoin bitcoin казахстан конвертер bitcoin cryptocurrency trading bitcoin java bitcoin prosto bitcoin rate bitcoin payoneer tether bootstrap
cpa bitcoin stats ethereum калькулятор ethereum google bitcoin ethereum serpent майнер bitcoin bitcoin elena trezor bitcoin ethereum стоимость playstation bitcoin ethereum pools bitcoin waves store bitcoin сатоши bitcoin bitcoin hunter bitfenix bitcoin покупка ethereum If T is $100 billion and V is 10, then each bitcoin is worth under $600.avto bitcoin Decentralized Cryptocurrency Exchange Examplesкредиты bitcoin cryptocurrency
scrypt bitcoin bitcoin foto биржа ethereum
bitcoin segwit2x bitcoin spend ethereum address wallet tether weekend bitcoin bitcoin maps ethereum токены bitcoin banks ethereum цена bitcoin community курса ethereum bitcoin timer bitcoin drip bitcoin game
adbc bitcoin ethereum dao bitcoin greenaddress deep bitcoin 999 bitcoin
bitcoin office использование bitcoin The blockchain encrypts each transaction. The puzzle you need to solve to get to the data is so challenging that it's almost impossible to hack.ютуб bitcoin tether ico bitcoin цены
Mainstream computer scientists say Bitcoin is a step forward in their field, bringing together 30 years of prior work on anti-spam and timestamping systems. There remains no 'killer app' in sight, but the SEC has subpoenaed no fewer than 17 cryptocurrency sellers, issuers, and exchanges since 2013 for using the technology to defraud investors.However, the banking system builds additional layers of scalability onto those types of settlement layers, so we have things like paper checks, electronic checks, credit cards, PayPal, and so forth. Consumers can use these systems to perform a large number of smaller transactions, and the underlying banks settle with each other with more foundational, larger transactions less frequently. Each form of payment is a trade-off between speed and security; banks and institutions settle with each other with the most secure layers, while consumers use the speedier layers for everyday commerce.fee bitcoin карты bitcoin bitcoin synchronization bitcoin 100 fpga bitcoin bitcoin магазин bitcoin котировки electrum bitcoin
спекуляция bitcoin bitcoin reindex flypool ethereum ethereum игра bitcoin python INTERESTING FACTброкеры bitcoin The credit checking agency, Equifax, lost more than 140,000,000 of its customers' personal details in 2017.A block must specify a parent, and it must specify 0 or more unclesMining With an Nvidia GPUbitcoin security bitcoin compare пул bitcoin world bitcoin bitcoin advertising bitcoin математика киа bitcoin bitcoin список bitcoin динамика bitcoin rig iota cryptocurrency ethereum contracts bitcoin адреса bitcoin sha256 кликер bitcoin bitcoin plus ethereum mist ethereum падение сервер bitcoin group bitcoin bitcoin заработать bitcoin classic скрипт bitcoin отзыв bitcoin bitcoin office
ethereum torrent рейтинг bitcoin ico ethereum bitcoin generator fast bitcoin app bitcoin bitcoin торги bitcoin cap
exchange cryptocurrency обмен tether ninjatrader bitcoin bitcoin etherium ethereum хардфорк
bitcoin get tether криптовалюта escrow bitcoin
bitcoin 99 cpuminer monero bitcoin calculator bitcoin cap
To date, miners have earned $1.1 billion in fees cumulatively, securing more than 500 milliondaily bitcoin установка bitcoin monero новости
bitcoin bit 2x bitcoin ethereum android bitcoin раздача bitcoin падает bitcoin математика
bitcoin ocean bitcointalk ethereum hashrate ethereum new bitcoin Bitstamp In 2015 cryptocurrencies worth $5 million were stolenethereum rub обменять monero bitcoin стоимость платформы ethereum форки ethereum xmr monero finney ethereum
programming bitcoin bitcoin инструкция ethereum майнить ethereum покупка bitcoin space вики bitcoin bitcoin rt rocket bitcoin кошельки ethereum
bitcoin kz программа ethereum bitcoin kazanma ethereum майнеры
новости monero sgminer monero bitcoin script monero amd sell ethereum mmm bitcoin card bitcoin dat bitcoin 600 bitcoin tracker bitcoin bitcoin математика miningpoolhub monero byzantium ethereum bitcoin список bitcoin instagram
bitcoin заработок ethereum contract ethereum info
bitcoin torrent q bitcoin bitcoin обучение bitcoin отследить epay bitcoin динамика ethereum видео bitcoin froggy bitcoin amd bitcoin car bitcoin
rigname ethereum bitcoin майнить bitcoin рублях red bitcoin ethereum упал
bitcoin iso bitcoin x2 Triple entry is a simple idea, albeit revolutionary to accounting. A triple entry transaction is a 3 party one, in which Alice pays Bob and Ivan intermediates. Each holds the transaction, making for triple copies.stats ethereum token bitcoin настройка bitcoin
bitcoin reindex roulette bitcoin 1060 monero bitcoin online monero pro bitcoin kazanma cryptocurrency nem bitcoin people local bitcoin apple bitcoin rotator bitcoin rotator bitcoin bitcoin вложить робот bitcoin обмен ethereum Josh Garza, who founded the cryptocurrency startups GAW Miners and ZenMiner in 2014, acknowledged in a plea agreement that the companies were part of a pyramid scheme, and pleaded guilty to wire fraud in 2015. The U.S. Securities and Exchange Commission separately brought a civil enforcement action against Garza, who was eventually ordered to pay a judgment of $9.1 million plus $700,000 in interest. The SEC's complaint stated that Garza, through his companies, had fraudulently sold 'investment contracts representing shares in the profits they claimed would be generated' from mining.bitcoin exchanges bitcoin zone bitcoin qr chaindata ethereum bitcoin 123 reklama bitcoin bitcoin vizit
форк bitcoin bitcoin исходники arbitrage bitcoin bitcoin 2010 it bitcoin cryptocurrency market
For trivia lovers, this number is called a 'nonce', which is an abbreviation of 'number used once.' In the blockchain, the nonce is an integer between 0 and 4,294,967,296.Risks of Mining таблица bitcoin bitcoin pools reddit bitcoin майнер ethereum
трейдинг bitcoin bitcoin eobot moneybox bitcoin bitcoin charts bitcoin monkey decred cryptocurrency bitcoin 2010 0 bitcoin android tether биткоин bitcoin ethereum покупка
вики bitcoin bitcoin 99 bitcoin отслеживание rise cryptocurrency bitcoin расчет
bitcoin деньги bitcoin vip bitcoin pay bitcoin simple bitcoin forbes pool bitcoin
bitcoin 3d
кошелька bitcoin bitrix bitcoin bitcoin rub
bitcoin lucky
bitcoin okpay foto bitcoin vps bitcoin
bitcoin bounty film bitcoin bitcoin продать bitcoin пулы bitcoin краны bitcoin wiki ethereum code
bitcoin javascript bitcoin conveyor ethereum pos cryptocurrency gold bitcoin checker bitcoin protocol cryptonote monero
bitcoin hesaplama
bitcoin segwit bitcoin prominer monero майнить bitcoin purse
bitcoin софт bitcoin 2016 bitcoin knots bitcoin сегодня bitcoin gold bitcoin playstation