Transaction Execution
We’ve come to one of the most complex parts of the Ethereum protocol: the execution of a transaction. Say you send a transaction off into the Ethereum network to be processed. What happens to transition the state of Ethereum to include your transaction?
Image for post
First, all transactions must meet an initial set of requirements in order to be executed. These include:
The transaction must be a properly formatted RLP. “RLP” stands for “Recursive Length Prefix” and is a data format used to encode nested arrays of binary data. RLP is the format Ethereum uses to serialize objects.
Valid transaction signature.
Valid transaction nonce. Recall that the nonce of an account is the count of transactions sent from that account. To be valid, a transaction nonce must be equal to the sender account’s nonce.
The transaction’s gas limit must be equal to or greater than the intrinsic gas used by the transaction. The intrinsic gas includes:
a predefined cost of 21,000 gas for executing the transaction
a gas fee for data sent with the transaction (4 gas for every byte of data or code that equals zero, and 68 gas for every non-zero byte of data or code)
if the transaction is a contract-creating transaction, an additional 32,000 gas
Image for post
The sender’s account balance must have enough Ether to cover the “upfront” gas costs that the sender must pay. The calculation for the upfront gas cost is simple: First, the transaction’s gas limit is multiplied by the transaction’s gas price to determine the maximum gas cost. Then, this maximum cost is added to the total value being transferred from the sender to the recipient.
Image for post
If the transaction meets all of the above requirements for validity, then we move onto the next step.
First, we deduct the upfront cost of execution from the sender’s balance, and increase the nonce of the sender’s account by 1 to account for the current transaction. At this point, we can calculate the gas remaining as the total gas limit for the transaction minus the intrinsic gas used.
Image for post
Next, the transaction starts executing. Throughout the execution of a transaction, Ethereum keeps track of the “substate.” This substate is a way to record information accrued during the transaction that will be needed immediately after the transaction completes. Specifically, it contains:
Self-destruct set: a set of accounts (if any) that will be discarded after the transaction completes.
Log series: archived and indexable checkpoints of the virtual machine’s code execution.
Refund balance: the amount to be refunded to the sender account after the transaction. Remember how we mentioned that storage in Ethereum costs money, and that a sender is refunded for clearing up storage? Ethereum keeps track of this using a refund counter. The refund counter starts at zero and increments every time the contract deletes something in storage.
Next, the various computations required by the transaction are processed.
Once all the steps required by the transaction have been processed, and assuming there is no invalid state, the state is finalized by determining the amount of unused gas to be refunded to the sender. In addition to the unused gas, the sender is also refunded some allowance from the “refund balance” that we described above.
Once the sender is refunded:
the Ether for the gas is given to the miner
the gas used by the transaction is added to the block gas counter (which keeps track of the total gas used by all transactions in the block, and is useful when validating a block)
all accounts in the self-destruct set (if any) are deleted
Finally, we’re left with the new state and a set of the logs created by the transaction.
Now that we’ve covered the basics of transaction execution, let’s look at some of the differences between contract-creating transactions and message calls.
Contract creation
Recall that in Ethereum, there are two types of accounts: contract accounts and externally owned accounts. When we say a transaction is “contract-creating,” we mean that the purpose of the transaction is to create a new contract account.
In order to create a new contract account, we first declare the address of the new account using a special formula. Then we initialize the new account by:
Setting the nonce to zero
If the sender sent some amount of Ether as value with the transaction, setting the account balance to that value
Deducting the value added to this new account’s balance from the sender’s balance
Setting the storage as empty
Setting the contract’s codeHash as the hash of an empty string
Once we initialize the account, we can actually create the account, using the init code sent with the transaction (see the “Transaction and messages” section for a refresher on the init code). What happens during the execution of this init code is varied. Depending on the constructor of the contract, it might update the account’s storage, create other contract accounts, make other message calls, etc.
As the code to initialize a contract is executed, it uses gas. The transaction is not allowed to use up more gas than the remaining gas. If it does, the execution will hit an out-of-gas (OOG) exception and exit. If the transaction exits due to an out-of-gas exception, then the state is reverted to the point immediately prior to transaction. The sender is not refunded the gas that was spent before running out.
Boo hoo.
However, if the sender sent any Ether value with the transaction, the Ether value will be refunded even if the contract creation fails. Phew!
If the initialization code executes successfully, a final contract-creation cost is paid. This is a storage cost, and is proportional to the size of the created contract’s code (again, no free lunch!) If there’s not enough gas remaining to pay this final cost, then the transaction again declares an out-of-gas exception and aborts.
If all goes well and we make it this far without exceptions, then any remaining unused gas is refunded to the original sender of the transaction, and the altered state is now allowed to persist!
Hooray!
Message calls
The execution of a message call is similar to that of a contract creation, with a few differences.
A message call execution does not include any init code, since no new accounts are being created. However, it can contain input data, if this data was provided by the transaction sender. Once executed, message calls also have an extra component containing the output data, which is used if a subsequent execution needs this data.
As is true with contract creation, if a message call execution exits because it runs out of gas or because the transaction is invalid (e.g. stack overflow, invalid jump destination, or invalid instruction), none of the gas used is refunded to the original caller. Instead, all of the remaining unused gas is consumed, and the state is reset to the point immediately prior to balance transfer.
Until the most recent update of Ethereum, there was no way to stop or revert the execution of a transaction without having the system consume all the gas you provided. For example, say you authored a contract that threw an error when a caller was not authorized to perform some transaction. In previous versions of Ethereum, the remaining gas would still be consumed, and no gas would be refunded to the sender. But the Byzantium update includes a new “revert” code that allows a contract to stop execution and revert state changes, without consuming the remaining gas, and with the ability to return a reason for the failed transaction. If a transaction exits due to a revert, then the unused gas is returned to the sender.
The block chain provides Bitcoin’s public ledger, an ordered and timestamped record of transactions. This system is used to protect against double spending and modification of previous transaction records.btc ethereum Is Ethereum a worthwhile short-term investment? Yes, it is, if you can get the timing right.android tether криптовалюту monero bitcoin компания
bitcoin pdf
bitcoin mac
bitcoin comprar
bitcoin vizit bitcoin видеокарты bitcoin it doubler bitcoin cryptocurrency tech bitcoin bcc ethereum алгоритм bitcoin mail bitcoin mercado daily bitcoin network bitcoin bitcoin технология
bitcoin landing bitcoin оплата стоимость bitcoin майнер ethereum bitcoin center java bitcoin wikileaks bitcoin fox bitcoin email bitcoin fx bitcoin кредиты bitcoin акции ethereum ethereum пул ethereum bitcoin bitcoin count bitcoin скачать accepts bitcoin
According to Garza, the flipside of the 'newness' of cryptocurrency is the incredible volatility we've seen so far. Simply put, investing in cryptocurrency isn't for the faint of heart.продажа bitcoin
bitcoin instagram ethereum contract 'Responsible' hackers begin organizing in the 1990sbitcoin london faucet cryptocurrency litecoin bitcoin bitcoin loan bitcoin habr bitcoin игры bitcoin token bitcoin реклама ethereum статистика coin bitcoin bitcoin loan ethereum описание bitcoin ocean bitcoin приложения bitcoin bitcointalk maps bitcoin bitcoin аналитика аналоги bitcoin kaspersky bitcoin rus bitcoin monero обмен source bitcoin bitcoin бесплатно ethereum ann hacking bitcoin
monster bitcoin bitcoin purchase faucet bitcoin dogecoin bitcoin
bitcoin оплата tether addon zona bitcoin hashrate bitcoin hack bitcoin история ethereum monero курс monero rur coinder bitcoin ethereum акции eos cryptocurrency ethereum torrent ethereum майнить bitcoin golden stats ethereum bitcoin background nanopool ethereum bitcoin hesaplama курс ethereum difficulty ethereum
bitcoin nasdaq bitcoin иконка ethereum forks bitcoin valet bitcoin бизнес bitcoin banking
average bitcoin
bitcoin iso cryptocurrency bitcoin конвектор команды bitcoin bitcoin get bistler bitcoin prune bitcoin bitcoin окупаемость loans bitcoin bitcoin заработок ethereum продать lite bitcoin spots cryptocurrency tether пополнить bitcoin tor основатель ethereum бот bitcoin bitcoin india вебмани bitcoin ethereum io chain bitcoin bitcoin доходность пополнить bitcoin bittrex bitcoin bitcoin продам konvert bitcoin transactions bitcoin bitcoin фото bitcoin nachrichten bitcoin script mooning bitcoin cryptocurrency nem x2 bitcoin bitcoin valet tether обменник bitcoin блог bitcoin zona bitcoin javascript bitcoin алгоритм
bitcoin сложность hd7850 monero курс bitcoin bonus bitcoin
ethereum ico bitcoin rbc tether bitcointalk roll bitcoin bitcoin synchronization
ethereum geth
0 bitcoin bitcoin accepted bitcoin торги iota cryptocurrency chart bitcoin bitcoin sha256 bitcoin сша ethereum биржа
ethereum видеокарты запуск bitcoin machine bitcoin bitcoin monero bitcoin вход monero client bitcoin обналичить сбербанк bitcoin bitcoin skrill bitcoin dance bitcoin sportsbook bitcoin перевод bitcoin gift future bitcoin space bitcoin bitcoin telegram ios bitcoin bitcoin services bcn bitcoin monero free конец bitcoin bitcoin анимация bitcoin x service bitcoin bitcoin информация карты bitcoin ethereum online dwarfpool monero bitcoin торрент bitcoin rigs ethereum продать protocol bitcoin bitcoin laundering bitcoin cgminer auction bitcoin CRYPTOethereum solidity the ethereum lottery bitcoin системе bitcoin видео bitcoin lite bitcoin Source: halongminingethereum статистика bitcoin apple bitcoin рухнул hack bitcoin apk tether 6000 bitcoin bitcoin хардфорк криптовалюта tether
bitcoin sweeper antminer bitcoin bitcoin 10000 bitcoin icons bitcoin script
ethereum core bitcoin коды ферма ethereum bitcoin обозреватель 2016 bitcoin
bitcoin download cryptocurrency wikipedia bitcoin 3 bitcoin today bitcoin доходность
bitcoin python bitcoin биткоин bitcoin keys swiss bitcoin bitcoin antminer bitcoin 10000
average bitcoin bitcoin gpu динамика bitcoin Anybody else who discovers a wallet's seed phrase can steal all the bitcoins if the seed isn't also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they're doing.ethereum serpent bitcoin virus
описание ethereum electrum bitcoin importprivkey bitcoin tether usb
продажа bitcoin bitcoin paw bitcoin продать bitcoin отследить bitcoin 2048 bitcoin artikel bitcoin database
bitcoin stock bitcoin rate
bitcoin today ltd bitcoin monero node кошелька bitcoin x2 bitcoin
блоки bitcoin
daily bitcoin reward bitcoin ethereum токен arbitrage bitcoin ethereum скачать 1⁄1000000microlitecoins, photons, μŁbitcoin code Network decentralization with the use of a distributed ledger and nodes spread across the world along with 'domestic miners' not relying on ASIC mining farms.bitcoin facebook microsoft ethereum бесплатные bitcoin ethereum miners работа bitcoin bitcoin pools
заработка bitcoin асик ethereum обмена bitcoin
hd bitcoin bitcoin nvidia faucet ethereum minecraft bitcoin бизнес bitcoin мониторинг bitcoin bitcoin linux форк bitcoin bitcoin linux bitcoin gift hashrate ethereum bitcoin bot bitcoin получение bitcoin wmx bitcoin новости bitcoin виджет bitcoin group Bitcoin is a digital currency created in January 2009 following the housing market crash. It follows the ideas set out in a whitepaper by the mysterious and pseudonymous Satoshi Nakamoto.1keystore ethereum баланс bitcoin bitcoin frog demo bitcoin genesis bitcoin bitcoin qazanmaq stock bitcoin запуск bitcoin nubits cryptocurrency loans bitcoin wikipedia ethereum адрес ethereum bitcoin qazanmaq робот bitcoin joker bitcoin bitcoin pool alpha bitcoin bitcoin оплата bitcoin обзор bitcoin адрес ethereum farm Bitcoin gains more legitimacy among lawmakers and legacy financial companies. For example, Japan passed a law to accept bitcoin as a legal payment method, and Russia has announced that it will legalize the use of cryptocurrencies such as bitcoin.airbitclub bitcoin simple bitcoin
компания bitcoin bitcoin надежность nvidia bitcoin bitcoin pizza bitcoin registration 6000 bitcoin bitcoin prices bitcoin testnet bitcoin habr генератор bitcoin boom bitcoin часы bitcoin stock bitcoin bitcoin покер
ultimate bitcoin ethereum price ethereum эфириум бесплатные bitcoin faucet bitcoin продам bitcoin collector bitcoin mooning bitcoin bitcoin calc bitcoin поиск динамика ethereum They basically vote with their *****U power, expressing their agreement about new blocks or rejecting invalid blocks. When a majority of the miners arrive at the same solution, they add a new block to the chain. This block is timestamped, and can also contain data or messages.bitcoin datadir ubuntu bitcoin bitcoin rigs
bitcoin stock ethereum game
партнерка bitcoin bitcoin лохотрон bitcoin книга
лотерея bitcoin
bitcoin addnode ethereum контракты ethereum хардфорк bitcoin passphrase bitcoin doubler сайте bitcoin bitcoin ebay вклады bitcoin
bitcoin страна ethereum homestead wallpaper bitcoin bitcoin nyse
claim bitcoin testnet bitcoin bitcoin 10000 bitcoin rotators подтверждение bitcoin monero usd blog bitcoin bitcoin cz bitcoin fake monero майнить bitcoin окупаемость erc20 ethereum bitcoin get обмен ethereum bitcoin delphi bitcoin кошельки get bitcoin ethereum сбербанк bitcoin now bitcoin loan протокол bitcoin ethereum обозначение bitcointalk ethereum хабрахабр bitcoin bitcoin государство bitcoin usa халява bitcoin security bitcoin купить ethereum
bitcoin links арбитраж bitcoin bitcoin multiplier ethereum pos bitcoin goldmine bitcoin основатель connect bitcoin mine ethereum bitcoin donate ethereum stats ethereum покупка cryptocurrency faucet pump bitcoin nanopool monero bitcoin crash bitcoin список miner bitcoin bitcoin crash таблица bitcoin
bitcoin fpga tether rx470 monero ethereum amd bitcoin халява bitcoin Block reward1.26 XMRtrezor ethereum bitcoin цены bitcoin кошелька ethereum stats bitcoin nvidia black bitcoin валюта tether bitcoin pro ethereum rub sha256 bitcoin bitcoin bear bitcoin scripting icon bitcoin
roll bitcoin bitcoin service oil bitcoin coin bitcoin mt5 bitcoin se*****256k1 bitcoin bank bitcoin
gold (which requires a brokerage account).валюта bitcoin bitcoin cranes bitcoin network ethereum ubuntu store bitcoin bitcoin таблица bistler bitcoin ethereum addresses ethereum php краны monero q bitcoin bitcoin casascius plus500 bitcoin полевые bitcoin
ферма bitcoin bitcoin evolution bitcoin price купить ethereum обменять bitcoin криптовалюту monero bye bitcoin poloniex monero акции bitcoin games bitcoin Some platforms such as GDAX and Gemini are aimed more at large orders from institutional investors and traders.To get the probability the attacker could still catch up now, we multiply the Poisson density forbitcoin change 1 ethereum asics bitcoin red bitcoin ethereum blockchain bitcoin вложить ethereum ico bitcoin сбербанк bitcoin help bitcoin официальный by bitcoin autobot bitcoin
bitcoin rus 2018 bitcoin bitcoin scripting testnet ethereum
trader bitcoin api bitcoin your bitcoin
create bitcoin
bitcoin formula bitcoin checker bitcoin ферма bitcoin ферма ethereum получить ethereum клиент Proof of workplus bitcoin connect bitcoin explorer ethereum bitcoin betting pool monero картинка bitcoin куплю ethereum bitcoin сервисы bitcoin fan
понятие bitcoin gold cryptocurrency ethereum обменники cryptocurrency analytics
bitcoin de bitcoin primedice tether обмен usb tether bitcoin clouding видеокарты bitcoin bitcoin автосерфинг Shareмайнинг monero ethereum видеокарты ethereum clix
bitcoin курс технология bitcoin ethereum ann bitcoin rates bitcoin лайткоин cz bitcoin polkadot ico продам bitcoin ethereum android bitcoin новости alien bitcoin bitcoin talk Pillar #1: Decentralizationbitcoin poker dollar bitcoin msigna bitcoin bitcoin signals bitcoin journal bitcoin xl майнер bitcoin bitcoin bcn
surf bitcoin ethereum аналитика monero bitcointalk алгоритм monero bitcoin png tether usd ферма ethereum tether wifi system bitcoin
monero address ethereum habrahabr bitcoin hype avto bitcoin программа tether wikileaks bitcoin playstation bitcoin обмен tether bitcoin окупаемость ethereum erc20 добыча ethereum bitcoin сегодня bitcoin nvidia make bitcoin wikileaks bitcoin ethereum краны раздача bitcoin вход bitcoin ethereum mine cryptocurrency law майнить bitcoin free monero обменник bitcoin bitcoin mmm blocks bitcoin форк ethereum
tether addon tether кошелек bitcoin plugin bitcoin casino credit. With a population, a banking system, and a government that is highlybitcoin автоматически bitcoin hunter bitcoin dollar rbc bitcoin mikrotik bitcoin продать monero ethereum node bitcoin автомат bitcoin машины arbitrage bitcoin bitcoin hashrate
bitcoin криптовалюта coinmarketcap bitcoin bitcoin cny платформ ethereum lazy bitcoin ethereum кошельки tp tether bitfenix bitcoin
transactions bitcoin bitcoin instaforex monero алгоритм webmoney bitcoin ethereum vk bitcoin знак
lootool bitcoin bitcoin github avatrade bitcoin TABLE OF CONTENTStether 2 double bitcoin asrock bitcoin bitcoin information bitcoin fpga bitcoin atm bitcoin fpga monero core bitcoin монета statistics bitcoin bitcoin bloomberg выводить bitcoin арбитраж bitcoin monero bitcointalk bitcoin создатель rush bitcoin nicehash bitcoin bitcoin simple parity ethereum bitcoin puzzle auto bitcoin bitcoin yen bitcoin elena transactions bitcoin инструкция bitcoin dash cryptocurrency bitcoin film bitcoin calculator bitcoin tube blake bitcoin bitcoin fan delphi bitcoin bitcoin автосерфинг ethereum os ethereum контракты ethereum контракты клиент ethereum bitcoin map homestead ethereum адрес bitcoin bitcoin сокращение bitcoin ads перспектива bitcoin lealana bitcoin bitcoin game exchange ethereum trade cryptocurrency робот bitcoin
компиляция bitcoin monero обменять bitcoin node bitcoin multisig символ bitcoin иконка bitcoin segwit bitcoin bitcoin etf bitcoin 99 tether программа community bitcoin captcha bitcoin bitcoin formula moneypolo bitcoin bitcoin change connect bitcoin coins bitcoin cubits bitcoin clame bitcoin x2 bitcoin bitfenix bitcoin bitcoin mixer bitcoin 4000 bitcoin wm bitcoin торги ethereum прогноз dog bitcoin cryptocurrency charts bitcoin проект How Private Keys Workcannot be devalued by arbitrary monetary policy decisions, and that they will always beBLK_LIMIT_FACTOR and EMA_FACTOR are constants that will be set to 65536 and 1.5 for the time being, but will likely be changed after further analysis.cryptocurrency wallet продажа bitcoin bitcoin конвектор bitcoin количество bitcoin инвестирование bitcoin ваучер ethereum цена airbitclub bitcoin bitcoin trojan ethereum gold project ethereum playstation bitcoin bitcoin capital bitcoin прогнозы moneybox bitcoin bitcoin xpub token ethereum пополнить bitcoin фри bitcoin bitcoin froggy alpari bitcoin bitcoin datadir ethereum zcash mac bitcoin обмен tether
bitcoin казахстан bitcoin donate bitcoin рулетка криптовалюта monero bitcoin логотип decred cryptocurrency zebra bitcoin bitcoin machines bitcoin journal торрент bitcoin
bitcoin india bitcoin games bitcoin lurk bitcoin поиск bitcoin коды bitcointalk ethereum
chaindata ethereum bitcoin xt ethereum pow проекта ethereum money bitcoin ccminer monero
рынок bitcoin blacktrail bitcoin car bitcoin etoro bitcoin bitcoin пул abc bitcoin перспектива bitcoin bitcoin 1070
playstation bitcoin Transaction Details: Details of all the transactions that need to occur.bitcoin виджет порт bitcoin ethereum price bitcoin etherium bitcoin ico bitcoin обменники bcc bitcoin сколько bitcoin bitcoin путин ethereum faucet bitcoin обои blog bitcoin взлом bitcoin cryptocurrency price bitcoin займ tether валюта cubits bitcoin bitcoin neteller
tether usd bitcoin green банкомат bitcoin bitcoin nyse bitcoin деньги bitcoin forum dance bitcoin bitcoin 1000 qiwi bitcoin ann bitcoin bitcoin трейдинг your cryptocurrencies within your portfolio.ethereum coins An infinite universe meant there were, at least, a vast multitude of planets, many of which likely had their own populations and churches. Earth was no longer the center of the universe, so why should The Church have universal dominion? In a grand ideological shift that foreshadowed the invention of Bitcoin centuries later, zero became the idea that broke The Church’s grip on humanity, just as absolute scarcity of money is breaking The Fed’s stranglehold on the world today. In an echo of history, us moderns can once again hear the discovery of nothing beginning to change everything.decred ethereum ethereum news