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.
pk tether cryptocurrency calendar airbitclub bitcoin bitcoin it bitcoin account
bitcoin png
bitcoin scam korbit bitcoin bitcoin шахты ротатор bitcoin maining bitcoin tether 4pda total cryptocurrency bitcoin сервер bitcoin торговля bitcoin kazanma korbit bitcoin autobot bitcoin bitcoin купить ethereum forum bitcoin bat технология bitcoin
баланс bitcoin bitcoin crash monero ethereum testnet bitcoin 4 hyip bitcoin bitcoin прогнозы mac bitcoin bitcoin капитализация криптовалют ethereum wikipedia bitcoin кошелька bitcoin
ethereum 4pda bitcoin коллектор reindex bitcoin ethereum описание bitcoin mt4 lite bitcoin raiden ethereum bitcoin видеокарты
купить bitcoin заработать monero bitcoin slots ethereum stats сбор bitcoin 0 bitcoin 123 bitcoin tether пополнить сложность ethereum bitcoin команды bitcoin проект bitcoin ru bitcoin обналичить bitcoin etherium ethereum кошельки bitcoin автокран шахта bitcoin генераторы bitcoin bitcoin nachrichten bitcoin форумы bitcoin explorer payable ethereum ethereum frontier bitcoin center bitcoin адреса bitcoin foundation tether скачать gold cryptocurrency пулы ethereum
ethereum ann monero кран bitcoin legal wiki bitcoin strategy bitcoin ethereum siacoin tails bitcoin переводчик bitcoin ethereum telegram стоимость ethereum бесплатный bitcoin zona bitcoin bitcoin openssl видео bitcoin казино ethereum сбор bitcoin mikrotik bitcoin bitcoin fire wikipedia cryptocurrency сети ethereum decred ethereum bitcoin рейтинг заработок ethereum bitcoin xpub bitcoin hardfork coinwarz bitcoin bitcoin mixer tp tether ethereum stats flypool monero ethereum asic click bitcoin bitcoin скачать bitcoin genesis mixer bitcoin A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key. Such a wallet can be used for requiring agreement among multiple people to spend, can eliminate a single point of failure, and can be used as form of backup, among other applications.bitcoin bbc bitcoin приложение trader bitcoin android tether block ethereum hub bitcoin смесители bitcoin tether wifi Using something called shared distributed ledger technology (SDLT), it allows a network of computers to update their files simultaneously using point-to-point encryption, and peer-to-peer replication. These can either be in the form of private networks or public networks. ethereum plasma bitcoin stealer wallet tether ethereum miners
wallpaper bitcoin bitcoin регистрация bitcoin ios ethereum контракт bitcoin daily кошелек tether курс bitcoin 1080 ethereum usdt tether monero fr bitcoin cnbc What Are the Benefits of Blockchain Technology?bitcoin server pow bitcoin
x2 bitcoin bitcoin passphrase ethereum twitter ethereum кран динамика ethereum
bitcoin майнить bitcoin registration bitcoin server secp256k1 ethereum bitcoin мавроди rate bitcoin bitcoin captcha token ethereum трейдинг bitcoin
обменник ethereum ethereum php 1080 ethereum bitcoin book blender bitcoin bitcoin игры транзакции bitcoin bitcoin развод monero fee ethereum contracts 60 bitcoin bitcoin keywords bitcoin central byzantium ethereum кредит bitcoin 50000 bitcoin обсуждение bitcoin panda bitcoin bitcoin spinner vpn bitcoin
bitcoin black alipay bitcoin bitcoin 1000 monero новости online bitcoin bitcoin гарант ethereum пул bitcoin ico bitcoin 10 bitcoin airbit cryptonight monero mist ethereum bitcoin machine bitcointalk ethereum bitcoin валюты bitcoin etherium ethereum alliance bitcoin государство bitcoin халява монет bitcoin bitcoin bitrix ecopayz bitcoin bot bitcoin p2p bitcoin bitcoin минфин bitcoin прогноз
bitcoin pdf
kong bitcoin bitcoin ann bitcoin pools blogspot bitcoin bitcoin рубль free bitcoin видеокарта bitcoin 16 bitcoin деньги bitcoin обзор bitcoin monero 1070 видеокарта bitcoin bitcoin тинькофф bitcoin автокран india bitcoin
bitcoin отзывы conference bitcoin tether перевод bitcoin лохотрон робот bitcoin roulette bitcoin bitcoin cracker bitcoin electrum galaxy bitcoin bitcoin wallpaper курс bitcoin
bitcoin links top tether bitcoin investment bitcoin king 1000 bitcoin bitcoin окупаемость bistler bitcoin майнить bitcoin bitcoin банк daily bitcoin Some Ethereum apps have their own token, derived from ether. To participate in these, users need to trade ether for the token powering the app. For instance, Decentraland is a virtual world where users can buy virtual plots of land. It’s different from games that don’t use blockchain because users control the game, rather than a central entity.monero курс E-commerceetoro bitcoin ethereum клиент майнить monero
конвектор bitcoin bitcoin protocol ethereum claymore pow bitcoin bitcoin zebra bitcoin cny book bitcoin bitcoin spinner bitcoin проверка bitcoin doge bitcoin review ethereum pool bitcoin бот кошелька bitcoin спекуляция bitcoin panda bitcoin зебра bitcoin CultureDouble spendingконсультации bitcoin кран bitcoin bitcoin пирамиды bitcoin linux carding bitcoin ethereum api login bitcoin Pool Feesethereum install cryptocurrency bitcoin monero spelunker ethereum install bitcoin пул
bitcoin xt
покупка ethereum создать bitcoin bitcoin автокран bitcoin foto field bitcoin пожертвование bitcoin bitcoin purse ethereum купить An uncle must be a valid block header, but does not need to be a previously verified or even valid blockвиталик ethereum moneypolo bitcoin ethereum investing bitcoin скачать
сайты bitcoin bitcoin greenaddress оборот bitcoin яндекс bitcoin usb bitcoin bitcoin сложность bitcoin registration bitcoin падение статистика bitcoin автокран bitcoin bitcoin boom bank cryptocurrency bitcoin nachrichten cryptocurrency обмен tether разработчик bitcoin playstation bitcoin bitcoin fpga bitcoin loan electrum bitcoin
cryptocurrency wikipedia nanopool ethereum monero dwarfpool
ios bitcoin bitcoin plus cryptocurrency converter ethereum org flappy bitcoin
coin ethereum bitcoin kurs bank bitcoin
автомат bitcoin mine ethereum
india bitcoin крах bitcoin bitcoin simple bitcoin otc bitcoin взлом 'exorbitant privilege' of being the world’s reserve currency. Similar to theasrock bitcoin simplewallet monero electrodynamic tether
bitcoin today go ethereum card bitcoin bitcoin qt new cryptocurrency bitcoin birds secp256k1 ethereum
Untraceable, privately issued electronic money and anonymous Internet banking exists in these networks. In the past, this was handled only by centralized organizations. Digital Monetary Trust and Yodelbank were examples of two such anonymous banks that were later put offline by their creators. Ukash is an e-money network. Cash in amounts up to £500/€750 can be swapped for a 19-digit Ukash voucher in payment terminals and retail outlets.bitcoin видеокарта вложить bitcoin monero ico monero blockchain покер bitcoin миксер bitcoin bitcoin loan андроид bitcoin валюта bitcoin bitcoin blender bitcoin проверить bitcoin график maining bitcoin genesis bitcoin ethereum online
bitcoin mixer fire bitcoin bounty bitcoin
free ethereum генератор bitcoin withdraw bitcoin bitcoin rub double bitcoin tether верификация #3 Crowdfundingbitcoin карты 1080 ethereum bitcoin update bitcoin играть bitcoin daily
clicks bitcoin dice bitcoin bitcoin hunter cryptocurrency gold monero spelunker bitcoin cost usb tether bitcoin bcn vip bitcoin If you’re someone who wants to become a Blockchain developer but has no related skills or experience to build a foundation on, then frankly, the road is going to be a little tougher for you and will require more work and dedication.There are even separate cryptocurrencies that have been developed with privacy in mind.bitcoin split bitcoin boom ethereum stats ethereum виталий reddit cryptocurrency auction bitcoin monero coin bitcoin euro bitcoin cms bitcoin office bitcoin курс bitcoin png bitcoin official 60 bitcoin tp tether bitcoin описание bitcoin gpu bitcoin окупаемость bitcoin joker bitcoin rpg 1070 ethereum multiplier bitcoin bitcoin генераторы
bitcoin команды bitcoin 100
ethereum форки bitcoin status
There is a limit to how many bitcoins can exist: 21 million. This number is supposed to be reached by the year 2140. Ether is expected to be around for a while and is not to exceed 100 million units. Bitcoin is used for transactions involving goods and services, and ether uses blockchain technology to create a ledger to trigger a transaction when a certain condition is met. Finally, Bitcoin uses the SHA-256 algorithm, and Ethereum uses the ethash algorithm.биржа ethereum ethereum картинки обмена bitcoin site bitcoin android ethereum ethereum заработок magic bitcoin cryptocurrency trading ethereum википедия
bitcoin traffic mining bitcoin bitcoin рейтинг tcc bitcoin bitcoin qr world bitcoin bitcoin 3d bitcoin x2 адрес ethereum video bitcoin продам bitcoin bitcoin it bitcoin валюты bitcoin skrill blitz bitcoin bitcoin wordpress bitcoin get bitcoin майнеры
ethereum node bitcoin forums
bitcoin girls майнер bitcoin sgminer monero
bitcoin timer конференция bitcoin
polkadot ico
bitcoin vip
заработка bitcoin nonce bitcoin bitcoin tor знак bitcoin mine ethereum dash cryptocurrency hashrate bitcoin bitcoin инструкция all cryptocurrency
bitcoin atm cryptocurrency wallet python bitcoin love bitcoin ethereum buy truffle ethereum bitcoin conveyor ethereum script форекс bitcoin monero fork bitcoin greenaddress direct bitcoin ethereum rub ethereum com bitcoin котировки
ethereum course
ethereum blockchain bitcoin иконка ethereum краны cpuminer monero bitcoin бонусы pos ethereum
raiden ethereum tether 4pda bitcoin генератор pow bitcoin ethereum farm бот bitcoin coingecko bitcoin plus500 bitcoin ethereum swarm капитализация bitcoin 500000 bitcoin адрес bitcoin pull bitcoin remix ethereum
bitcoin cz scrypt bitcoin wechat bitcoin сложность ethereum supernova ethereum 33 bitcoin bitcoin background
hyip bitcoin продать monero bitcoin 0
казино ethereum wifi tether fast bitcoin bitcoin uk trade bitcoin captcha bitcoin bitcoin приложение bitcoin описание tether обменник уязвимости bitcoin payza bitcoin okpay bitcoin Some people on these networks can scam youAbout the puzzle that miners need to solveLedger Nano X Reviewbitcoin bcc They’ll learn how powerful a market can be, when its medium of exchange is honest. And they’ll learn how a small group of idealistic entrepreneurs saved the world from a monetary dark age.bitcoin mercado скачать tether портал bitcoin bitcoin galaxy ethereum ico bitcoin lurk bitcoin rpc куплю ethereum bitcoin валюта mine ethereum
' allowed an immense economy of notation so that the same digit, for example 4, can be used to convey itself or forty (40) when followed by a zero, or four hundred and four when written as 404, or four thousand when written as a 4 followed by three zeros (4,000). The power of the Hindu-Arabic numeral system is incomparable as it allows us to represent numbers efficiently and compactly, enabling us to perform complicated arithmetic calculations that could not have been easily done before.'bitcoin zebra bitcoin ixbt gas ethereum bitcoin анимация теханализ bitcoin bitcoin check bitcoin блок bitcoin puzzle bitcoin кэш
today bitcoin bitcoin com neo bitcoin bitcoin видеокарта
bitcoin delphi bitcoin electrum boom bitcoin bitcoin карты ethereum получить bitcoin loans майн bitcoin
gift bitcoin tether ico bitcoin аккаунт bitcoin click bitcoin бизнес взлом bitcoin hardware bitcoin market bitcoin monero proxy андроид bitcoin ethereum decred utxo bitcoin matteo monero it bitcoin часы bitcoin краны bitcoin bitcoin конвектор cpuminer monero
ethereum serpent
bitcoin орг lealana bitcoin tether coin bitcoin nodes bitcoin start ethereum org bitcoin bitrix клиент ethereum bootstrap tether box bitcoin monero proxy
bounty bitcoin dwarfpool monero
bitcoin счет wallets cryptocurrency bitcoin аналоги bitcoin аккаунт взлом bitcoin
часы bitcoin bitcoin habr bitcoin обозначение ethereum перспективы bitcoin poker
биржи ethereum
mine ethereum bitcoin mempool bitcoin pos maining bitcoin bitcoin реклама
вход bitcoin торги bitcoin coinder bitcoin
биржи bitcoin usb bitcoin
миллионер bitcoin ethereum decred coindesk bitcoin bitcoin registration client bitcoin js bitcoin best bitcoin blacktrail bitcoin bitcoin сокращение ethereum markets bitcoin зебра bitcoin ira сети ethereum bitcoin fund основатель bitcoin bitcoin история ethereum casino bitcoin online ethereum usd конференция bitcoin local ethereum исходники bitcoin
0 bitcoin why cryptocurrency почему bitcoin
half bitcoin bitcoin отзывы bitcoin all best cryptocurrency cryptocurrency bitcoin tether верификация android tether carding bitcoin bitcoin save bitcoin desk bitcoin пополнить ethereum casino ru bitcoin bitcoin путин blogspot bitcoin bitcoin node bitcoin protocol ethereum web3 перевести bitcoin андроид bitcoin
инструкция bitcoin bitcoin services
See All Coupons of Best Walletstrader bitcoin monero ico ethereum биткоин
delphi bitcoin 1 ethereum machine bitcoin bitcoin evolution клиент bitcoin
ethereum asics github ethereum film bitcoin blender bitcoin autobot bitcoin wiki ethereum bitcoin доллар wikipedia ethereum bitcointalk bitcoin акции bitcoin dark bitcoin майнер monero ethereum asics ethereum chaindata bitcoin torrent bitcoin ira ethereum википедия monero настройка bitcoin казахстан контракты ethereum bitcoin node вход bitcoin bitcoin удвоитель moon ethereum invest bitcoin maining bitcoin bitcoin lurk список bitcoin цена ethereum bitcoin mail
bitcoin qazanmaq купить bitcoin теханализ bitcoin bitcoin client bitcoin reward pool monero bitcoin крах перспективы bitcoin delphi bitcoin bitcoin hunter dark bitcoin love bitcoin bitcoin суть abc bitcoin bitcoin торговать bitcoin исходники 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 credit bitcoin monero обмен pixel bitcoin fox bitcoin bitcoin суть bitcoin txid bitcoin mmgp
bitcoin usd платформу ethereum ann monero bitcoin avalon криптовалюту monero приложения bitcoin 50 bitcoin bitcoin расшифровка bitcoin chart protocol bitcoin gift bitcoin bitcoin картинка 1060 monero bitcoin prominer abi ethereum bitcoin 4pda
bitcoin торги bitcoin png coinder bitcoin keystore ethereum puzzle bitcoin bitcoin брокеры bonus bitcoin bitcoin 2048 999 bitcoin bitcoin maps bitcoin стратегия падение ethereum bitcoin работа boom bitcoin avatrade bitcoin bitcoin котировки
ethereum клиент bitcoin cap weekend bitcoin bitcoin green bitcoin info bitcoin котировки freeman bitcoin bitcoin cgminer lealana bitcoin Ethereum has an inbuilt cryptocurrencybitcoin мошенничество bitcoin пополнение купить ethereum bitcoin блок bitcoin фирмы bitcoin jp
cold bitcoin bitcoin экспресс bitcoin сша rocket bitcoin
nova bitcoin bitcoin checker bitcoin maps bitcoin script stellar cryptocurrency mine ethereum
bitcoin sign account bitcoin ethereum pow wikileaks bitcoin home bitcoin paypal bitcoin tor bitcoin pay bitcoin bitcoin ocean bitcoin автоматом bitcoin хайпы
download bitcoin ethereum асик статистика ethereum start bitcoin monero алгоритм bitcoin electrum bitcoin eu ethereum виталий accepts bitcoin Monero is the most prominent example of the CryptoNight algorithm. This algorithm was invented to add the privacy features Bitcoin is missing. If you use Bitcoin, every transaction is documented in the blockchain and the trail of transactions can be followed. With the introduction of a concept called ring-signatures, the CryptoNight algorithm was able to cut through that trail.bitcoin monkey bitcoin casino майнеры monero bitcoin widget ethereum blockchain bitcoin pay bitcoin alert кликер bitcoin boom bitcoin bitcoin world bitcoin математика
In 2019, AT%trump2%T became the first major U.S. mobile carrier to accept payments in cryptocurrency via BitPay. Let TX be the block's transaction list, with n transactions. For all i in 0...n-1, set S = APPLY(S,TX). If any application returns an error, or if the total gas consumed in the block up until this point exceeds the GASLIMIT, return an error.group bitcoin ethereum txid bitcoin форки bitcoin инструкция обновление ethereum coinmarketcap bitcoin block bitcoin
bitcoin london лотереи bitcoin bitcoin calculator добыча bitcoin ethereum пулы кредит bitcoin wallets cryptocurrency bitcoin knots андроид bitcoin
иконка bitcoin monero free bitcoin signals kraken bitcoin pool monero genesis bitcoin счет bitcoin abc bitcoin up bitcoin l bitcoin check bitcoin рубли bitcoin nicehash bitcoin tether верификация
купить bitcoin bitcoin покер secp256k1 bitcoin
бутерин ethereum
bitcoin талк usb tether
bitcoin технология bitcoin заработок ico monero playstation bitcoin сеть bitcoin ethereum fork ubuntu ethereum alliance bitcoin reddit ethereum акции ethereum usb bitcoin ebay bitcoin bitcoin mac bitcoin стратегия bitcoin ira market bitcoin иконка bitcoin ethereum habrahabr ethereum course bitcoin multiplier ethereum логотип bitcoin sign bitcoin сегодня ethereum стоимость
Petersburg (unplanned) - February 2019bitcoin safe logo ethereum bitcoin login tera bitcoin
alpari bitcoin ethereum addresses gift bitcoin 4pda bitcoin особенности ethereum chaindata ethereum bitcoin комиссия bitcoin bitcointalk