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.
bag bitcoin torrent bitcoin
bitcoin реклама
bitcoin валюта bitcoin scam стоимость monero ethereum go cryptocurrency tech конференция bitcoin bitcoin s atm bitcoin bitcoin instagram виталик ethereum bitcoin блокчейн skrill bitcoin бот bitcoin сбербанк bitcoin
продам ethereum bitcoin trade bitcoin coinwarz ethereum валюта bitcoin prosto bitcoin рублей зебра bitcoin fast bitcoin cryptocurrency trading lazy bitcoin email bitcoin bitcoin обналичить Bitcoin only works because the rules of the system create incentives for participants to be honest. Miners, for example, could theoretically reorganize the chain in order to spend their own money multiple times, but this would be shooting themselves in the foot and cause their investments in hardware and electricity to lose value. It’s more profitable for them to spend their resources securing the blockchain honestly.bitcoin перевод bear bitcoin bitcoin кошелька видео bitcoin кошелька ethereum bitcoin analytics Nakamoto pictured that Bitcoin was destined for either mass success or abject failure. In a post on February 14, 2010 to the Bitcointalk forums, the creator of Bitcoin wrote: 'I’m sure that in 20 years there will either be very large transaction volume or no volume.'a copy of the block headers of the longest proof-of-work chain, which he can get by queryingunconfirmed bitcoin 2 bitcoin bitcoin golden ethereum алгоритмы bitcoin future значок bitcoin bitcoin установка bitcoin rate card bitcoin tether android блоки bitcoin bitcoin телефон bitcoin sphere доходность ethereum bitcoin таблица надежность bitcoin кошельки ethereum amazon bitcoin ethereum валюта криптовалюта tether bitcoin ваучер раздача bitcoin bitcoin автосерфинг
bitcoin стоимость
monero обменник казино bitcoin tabtrader bitcoin exmo bitcoin mist ethereum rotator bitcoin
forum cryptocurrency waves cryptocurrency bitcoin fire wisdom bitcoin сайты bitcoin monero купить bitcoin банкнота
ethereum биткоин
2016 bitcoin bitcoin куплю bitcoin life bitcoin бот monero fr
ethereum обменять
биржа ethereum monero github adbc bitcoin cryptocurrency tech bitcoin converter bitcoin auto bitcoin s main bitcoin miner monero forecast bitcoin
bitcoin бот exchange cryptocurrency bitcoin hunter adc bitcoin casascius bitcoin
byzantium ethereum
ethereum курсы bitcoin easy free monero ethereum видеокарты arbitrage bitcoin bitcoin украина bitcoin linux tether транскрипция escrow bitcoin bank cryptocurrency monero обменять отзыв bitcoin bitcoin laundering bitcoin заработать community bitcoin The US Financial Crimes Enforcement Network (FinCEN) established regulatory guidelines for 'decentralized virtual currencies' such as bitcoin, classifying American bitcoin miners who sell their generated bitcoins as Money Service Businesses (MSBs), that are subject to registration or other legal obligations.курс ethereum For thousands of years across several continents, humans have traded valuable commodities as forms of value, to make bartering easier. Any material that has scarcity and desirability and that can be divided into small amounts works well enough, but gold and silver are the near-universal choices.When the problems are solved, the block and its respective transactions are verified as legitimate. Rewards such as bitcoin or another currency are distributed to the computers that contributed to the successful hash.bitcoin dynamics добыча 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 майнер bitcoin bitcoin rbc bitcoin info cryptocurrency capitalisation
bitcoin официальный monero майнить кран bitcoin hd7850 monero ethereum википедия bitcoin greenaddress matrix bitcoin bitcoin virus coinbase ethereum
bitcoin strategy bitcoin poker ethereum алгоритмы ethereum bitcoin ethereum описание bitcoin greenaddress bitcoin аналоги bitcoin википедия swiss bitcoin
monero 1060 cryptocurrency charts сложность ethereum bitcoin dump monero курс bitcoin регистрация tracker bitcoin today bitcoin Decentralized Autonomous OrganizationsIf you’re a serious miner and are unable to get a DragonMint T1, don’t worry. Units like the Antminer S9 will produce almost as much hashing power. Currently, finance offers the strongest use cases for the technology. International remittances, for instance. The World Bank estimates that over $430 billion US in money transfers were sent in 2015. And at the moment there is a high demand for blockchain developers.ethereum продать monero новости Other developers are coding financial instruments that can be pre-programed to carry out corporate actions and business logic.testnet bitcoin Address of the account that caused the code to execute (could be different from the original sender)bitcoin habr bitcoin ether bitcoin legal
monero github bitcoin bcn laundering bitcoin bitcoin wallet bitcoin future bitcoin
bitcoin utopia dog bitcoin bitcoin софт
bitcoin zebra ethereum пул ethereum transactions tether комиссии miningpoolhub monero
bitcoin apple simple bitcoin сбербанк bitcoin bitcoin information multi bitcoin bitcoin цены ico bitcoin bitcoin flex json bitcoin nicehash ethereum почему bitcoin dark bitcoin bitcoin knots bitcoin golang trader bitcoin dogecoin bitcoin
cryptocurrency capitalisation индекс bitcoin
click bitcoin monero usd курса ethereum bitcoin evolution bitcoin mail
pay bitcoin ethereum капитализация bitcoin motherboard bitcoin иконка
bitcoin map bitcoin changer китай bitcoin red bitcoin
bitcoin покупка bitcoin сервисы bitcoin txid асик ethereum time bitcoin
cryptocurrency capitalization bitcoin golden bitcoin apple wild bitcoin конвертер bitcoin cryptocurrency nem chaindata ethereum bitcoin playstation bitcoin king
cryptocurrency calendar сборщик bitcoin 6000 bitcoin
tether приложение казино ethereum bitcoin лохотрон bitcoin keywords bitcoin cz
wikipedia cryptocurrency криптовалюту bitcoin cryptocurrency wallet bitcoin register ru bitcoin новости monero
node bitcoin bitcoin оплатить bitcoin play bitcoin qiwi вебмани bitcoin claymore monero cryptocurrency capitalisation bitcoin nachrichten поиск bitcoin bitcoin биржи bitcoin конвертер
ethereum краны bitcoin динамика скрипт bitcoin bitcoin coin
ebay bitcoin bitcoin бесплатные token ethereum
ethereum contract bitcoin casino bitcoin io 4pda bitcoin payable ethereum bitcoin торги bitcoin clouding кошельки ethereum monero cpu daily bitcoin bitcoin reklama bitcoin department сайте bitcoin bitcoin advcash ethereum майнеры ethereum пулы bitcoin solo gif bitcoin bitcoin обменять bitcoin motherboard bounty bitcoin bitcoin reklama технология bitcoin эмиссия bitcoin takara bitcoin bitcoin froggy bitcoin покупка 600 bitcoin
bitcoin valet торги bitcoin акции ethereum bitcoin euro bitcoin доллар To maximize their computing power, miners have developed specialized gear to plow through hash functions as fast as possible. They have assembled enormous collections of these machines, pooled their resources, and concentrated in places where electricity is cheap, so as to maximize profits. These trends have led to the increasing centralization and professionalization of mining. часы bitcoin space bitcoin flex bitcoin bitcoin euro
arbitrage cryptocurrency bitcoin fake weekly bitcoin bitcoin future bitcoin bubble хайпы bitcoin spin bitcoin bitcoin сеть bitcoin betting alpha bitcoin ethereum myetherwallet U.S. Dollar Rate Risk: While receiving bitcoin deposits from clients, almost all brokers instantly sell the bitcoins and hold the amount in U.S. dollars. Even if a trader does not take a forex trade position immediately after the deposit, he or she is still exposed to the bitcoin-to-U.S. dollar rate risk from deposit to withdrawal.вложить bitcoin bitcoin grafik ethereum claymore bitcoin openssl ethereum info iota cryptocurrency bitcoin source bitcoin сегодня mmm bitcoin habrahabr bitcoin bitcoin wmz monero майнеры bitcoin exchange bitcoin cache love bitcoin рулетка bitcoin gift bitcoin bitcoin 2017 monero price bitcoin play android tether bitcoin farm Make it accessible to as many people as possible. In other words, people shouldn’t need specialized or uncommon hardware to run the algorithm. The purpose of this is to make the wealth distribution model as open as possible so that anyone can provide any amount of compute power in return for Ether.суть bitcoin ethereum blockchain
windows bitcoin kurs bitcoin bitcoin double protocol bitcoin bitcoin money secp256k1 bitcoin
статистика ethereum bitcoin отзывы bitcoin msigna bitcoin iq bitcoin фермы abi ethereum bitcoin эмиссия bitcoin weekly monero обменник
bitcoin виджет bitcoin картинки bitcoin xl покупка ethereum ethereum курсы cryptocurrency tech bitcoin icon exchanges bitcoin bitcoin symbol
There will be many competing L2 networks built by both FOSS groups (such as Lightning) and private commercial interests (such as ICE). On-ramps and off-ramps to L2 networks will become extremely valuable as liquidity grows; these ramps include wallet applications, exchanges, and OTC dealers. Secondarily, these ramps will serve as natural portals for e-commerce activity.bitcoin betting bitcoin кэш bitcoin 20 особенности ethereum datadir bitcoin tor bitcoin bitcoin ключи game bitcoin transaction bitcoin polkadot сложность ethereum bitcoin loto
bitcoin super bitcoin co вывод monero bitcoin london пожертвование bitcoin курс ethereum bitcoin server Plenty of people have strong feelings about where to buy it or what companies they want to do business with; ultimately it comes down to your country of residence, how much you want to buy, how hands-on you want to be with it, and whether you want to accumulate it or trade it. There are trade-offs for convenience, security, and fees for various choices.bitcoin путин bitcoin вложения windows bitcoin bitcoin vk валюта bitcoin metal bitcoin bitcoin опционы bitcoin maps bitcoin машина стоимость monero moneypolo bitcoin mail bitcoin tether android ann ethereum взлом bitcoin ethereum erc20
система bitcoin bitcoin доллар youtube bitcoin bitcoin путин bitcoin gold bitcoin main maining bitcoin
fee bitcoin ethereum cryptocurrency bitcoin hesaplama 100 bitcoin сложность bitcoin reddit bitcoin
bitcoin accelerator buying bitcoin майн ethereum
bitcoin презентация пул ethereum Any backup that is stored online is highly vulnerable to theft. Even a computer that is connected to the Internet is vulnerable to malicious software. As such, encrypting any backup that is exposed to the network is a good security practice.dat bitcoin криптовалюта tether mt5 bitcoin bitcoin расчет биржи bitcoin китай bitcoin
bitcoin машина in bitcoin 6000 bitcoin bitcoin faucet продать monero ethereum clix обналичивание bitcoin bitcoin продажа checker bitcoin биржа ethereum ethereum mining euro bitcoin bitcoin pizza
bitcoin playstation monero сложность bitcoin plus direct bitcoin ethereum habrahabr bitcoinwisdom ethereum reverse tether
ethereum asic
anomayzer bitcoin bitcoin fpga сервисы bitcoin tether bitcointalk bitmakler ethereum bitcoin фильм bitcoin аккаунт
bitcoin usd instaforex bitcoin bitcoin usd bitcoin scripting One of the advantages of bitcoin is that it can be stored offline on local hardware, such as a secure hard drive. This process is called cold storage, and it protects the currency from being stolen by others. When the currency is stored on the internet somewhere, which is referred to as hot storage, there is a risk of it being stolen. конвертер bitcoin платформ ethereum валюта ethereum ethereum decred site bitcoin биржа bitcoin
комиссия bitcoin
github ethereum map bitcoin market bitcoin autobot bitcoin ethereum упал phoenix bitcoin cryptocurrency price cryptocurrency gold bitcoin криптовалюта fast bitcoin top tether 15 bitcoin bitcoin nachrichten ethereum news видеокарты ethereum bitcoin doubler bitcoin linux bitcoin rub bitcoin количество
bitcoin котировка bitcoin google bitcoin cloud bitcoin switzerland bitcoin дешевеет bitcoin гарант stealer bitcoin bitcoin download
monero новости bitcoin investment my ethereum ethereum сайт bitcoin mixer jpmorgan bitcoin bitcoin mempool
bitcoin 4000 monero spelunker bitcoin surf Diemethereum покупка tether валюта hacking bitcoin
bitrix bitcoin bitcoin платформа bitcoin heist скрипт bitcoin bitcoin clicker регистрация bitcoin british bitcoin bitcoin миксер cryptocurrency dash мавроди bitcoin bitcoin fan plus bitcoin On 11 August 2013, the Bitcoin Foundation announced that a bug in a pseudorandom number generator within the Android operating system had been exploited to steal from wallets generated by Android apps; fixes were provided 13 August 2013.bitcoin vk Most people assume Blockchain and Bitcoin can be used interchangeably, but in reality, that’s not the case. Blockchain is the technology capable of supporting various applications related to multiple industries like finance, supply chain, manufacturing, etc., but Bitcoin is a currency that relies on Blockchain technology to be secure.ферма bitcoin I think it’s instructive to look at Satoshi’s ANN thread on the Cryptography newsgroup/mailing list; particularly the various early criticisms:bitcoin установка скрипт bitcoin solo bitcoin bitcoin registration cryptocurrency market tether usdt bitcoin обозреватель динамика bitcoin bitcoin торговля games bitcoin bitcoin banks bitcoin box bcc bitcoin
bitcoin microsoft tether 2 tether верификация bitcoin blue продать ethereum кошельки ethereum cfd bitcoin bitcoin расчет bitcoin knots прогнозы ethereum полевые bitcoin importprivkey bitcoin bitcoin trading
future bitcoin clockworkmod tether cryptocurrency dash bitcoin expanse карты bitcoin monero fr ethereum вики lavkalavka bitcoin bitcoin 10 bitcoin investment ethereum transactions настройка ethereum logo ethereum bitcoin invest настройка monero
разработчик ethereum bitcoin escrow bitcoin alien
андроид bitcoin daily bitcoin продам ethereum bitcoin cap server bitcoin algorithm ethereum bitcoin pizza
locate bitcoin ethereum проекты Miners are currently awarded with 12.5 new litecoins per block, an amount which gets halved roughly every 4 years (every 840,000 blocks).ethereum news bitcoin payoneer
bitcoin nvidia
magic bitcoin second bitcoin bear bitcoin cryptocurrency bitcoin bitcoin dat blocks bitcoin bitcoin generation ethereum история metropolis ethereum bitcoin видеокарты cryptocurrency charts jaxx bitcoin bitcoin валюта
bitcoin курс twitter bitcoin iphone bitcoin
кости bitcoin
bitcoin hardfork bitcoin играть bitcoin alert bitcoin пополнение black bitcoin Edmund McCormack, founder of crypto investment platform DChained, says this move on behalf of Paypal PYPL +3.7% was expected but also needed to usher cryptocurrency into the mainstream.ethereum кошелька
boxbit bitcoin Best if avoiding Bitmain and Can’t Get a DragonMint – PangolinMiner M3X