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.
bitcoin бот bitcoin информация bitcoin сегодня wifi tether
billionaire bitcoin
ethereum вывод proxy bitcoin bitcoin loan king bitcoin ava bitcoin bitcoin loan
bitcoin fake all cryptocurrency bitcoin завести electrodynamic tether bitcoin сегодня ethereum пулы
bitcoin boom clicks bitcoin курс ethereum sgminer monero bitcoin scrypt запуск bitcoin bitcoin пул bitcoin video waves bitcoin blue bitcoin bitcoin пожертвование Cryptocurrencies 101: A Blockchain Overviewethereum forum water bitcoin cryptocurrency tech bitcoinwisdom ethereum bitcoin ruble decred cryptocurrency bitcoin base bitcoin отзывы кран bitcoin ethereum продам
metropolis ethereum battle bitcoin bitcoin список ethereum news ethereum прогноз криптовалют ethereum best bitcoin exmo bitcoin usa bitcoin рубли bitcoin monero майнинг bitcoin future bitcoin cranes spend bitcoin bitcoin алгоритм bitcoin mmgp bitcoin bounty block bitcoin bitcoin окупаемость global bitcoin bitcoin пополнить monero хардфорк homestead ethereum bitcoin goldmine
pay bitcoin bitcoin падает торги bitcoin bitcoin source конвертер ethereum бесплатные bitcoin 1060 monero keys bitcoin hub bitcoin bitcoin rigs bitcoin халява bitcoin приложения bitcoin проблемы регистрация bitcoin bitcoin stock ethereum википедия ethereum pow bitcoin 123 ethereum bitcointalk bitcoin register проблемы bitcoin
ethereum claymore падение ethereum лото bitcoin
bitcoin direct ethereum dao обзор bitcoin токен ethereum ● Crossing the Chasm: Bitcoin has gained credibility with early adopters, including somebitcoin миллионеры bitcoin converter bitcoin fund
bitcoin genesis bitcoin форки халява bitcoin bitcoin стоимость exchanges bitcoin bitcoin foundation ethereum miners
bitcoin script bitcoin xl invest bitcoin
новости bitcoin ethereum rig usd bitcoin bitcoin cryptocurrency установка bitcoin bitcoin терминал siiz bitcoin tether usd
monero настройка bitcoin 0 birds bitcoin
пример bitcoin bitcoin pattern difficulty monero ethereum swarm bitcoin дешевеет bitcoin перевод cms bitcoin bitcoin server
bitcoin статья deep bitcoin bitcoin office x2 bitcoin games bitcoin bitcoin reward вклады bitcoin sberbank bitcoin bitcoin обменник monero dwarfpool bitcoin ethereum стоимость ethereum fork bitcoin xt работа bitcoin wirex bitcoin ethereum rig сколько bitcoin bitcoin fpga bitcoin инвестирование
bank bitcoin оборот bitcoin bitcoin blockstream bitcoin матрица приложение tether ethereum scan
gek monero matteo monero bitcoin telegram charts bitcoin 'GHOST' = 'Greedy Heaviest Observed Subtree'Blockchain Career Guidebitcoin novosti ethereum ann bitcoin explorer site bitcoin secp256k1 bitcoin дешевеет bitcoin monero asic kurs bitcoin rise cryptocurrency 2x bitcoin hashrate bitcoin
статистика ethereum topfan bitcoin
cryptocurrency это bitcoin brokers bitcoin wmx
Bitcoin is a digital bearer instrument. It is a way to exchange money or assets between parties with no pre-existing trust: A string of numbers is sent over email or text message in the simplest case. The sender doesn’t need to know or trust the receiver or vice versa. Related, there are no chargebacks — this is the part that is literally like cash – if you have the money or the asset, you can pay with it; if you don’t, you can’t. This is brand new. This has never existed in digital form before.Free bitcoin wallets are available for all major operating systems and devices to serve a variety of your needs. For example, you can install an app on your mobile device for everyday use or you can have a wallet only for online payments on your computer. In any case, choosing a wallet is easy and can be done in minutes.bitcoin gif Shop: Over 8,000 global merchants accept cryptocurrency via Coinbase Commerce.game bitcoin pirates bitcoin ethereum курс bitcoin реклама bitcoin scripting bitcoin apple bitcoin создатель de bitcoin bitcoin brokers ethereum alliance free bitcoin 2x bitcoin moneybox bitcoin падение ethereum coingecko ethereum asus bitcoin bitcoin инвестирование скрипт bitcoin bitcoin сбербанк monero купить
ethereum btc bitcoin кредиты платформу ethereum bitcoin pizza майнер monero перспективы bitcoin ethereum контракт биржа ethereum
взлом bitcoin bitcoin сети iso bitcoin kinolix bitcoin
bitcoin spinner
bitcoin доходность китай bitcoin monero faucet bitcoin nodes Ethereum allows you to move money, or make agreements, directly with someone else. You don't need to go through intermediary companies.ethereum контракт Before You Invest in Ethereumbitcoin мастернода bitcoin pool Limitations of mixing servicesbitcoin indonesia monero fee bitcoin magazine cryptocurrency gold zcash bitcoin price bitcoin 1080 ethereum ethereum algorithm flypool monero bitcoin 2x nvidia monero
bitcoin значок bitcoin lurk сложность bitcoin ethereum логотип bitcoin блокчейн autobot bitcoin
ethereum swarm bitcoin mining
ethereum poloniex bitcoin network ethereum icon
doubler bitcoin bitcoin банкнота что bitcoin bitcoin коллектор фермы bitcoin bitcoin is bitcoin машины bitcoin information mail bitcoin delphi bitcoin bitcoin видеокарты bitcoin mac фермы bitcoin bitcoin fpga wikileaks bitcoin tether комиссии кошелька bitcoin fox bitcoin
demo bitcoin tether app видеокарты ethereum bitcoin future agario bitcoin monero amd ethereum linux api bitcoin bitcoin бесплатный get bitcoin bitcoin видеокарты monero usd bitcoin обмен
mempool bitcoin bitcoin ротатор
продать bitcoin rpg bitcoin игра ethereum
make bitcoin coin bitcoin cryptonight monero часы bitcoin p2pool ethereum bitcoin froggy обменник bitcoin
курсы bitcoin monero client ethereum сайт bitcoin mining bitcoin pizza bitcoin air bitcoin official monero калькулятор bitcoin machine bitcoin bloomberg euro bitcoin bitcoin heist
bitcoin mail кости bitcoin bitcoin buying daemon bitcoin bitcoin book game bitcoin click bitcoin difficulty monero polkadot decred cryptocurrency monero proxy bitcoin payment china bitcoin ethereum twitter complement to their existing gold holdings.ethereum pow maining bitcoin
mac bitcoin bitcoin frog bitcoin venezuela bitcoin портал кран bitcoin bitcoin etherium minecraft bitcoin bitcoin автоматически bitcoin pps казино ethereum карты bitcoin 5 bitcoin
mining ethereum konverter bitcoin
20 bitcoin
bitcoin trust bitcoin hunter bitcoin froggy microsoft bitcoin bitcoin accelerator equihash bitcoin 4pda tether cryptocurrency trading биржи monero accepts bitcoin ethereum web3 сборщик bitcoin логотип bitcoin bitcoin dat bitcoin новости pos bitcoin location bitcoin mt5 bitcoin bitcoin обвал bitcoin настройка bitcoin wm cryptocurrency mining bitcoin rt bitcoin mmm bitcoin развод инструкция bitcoin
ethereum contracts bitcoin daily mooning bitcoin nxt cryptocurrency bitcoin pps bitcoin начало kaspersky bitcoin testnet bitcoin bitcoin roll monero ico оплатить bitcoin The legality of Bitcoin mining depends entirely on your geographic location. The concept of Bitcoin can threaten the dominance of fiat currencies and government control over the financial markets. For this reason, Bitcoin is completely illegal in certain places.обменять bitcoin bitcoin nvidia падение ethereum
bitcoin сервисы bitcoin instagram bitcointalk monero bitcoin список bitcoin frog bitcoin passphrase alipay bitcoin bitcoin dynamics
birds bitcoin cryptocurrency gold bitcoin uk robot bitcoin alpari bitcoin bitcoin мастернода bitcoin js bitcoin динамика bitcoin 2020 криптовалюту monero x2 bitcoin добыча monero ethereum упал Thus, bit gold will not be fungible based on a simple function of, for example, the length of the string. Instead, to create fungible units dealers will have to combine different-valued pieces of bit gold into larger units of approximately equal value. This is analogous to what many commodity dealers do today to make commodity markets possible. Trust is still distributed because the estimated values of such bundles can be independently verified by many other parties in a largely or entirely automated fashion.Consfaucet bitcoin bitcoin рбк golden bitcoin bitcoin google masternode bitcoin ethereum 1070 casino bitcoin legal bitcoin register bitcoin bitcoin mempool 2016 bitcoin monero nvidia ethereum stratum обзор bitcoin 2016 bitcoin
bitcoin приложение rx580 monero
bitcoin transaction alpha bitcoin reddit bitcoin avatrade bitcoin bitcoin сайт monero blockchain mail bitcoin bitcoin landing faucet bitcoin майнить bitcoin monero купить ethereum котировки bitcoin бесплатные
ethereum прибыльность bitcoin сервера bitcoin super difficulty bitcoin local ethereum ethereum homestead bitcoin прогноз
bitcoin billionaire
шрифт bitcoin сложность ethereum сборщик bitcoin unconfirmed bitcoin bitcoin хабрахабр bitcoin прогнозы криптовалюту bitcoin ethereum coin продам ethereum bitcoin сатоши bitcoin graph bitcoin коллектор перевод ethereum
пожертвование bitcoin bitcoin майнер multiply bitcoin bitcoin change forum ethereum 1 monero трейдинг bitcoin testnet ethereum hub bitcoin bitcoin софт казино ethereum bitcoin token bitcoin софт bitcoin miner statistics bitcoin machines bitcoin roboforex bitcoin java bitcoin bitcoin code CRYPTO'what happens when a blockchain diverges into two potential paths forward'bitcoin 50000 monero fork Some of the other widely used platforms for building Blockchain include Hyperledger, Multichain, Open chain.advcash bitcoin bitcoin goldman tp tether конвертер ethereum difficulty ethereum topfan bitcoin
bitcoin перспективы tails bitcoin tx bitcoin яндекс bitcoin topfan bitcoin bitcoin com япония bitcoin logo ethereum cryptocurrency news рынок bitcoin logo ethereum bitcoin графики
bitcoin center bitcoin майнер bitcoin token bitcoin minergate bitcoin gold тинькофф bitcoin bitcoin mt4 фарминг bitcoin Hashing 24 Review: Hashing24 has been involved with Bitcoin mining since 2012. They have facilities in Iceland and Georgia. They use modern ASIC chips from BitFury deliver the maximum performance and efficiency possible.ethereum news bitcoin plus500 wallet tether x2 bitcoin продаю bitcoin bitcoin etherium bitcoin putin qr bitcoin bitcoin регистрация
alien bitcoin micro bitcoin salt bitcoin mac bitcoin trinity bitcoin ethereum картинки ethereum курсы ethereum описание bitcoin луна
прогноз bitcoin chaindata ethereum bitcoin brokers monero proxy waves bitcoin instant bitcoin ecopayz bitcoin
tether отзывы abi ethereum bitcoin paper bitcoin save coinmarketcap bitcoin пулы bitcoin пример bitcoin bitcoin play coins bitcoin ethereum описание
pow bitcoin 1000 bitcoin
bitcoin cli биржи monero bitcoin s обмена bitcoin
keepkey bitcoin monero gpu accepts bitcoin bitcoin dollar alpari bitcoin контракты ethereum Because hot wallets are connected to the internet, they tend to be somewhat more vulnerable to hacks and theft than cold storage methods.bitcoin metal bitcoin friday opencart bitcoin ethereum кошельки json bitcoin bitcoin otc coin bitcoin
bitcoin xpub майнеры monero bitcoin пополнить
bitcoin drip
bitcoin save bitcoin rpg locals bitcoin carding bitcoin eth bitcoin bitcoin exchange bitcoin криптовалюта How To Invest In Litecoinethereum pools
total cryptocurrency
Lastly, paper voucher systems enabling users to acquire smaller quantities of Bitcoin at street kiosks or from corner shops are an important piece of the puzzle. Vouchers work by exchanging fiat for a receipt with a code on it; settlement can be done later. I have a vision of sarafis in the streets of Tehran and Kabul hawking Bitcoin vouchers — small-scale entrepreneurial activity is much more robust to government activity than larger exchanges in a demonetization event. Fastbitcoins and Azteco are two startups advancing this use-case; I expect many others to join them.stake bitcoin alpari bitcoin favicon bitcoin bitcoin flapper bitcoin boom bitcoin favicon bitcoin tm eID walletbitcoin покер claymore monero исходники bitcoin
bitcoin rates
падение ethereum bitcoin formula cardano cryptocurrency платформу ethereum nanopool monero
курс bitcoin кликер bitcoin best bitcoin monero algorithm bitcoin crash bitcoin donate ubuntu bitcoin сигналы bitcoin Smart contracts allow you to create voting systems in which you can add and remove members, change voting rules, change debating periods, or alter the majority rule. For instance, you can create a vote for a decision within a decentralized autonomous organization. Rather than a central authority making a decision, a voting mechanism within the organization can determine whether the proposal is accepted or rejected.ethereum info what is cryptocurrencymonero client token ethereum bitcoin bloomberg Bitcoin Core includes code that detects a hard fork by looking at block chain proof of work. If a non-upgraded node receives block chain headers demonstrating at least six blocks more proof of work than the best chain it considers valid, the node reports a warning in the 'getnetworkinfo' RPC results and runs the -alertnotify command if set. This warns the operator that the non-upgraded node can’t switch to what is likely the best block chain.bitcoin сбор bitcoin green
ava bitcoin bitcoin donate programming bitcoin ethereum mist ethereum calc bitcoin комиссия captcha bitcoin bitcoin чат bitcoin blog bitcoin com
ethereum биржи mt5 bitcoin
faucets bitcoin bye bitcoin ethereum contracts tether wifi bitcoin knots
alpari bitcoin rate bitcoin транзакции ethereum bitcoin депозит компания bitcoin обменник ethereum spots cryptocurrency tether комиссии dash cryptocurrency обновление ethereum bitcoin индекс difficulty ethereum reddit bitcoin roulette bitcoin bitcoin tracker bitcoin darkcoin bitcoin analysis ru bitcoin bitcoin bux bitcoin падение mastering bitcoin bitcoin валюта луна bitcoin bitcoin course generator bitcoin
average bitcoin bitcoin pay android tether Once you sent your Bitcoin to someone, there is no chance of having them back except it will be return by the recipient. They will evaporate forever.bitcoin online 33 bitcoin bistler bitcoin 16 bitcoin capitalization cryptocurrency
bitcoin сервисы 10000 bitcoin drip bitcoin mercado bitcoin ethereum эфириум fee bitcoin часы bitcoin bitcoin смесители отзывы ethereum bitcoin протокол bitcoin kurs
bitcoin теханализ siiz bitcoin bitcoin flex bitcoin 4 bitcoin биткоин
simplewallet monero visa bitcoin bitcoin daily
bitcoin сша обменять monero bitcoin com ethereum programming
land bitcoin видео bitcoin maining bitcoin hashrate ethereum bitcoin favicon ethereum calculator торрент bitcoin bitcoin make source bitcoin android tether doubler bitcoin segwit2x bitcoin polkadot su
bitcoin journal bitcoin компьютер bitcoin spin dash cryptocurrency qiwi bitcoin bitcoin mail продам ethereum bitcoin взлом форки ethereum bitcoin конец
ethereum проблемы cold bitcoin monero pools bitcoin code
bitcoin symbol rx470 monero ферма bitcoin monero coin bitcoin xbt georgia bitcoin scrypt bitcoin bitcoin nodes rocket bitcoin bitcoin foto bitcoin биткоин ethereum russia tether usb bitcoin puzzle пулы monero mine monero testnet bitcoin bitcoin торговля simple bitcoin инструкция bitcoin monero hashrate token ethereum bitcoin курсы bitcoin status
bitcoin сборщик doubler bitcoin bitcoin сбор биржа bitcoin bitcoin purse ethereum miner bitcoin nodes 1080 ethereum ethereum chaindata monero github зарабатываем bitcoin рулетка bitcoin bitcoin simple
On 6 December 2017 the software marketplace Steam announced that it would no longer accept bitcoin as payment for its products, citing slow transactions speeds, price volatility, and high fees for transactions.monero cryptonote клиент bitcoin компания bitcoin спекуляция bitcoin bitcoin valet data bitcoin auto bitcoin ethereum cgminer 4000 bitcoin сервисы bitcoin бесплатные bitcoin
ethereum microsoft бесплатно bitcoin статистика ethereum bitcoin bounty график monero
ethereum logo логотип bitcoin bitcoin elena bitcoin динамика
iso bitcoin расшифровка bitcoin bitcoin описание monero биржи How does a dapp work?The Ethereum Virtual Machine (EVM): The part of Ethereum that executes the rules of Ethereum, and makes sure a submitted transaction or smart contract follows the rules. займ bitcoin bitcoin иконка ethereum btc bitcoin bitcointalk
mastering bitcoin gek monero gui monero
bitcoin gold bitcoin компьютер bitcoin wiki
ethereum news
pool bitcoin bitcoin protocol bitcoin zebra bitcoin таблица oil bitcoin криптовалюта monero bitcoin usa ethereum telegram проверка bitcoin bitcoin ether bitcoin обналичить ethereum ротаторы transactions bitcoin прогноз ethereum
ethereum game bitcoin фарминг терминал bitcoin bitcoin обучение index bitcoin
cgminer ethereum bitcoin novosti ethereum script loan bitcoin ethereum addresses bitcoin rt курс bitcoin
bloomberg bitcoin 1 ethereum options bitcoin bitcoin 9000 bitcoin индекс обналичить bitcoin ru bitcoin bitcoin abc bitcoin основатель видео bitcoin token ethereum приложение bitcoin The bitcoin network is currently processing just under four transactions per second as of August 2020, with transactions being logged in the blockchain every 10 minutes.7 For comparison, Visa can process somewhere around 65,000 transactions per second.8 As the network of bitcoin users continues to grow, however, the number of transactions made in 10 minutes will eventually exceed the number of transactions that can be processed in 10 minutes. At that point, waiting times for transactions will begin and continue to get longer, unless a change is made to the bitcoin protocol.rocket bitcoin bitcoin казино ethereum farm nanopool ethereum
bitcoin donate bitcoin coins super bitcoin bitcoin лохотрон bitcoin биржи alpari bitcoin best bitcoin особенности ethereum bitcoin wm bitcoin заработать bitcoin grafik click bitcoin
bitcoin golden bitcoin local bitcoin bitcointalk monero cryptonote monaco cryptocurrency фермы bitcoin bitcoin king cms bitcoin $11.4 billionmt5 bitcoin