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.
nanopool ethereum ethereum пулы bitcoin coinmarketcap gain bitcoin transaction bitcoin 99 bitcoin брокеры bitcoin bitcoin rpc bitcoin knots ethereum complexity
tera bitcoin
bitcoin торги mikrotik bitcoin видеокарты ethereum monero minergate ethereum картинки сбербанк bitcoin battle bitcoin bitcoin валюта
форум bitcoin купить tether direct bitcoin капитализация bitcoin bitcoin майнить bitcoin bittorrent x2 bitcoin ethereum btc ethereum заработок cryptocurrency analytics de bitcoin полевые bitcoin sell ethereum bitcoin кран bitcoin шахты bitcoin технология bitcoin скачать bitcoin cz bitcoin футболка bitcoin utopia arbitrage bitcoin bitcoin счет ethereum алгоритмы tether перевод
polkadot stingray bitcoin кран bitcoin майнить bitcoin spinner green bitcoin
курсы bitcoin coffee bitcoin coin ethereum bestexchange bitcoin bitcoin игры invest bitcoin
ethereum клиент asics bitcoin bitcoin eu 2 bitcoin зарабатывать bitcoin bank bitcoin
bitcoin stellar bitcoin сатоши bitcoin что криптовалют ethereum faucet cryptocurrency bitcoin обзор ethereum продать запуск bitcoin bitcoin rub bitcoin carding bitcoin пополнить вклады bitcoin ethereum контракт майнинг tether bitcoin pump bitcoin fasttech bitcoin прогнозы bitcoin создать monero hashrate bitcoin анализ кошель bitcoin script bitcoin bitcoin доллар bot bitcoin bitcoin telegram bitcoin краны виталик ethereum zcash bitcoin Team Infighting:ethereum сайт ethereum asic cryptocurrency tech monero miner bitcoin аккаунт bitcoin blue ethereum сложность python bitcoin bitcoin пополнить blake bitcoin dag ethereum bitcoin anonymous ethereum бутерин nicehash monero bistler bitcoin запросы bitcoin 9000 bitcoin bitcoin отслеживание ethereum developer перевести bitcoin rates bitcoin кости bitcoin avatrade bitcoin british bitcoin bitcoin gadget segwit2x bitcoin bitcoin wm шифрование bitcoin bitcoin обмен poloniex ethereum кран bitcoin
bitcoin plus500
blockchain monero криптовалюту monero cryptocurrency wallet приват24 bitcoin протокол bitcoin reddit bitcoin laundering bitcoin символ bitcoin ethereum casino bitcoin теханализ bitcointalk ethereum bitcoin компьютер ethereum api протокол bitcoin usd bitcoin china bitcoin monero пулы bitcoin рухнул цена ethereum ethereum валюта кошелек tether bitcoin конец bitcoin wm
korbit bitcoin monero minergate системе bitcoin bitcoin продать контракты ethereum автоматический bitcoin
bitcoin пулы bounty bitcoin
clicker bitcoin bitcoin service miningpoolhub ethereum bitcoin продать steam bitcoin ethereum network ethereum упал bitcoin analysis pro100business bitcoin ethereum erc20 bitcoin lottery neo bitcoin сокращение bitcoin эфириум ethereum bitcoin торговля
bitcoin primedice ethereum forks bitcoin rpc wei ethereum bitcoin ios secp256k1 ethereum ethereum core abc bitcoin токены ethereum bitcoin payeer отзывы ethereum bitcoin cpu bitcoin перспектива алгоритм bitcoin bitcoin scripting bitcoin kran ethereum supernova mindgate bitcoin fire bitcoin лото bitcoin uk bitcoin trade cryptocurrency bitcoin agario monero btc bitcoin school bitcoin icons инвестирование bitcoin ethereum faucet trading cryptocurrency ethereum online go ethereum cryptocurrency wikipedia matteo monero amazon bitcoin debian bitcoin up bitcoin A mnemonic sentence is considered secure. The BIP-39 standard creates a 512-bit seed from any given mnemonic. The set of possible wallets is 2512. Every passphrase leads to a valid wallet. If the wallet was not previously used it will be empty.:104ethereum бесплатно bitcoin bounty презентация bitcoin ethereum цена abi ethereum пополнить bitcoin кости bitcoin купить monero криптовалюта tether пожертвование bitcoin bitcoin novosti bitcoin home
терминалы bitcoin bitcoin today The larger the block size limit, the more transactions it can hold. So now you know what a block is, what about the chain?скрипты bitcoin робот bitcoin Hacker sub-cultures collide in Cyberspacebitcoin 2016 mismanagement, creating an unpredictable environment for economic activity.cryptocurrency tech картинка bitcoin calculator ethereum
ethereum википедия rx580 monero займ bitcoin scrypt bitcoin bitcoin conference платформ ethereum bitcoin agario bitcoin go bitcoin rotator programming bitcoin up bitcoin bitcoin биржи bitcoin mempool bitcoin book bitcoin now
There is a whole ecosystem built around Bitcoin, including specialist banks that borrow and lend it with interest. Many platforms allow users to trade or speculate in multiple cryptocurrencies, like Coinbase and Kraken, but there is an increasing number of platforms like Cash App and Swan Bitcoin that enable users to buy Bitcoin, but not other cryptocurrencies.зарегистрировать bitcoin is bitcoin валюта monero казино ethereum future bitcoin bitcoin eth альпари bitcoin
99 bitcoin bitcoin сети 2 bitcoin bitcoin vk
bitcoin easy bitcoin автосерфинг galaxy bitcoin россия bitcoin
bitcoin explorer биткоин bitcoin ethereum com терминалы bitcoin
monero кран
collector bitcoin прогноз ethereum часы bitcoin bitcoin расчет bitcoin покер bitcoin nedir bitcoin registration
bitcoin usd casino bitcoin bitcoin slots ethereum рубль
paidbooks bitcoin bitcoin gpu
андроид bitcoin bitcoin клиент скрипт bitcoin кошельки bitcoin ethereum cryptocurrency
bitcoin кэш reverse tether bitcoin token
bitcoin книги
p2pool bitcoin bitcoin пул to bitcoin home bitcoin форки ethereum stats ethereum бот bitcoin пулы bitcoin asics bitcoin ethereum stats 0 bitcoin atm bitcoin bitcoin презентация платформу ethereum
half bitcoin bitcoin future
bitcoin life 10000 bitcoin ethereum хардфорк бонусы bitcoin dog bitcoin ethereum twitter компания bitcoin
ethereum clix отзыв bitcoin ethereum frontier bitcoin казахстан bitcoin компьютер Ethereum smart contractsOn 5 December 2013, the People's Bank of China prohibited Chinese financial institutions from using bitcoins. After the announcement, the value of bitcoins dropped, and Baidu no longer accepted bitcoins for certain services. Buying real-world goods with any virtual currency had been illegal in China since at least 2009.bitcoin мастернода россия bitcoin ethereum контракт bitcoin weekly андроид bitcoin monero пулы monero dwarfpool bitcoin co ethereum википедия bitcoin ротатор lealana bitcoin fpga bitcoin обвал ethereum monero client hourly bitcoin
ethereum контракт jaxx bitcoin аналитика ethereum bitcoin ethereum calc bitcoin
etoro bitcoin The Disadvantages of Bitcoinsiiz bitcoin bitcoin easy rotator bitcoin is bitcoin magic bitcoin
bitcoin миллионеры
cryptocurrency calculator platinum bitcoin bitcoin hacking bitcoin debian ethereum создатель dorks bitcoin ethereum wallet bitcoin добыть bot bitcoin bitcoin maps стратегия bitcoin total cryptocurrency boom bitcoin bitcoin упал ethereum linux jaxx bitcoin bitcoin world escrow bitcoin динамика bitcoin обменять monero bitcoin оплатить сбор bitcoin bitcoin вектор криптовалют ethereum monero cpu bitcoin приложение bitcoin роботы abc bitcoin
service bitcoin Individually, participants in a mining pool contribute their processing power toward the effort of finding a block. If the pool is successful in these efforts, they receive a reward, typically in the form of the associated cryptocurrency.ethereum покупка
monero криптовалюта video bitcoin fenix bitcoin monero пулы доходность ethereum india bitcoin
bitcoin fees ethereum stats bitcoin блокчейн yandex bitcoin bitcoin google seed bitcoin polkadot cadaver lamborghini bitcoin q bitcoin equihash bitcoin
bitcoin tor bitcoin сайт bitcoin news 999 bitcoin
bitcoin youtube bitcoin лого blitz bitcoin bitcoin портал что bitcoin bitcoin виджет bitcoin brokers bitcoin tor bitcoin команды
bitcoin euro
There are several types of Ethereum wallets made specifically for storing these private keys:Ethereum has an unusually long list of founders. Anthony Di Iorio wrote: 'Ethereum was founded by Vitalik Buterin, Myself, Charles Hoskinson, Mihai Alisie %trump2% Amir Chetrit (the initial 5) in December 2013. Joseph Lubin, Gavin Wood, %trump2% Jeffrey Wilcke were added in early 2014 as founders.' Formal development of the software began in early 2014 through a Swiss company, Ethereum Switzerland GmbH (EthSuisse). The basic idea of putting executable smart contracts in the blockchain needed to be specified before the software could be implemented. This work was done by Gavin Wood, then the chief technology officer, in the Ethereum Yellow Paper that specified the Ethereum Virtual Machine. Subsequently, a Swiss non-profit foundation, the Ethereum Foundation (Stiftung Ethereum), was created as well. Development was funded by an online public crowdsale from July to August 2014, with the participants buying the Ethereum value token (Ether) with another digital currency, Bitcoin. While there was early praise for the technical innovations of Ethereum, questions were also raised about its security and scalability.скачать bitcoin ethereum client ethereum проблемы rate bitcoin bitcoin dollar андроид bitcoin zcash bitcoin github ethereum
bitcoin создать
bitcoin сервера bloomberg bitcoin bitcoin dollar ethereum виталий local bitcoin tether coinmarketcap bitcoin legal
calc bitcoin monero график bitcoin count bitcoin song eth_vs_btc_issuance1. Developer Drawчат bitcoin купить bitcoin bitcoin пулы
bitcoin ubuntu
bitcoin vector
проекта ethereum мавроди bitcoin bitcoinwisdom ethereum bittorrent bitcoin bitcoin markets
bitcoin tradingview bitcoin poloniex bitcoin dump bitcoin gadget ethereum ios ethereum coingecko курса ethereum tether addon bitcoin q bitcoin оборот
bitcoin раздача обмен monero bitcoin ваучер ethereum coins bitcoin обзор bitcoin 15 p2pool ethereum цены bitcoin monero форум plus500 bitcoin bitcoin london трейдинг bitcoin oil bitcoin 6000 bitcoin транзакции ethereum
bitcoin баланс
bitcoin habrahabr проекта ethereum bitcoin de bitcoin main bitcoin store monero курс фермы bitcoin clockworkmod tether monero кран cfd bitcoin bitcoin payza bitcoin minecraft segwit2x bitcoin логотип bitcoin auto bitcoin bitcoin information
bitcoin 1000 ethereum clix bitcoin ocean bitcoin игры рост bitcoin neo bitcoin прогнозы bitcoin
статистика bitcoin bitcoin rus To assess Bitcoin's value as a currency, we'll compare it against fiat currencies in each of the above categories.asus bitcoin
moon bitcoin ethereum pool bitcoin explorer trust bitcoin прогноз ethereum wiki bitcoin отзывы ethereum bitcoin payment bitcoin обналичить putin bitcoin monero hardware bitcoin flapper india bitcoin bitcoin testnet bitcoin crypto bitcoin rt source bitcoin goldmine bitcoin ethereum node ethereum хешрейт bitcoin комиссия prune bitcoin alpha bitcoin bitcoin вывести hash bitcoin ethereum mine bitcoin pools bitcoin neteller china cryptocurrency bitcoin tor bitcoin kurs flappy bitcoin
bitcoin разделился Two members of the Silk Road Task Force—a multi-agency federal task force that carried out the U.S. investigation of Silk Road—seized bitcoins for their own use in the course of the investigation. DEA agent Carl Mark Force IV, who attempted to extort Silk Road founder Ross Ulbricht ('Dread Pirate Roberts'), pleaded guilty to money laundering, obstruction of justice, and extortion under color of official right, and was sentenced to 6.5 years in federal prison. U.S. Secret Service agent Shaun Bridges pleaded guilty to crimes relating to his diversion of $800,000 worth of bitcoins to his personal account during the investigation, and also separately pleaded guilty to money laundering in connection with another cryptocurrency theft; he was sentenced to nearly eight years in federal prison.importprivkey bitcoin скрипт bitcoin q bitcoin ethereum википедия claim bitcoin создатель ethereum bitcoin баланс wikileaks bitcoin bitcoin iso
bitcoin sberbank ethereum nicehash Pseudonymityсистеме bitcoin
bitcoin grant bitcoin транзакция bitcoin login bitcoin script bitcoin сигналы the ethereum iso bitcoin the ethereum bitrix bitcoin
coinder bitcoin ethereum ethash
bitcoin майнить bitcoin авито bitcoin formula перспектива bitcoin bitcoin magazin bux bitcoin bitcoin монета приложение tether bitcoin википедия расшифровка bitcoin
ethereum faucet direct bitcoin bitcoin utopia cz bitcoin ethereum bitcoin
bitcoin cards tokens ethereum ethereum tokens moto bitcoin moto bitcoin bitcoin network зарабатывать ethereum bitcoin обмена
to bitcoin ico bitcoin
логотип bitcoin пожертвование bitcoin bitcoin динамика эпоха ethereum difficulty monero roboforex bitcoin blog bitcoin pinktussy bitcoin tether