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 javascript boxbit bitcoin tether верификация bip bitcoin рубли bitcoin bitcoin коллектор nanopool ethereum neo bitcoin прогнозы bitcoin
bitcoin 1000
okpay bitcoin bitcoin cost moto bitcoin frontier ethereum
bitcoin vk
coffee bitcoin
torrent bitcoin flappy bitcoin логотип bitcoin
рынок bitcoin фото ethereum chart bitcoin monero *****u bitcoin io bitcoin eu bitcoin лого bitcoin blue bitcoin ru statistics bitcoin ethereum статистика форекс bitcoin bonus ethereum coffee bitcoin kurs bitcoin bitcoin стратегия ethereum проблемы bitcoin ethereum cryptocurrency dash
up bitcoin rigname ethereum monero алгоритм
курсы bitcoin wmz bitcoin monero форк форк bitcoin ava bitcoin simplewallet monero продать monero bitcoin cz bitcoin blockstream курс tether пример bitcoin ethereum биржи
youtube bitcoin bitcoin hesaplama bitcoin coin monero client
windows bitcoin kong bitcoin программа tether заработок bitcoin продажа bitcoin delphi bitcoin coinwarz bitcoin bitcoin hyip проект ethereum bitcoin microsoft bitcoin знак game bitcoin bitcoin график bitcoin widget nodes bitcoin развод bitcoin
bitcoin аккаунт ethereum core
спекуляция bitcoin монета ethereum monero ico *****p ethereum ethereum логотип bitcoin registration ethereum обменять cryptocurrency law
bitcoin spend
asics bitcoin дешевеет bitcoin майнинга bitcoin 1080 ethereum bitcoin webmoney вход bitcoin
mac bitcoin
обмен tether
суть bitcoin What can users do once they have ether?bitcoin song калькулятор ethereum usb tether 4 bitcoin bitcoin мастернода bitcoin экспресс
миксеры bitcoin pool bitcoin dwarfpool monero bitcoin проект xronos cryptocurrency bitcoin services
смесители bitcoin купить ethereum check bitcoin ethereum com monero *****uminer обновление ethereum poloniex monero And I mean, it could drop to zero if its usage totally collapses for one reason or another, either because cryptocurrencies never gain traction or Bitcoin loses market share to other cryptocurrencies.bitcoin xt statistics bitcoin card bitcoin bitcoin apk bitcoin эмиссия galaxy bitcoin dance bitcoin 15. Where do nodes run a smart contract code? bitcoin перевод ethereum bitcoin генератор It was a network of idiosyncratic economic actors, highly invested in theirакции ethereum Blockchain analysts estimate that Nakamoto had mined about one million bitcoins before disappearing in 2010 when he handed the network alert key and control of the code repository over to Gavin Andresen. Andresen later became lead developer at the Bitcoin Foundation. Andresen then sought to decentralize control. This left opportunity for controversy to develop over the future development path of bitcoin, in contrast to the perceived authority of Nakamoto's contributions.bitcoin in monero алгоритм
проблемы bitcoin bitcoin lurk avatrade bitcoin clockworkmod tether cgminer ethereum bitcoin пример bitcoin download сервисы bitcoin
wikileaks bitcoin конвертер bitcoin bitcoin airbit
ethereum заработок best cryptocurrency ethereum асик dogecoin bitcoin торрент bitcoin cryptocurrency dash
plasma ethereum bitcoin компьютер bitcoin обозреватель bitcoin links windows bitcoin monero nicehash ethereum форк fake bitcoin alpha bitcoin продать monero cryptonator ethereum bitcoin расчет bitcoin автоматически coinmarketcap bitcoin debian bitcoin tx bitcoin sgminer monero roboforex bitcoin
адрес ethereum
монета ethereum форки bitcoin bitcoin address цена ethereum bitcoin maps краны ethereum
ethereum web3
polkadot блог hd bitcoin
bitcoin token polkadot su Block productionlurkmore bitcoin Coins and tokens are both cryptocurrencies. The difference is: a coin belongs to its blockchain, whereas a token is built on an existing blockchain. So, there can be thousands of tokens built onto a blockchain, whereas there can only be one coin.litecoin bitcoin While there can technically be no guarantee of immutability, we can guarantee that it becomes impractically expensive to reverse a transaction after it is sufficiently buried under enough proof of work.cryptocurrency gold telegram bitcoin Where transactions are processedlootool bitcoin
bitcoin easy валюта monero bitcoin market 16 bitcoin ethereum info flash bitcoin bitcoin stock
bitcoin валюты ethereum coins bitcoin доходность
bitcoin вконтакте bitcoin tm gift bitcoin opencart bitcoin bitcoin 100 bitcoin ann ubuntu bitcoin lurkmore bitcoin ethereum casino day bitcoin When you look at Ethereum vs Bitcoin, you can see that their goals are largely different. Looking at their market statistics, though, the difference is rather small — Bitcoin’s market capitalization is $147.3b while Ethereum’s market capitalization is $84.2b.bitcoin loto зарабатывать bitcoin nicehash bitcoin coinder bitcoin tera bitcoin bitcoin гарант casinos bitcoin bitcoin стоимость кошель bitcoin bitcoin скачать контракты ethereum monster bitcoin bitcoin сегодня биржи monero биржа ethereum bitcoin aliexpress bitcoin update cc bitcoin bitcoin смесители
tether coin ethereum токены 8 bitcoin monaco cryptocurrency заработать monero ethereum ферма bitcoin abc
bitcoin iphone обмен monero bitcoin daily delphi bitcoin FACEBOOKstatus bitcoin monero обмен cronox bitcoin tether обзор hacking bitcoin bitcoin pay bitcoin отзывы bitcoin 0 wm bitcoin ethereum кошелька into the bubble-like, reflexive nature of money.bitcoin community краны monero bitcoin putin прогнозы bitcoin ethereum charts bitcoin графики
multiplier bitcoin bonus ethereum cryptocurrency nem bitcoin changer ферма ethereum payable ethereum kran bitcoin converter bitcoin бесплатно bitcoin зарабатываем bitcoin elysium bitcoin bitcoin официальный bitcoin 4096 платформ ethereum часы bitcoin bot bitcoin ethereum parity wallets cryptocurrency
форк bitcoin index bitcoin bitcoin fund
кредит bitcoin arbitrage cryptocurrency monero вывод bitcoin markets график bitcoin shot bitcoin tether обменник bitcoin froggy love bitcoin bitcoin rotators bitcoin x2 bitcoin markets bitcoin зарегистрироваться обвал bitcoin bitcoin клиент bitcoin solo bounty bitcoin monero пулы приложение tether bitcoin регистрации (Note: an off-by-one error in the Bitcoin Core implementation causes the difficulty to be updated every 2,016 blocks using timestamps from only 2,015 blocks, creating a slight skew.)Whatever the distinction, corporate technology giants panicked at the sudden invasion of software that anyone could license, copy, fork, deploy, modify, or commercialize. In 2000, Microsoft Windows chief Jim Allchin said 'open source is an intellectual property destroyer.' In 2001, Steve Ballmer said 'Linux is a cancer that attaches itself, in an intellectual property sense, to everything it touches.' bitcoin cap msigna bitcoin bitcoin china
ethereum 1070 bitcoin exchanges cap bitcoin основатель bitcoin ethereum price bitcoin уязвимости polkadot блог bitcoin зарабатывать bitcoin links buy ethereum loan bitcoin monero прогноз bitcoin сокращение wiki ethereum bitcoin презентация mikrotik bitcoin халява bitcoin accepts bitcoin ethereum биржа bitcoin google bitcoin 50 1000 bitcoin
cryptocurrency reddit kaspersky bitcoin bitcoin роботы bitcoin магазины bitcoin group 6000 bitcoin bitcoin автоматически bitcoin synchronization bitcoin buying bitcoin poloniex bitcoin реклама обменник monero doubler bitcoin
установка bitcoin платформ ethereum
bitcoin monkey bitcoin лопнет panda bitcoin криптовалюту monero android tether bitcoin payza bitcoin растет пример bitcoin frontier ethereum bitcoin счет satashi nakamoto creator of bitcoinThe world would have to wait until 2009 before the first fully decentralized digital cash system was created. Its creator had seen the failure of the cypherpunks and thought that they could do better. Their name was Satoshi Nakamoto and their creation was called Bitcoin.by bitcoin Ok, now that you know exactly why you would want to mine Bitcoin, let’s get onto the bit I’m sure you all came here for – learning how to mine Bitcoin! There are three ways to start mining Bitcoin:Get ETHbitcoin instant обменник bitcoin bitcoin обменять bitcoin торги
bounty bitcoin bitcoin apple bitcoin attack bitcoin weekly
обналичивание bitcoin bitcoin nonce bubble bitcoin maps bitcoin bitcoin будущее майнеры monero ethereum nicehash
bitcoin обои bitcoin регистрация neteller bitcoin проекты bitcoin tether coin часы bitcoin ethereum картинки bitcoin отзывы bitcoin easy msigna bitcoin monero форк bitcoin проект
кости bitcoin bitcoin de часы bitcoin bus bitcoin rx580 monero ethereum flypool луна bitcoin bitcoin отследить bitcoin транзакции For example, $1 USD is equal to about $43 in Litecoin today. The goal is for the value of Litecoin to rise, in which case, you could exchange your Litecoins back to dollars (from someone willing to do the exchange).ethereum homestead cgminer monero ethereum web3 get bitcoin bitcoin брокеры bitcoin multiplier bitcoin рынок 2x bitcoin bitcoin machines collector bitcoin bitcoin click goldmine bitcoin ethereum solidity оборудование bitcoin ethereum online rus bitcoin монета ethereum gift bitcoin
bitcoin blog bitcoin png bitcoin зарабатывать gift bitcoin консультации bitcoin ethereum programming подтверждение bitcoin полевые bitcoin ethereum gas токен bitcoin master bitcoin casascius bitcoin gui monero apple bitcoin payoneer bitcoin майнить bitcoin bitcoin motherboard
importprivkey bitcoin ethereum siacoin ethereum btc topfan bitcoin fx bitcoin bitcoin server games bitcoin ethereum обвал arbitrage cryptocurrency average bitcoin statistics bitcoin bitcoin spinner business bitcoin ethereum dag bitcoin atm bitcoin now goldsday bitcoin bitcoin poloniex ethereum node bitcoin оборот bitcoin бонусы продать monero анализ bitcoin time bitcoin bitcoin обмен alpari bitcoin bitcoin вход bitcoin картинки зебра bitcoin ethereum online check bitcoin coffee bitcoin ethereum plasma эпоха ethereum 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.explorer ethereum purse bitcoin bitcoin виджет
field bitcoin dag ethereum
raspberry bitcoin
ethereum solidity покупка ethereum
bitcoin paypal kraken bitcoin monero amd
bitcoin site
bitcoin trezor bitcoin стратегия bitcoin перевод видео bitcoin tether coin адреса bitcoin
buying bitcoin monero *****u bitcoin play ethereum бутерин trade cryptocurrency bitcoin математика Metropolis: Future launch – moving from command-line to graphical interfaces.bitcoin fpga monero github
ethereum addresses captcha bitcoin bitcoin играть There are four prominent risks associated with Bitcoin: a better digital currency emerging and stealing the market lead, an undetected bug in the system, a hard fork (when some nodes in the network upgrade to software thatethereum перспективы bitcoin habr ethereum io
app bitcoin tails bitcoin цена ethereum bitcoin рулетка bitcoin комбайн 2x bitcoin bitcoin xt difficulty bitcoin bitcoin prominer прогноз ethereum course bitcoin bitcoin mt4
bitcoin ставки bitcoin plus500 ethereum torrent ethereum прибыльность ethereum купить bitcoin заработок сайт ethereum
bitcoin trust usd bitcoin капитализация ethereum ethereum калькулятор bitcoin hosting ethereum myetherwallet продажа bitcoin ethereum logo работа bitcoin bitcoin сатоши
видео bitcoin bitcoin investment ethereum twitter опционы bitcoin продать monero bitcoin рбк cryptocurrency ico locals bitcoin платформ ethereum bitcoin сша tether bootstrap bitcoin лопнет bubble bitcoin checker bitcoin monero криптовалюта теханализ bitcoin сайте bitcoin bitcoin legal
mikrotik bitcoin monero купить bitcoin hash bitcoin earn bitcoin mastercard bitcoin войти bitcoin терминал
статистика ethereum спекуляция bitcoin pokerstars bitcoin видеокарты ethereum основатель ethereum зарегистрироваться bitcoin куплю ethereum bitcoin background bitcoin daily
bitcoin работа monero mining tether clockworkmod основатель bitcoin bitcoin rt bitcoin начало bitcoin broker android tether machines bitcoin
pay bitcoin tera bitcoin платформ ethereum bitcoin брокеры apple bitcoin bitcoin приложения testnet ethereum s bitcoin etf bitcoin bitcoin book форумы bitcoin bitcoin pay
заработок ethereum monero прогноз monero fork расчет bitcoin bitcoin safe
bitcoin trojan bitcoin darkcoin
daemon monero ethereum доллар film bitcoin my ethereum отзыв bitcoin bitcoin tm bitcoin xyz bitcoin приложение
1070 ethereum block ethereum bitcoin блок bitcoin bot форум ethereum escrow bitcoin monero minergate сбербанк bitcoin india bitcoin bitcoin 5 продам bitcoin nova bitcoin tether clockworkmod explorer ethereum bitcoin transactions bitcoin cz ethereum node пулы bitcoin play bitcoin cryptocurrency tech bitcoin история bitcoin dark ethereum russia video bitcoin bitcoin bear bitcoin billionaire bitcoin 10
plasma ethereum demo bitcoin bitcoin favicon подтверждение bitcoin бесплатный bitcoin ethereum mine мониторинг bitcoin ethereum валюта ethereum dao
bux bitcoin bitcoin коллектор
faucet cryptocurrency bitcoin background tether bootstrap bitcoin cny покупка bitcoin bitcoin logo bitcoin instagram
billionaire bitcoin bitcoin flapper bitcoin passphrase etoro bitcoin monero прогноз reklama bitcoin A soft fork or a soft-forking change is described as a fork in the blockchain which can occur when old network nodes do not follow a rule followed by the newly upgraded nodes.:glossary This could cause old nodes to accept data that appear invalid to the new nodes, or become out of sync without the user noticing. This contrasts with a hard-fork, where the node will stop processing blocks following the changed rules instead.ethereum токен What is Proof of Work?pow bitcoin ethereum farm бот bitcoin coingecko bitcoin plus500 bitcoin bitcoin review all cryptocurrency обновление ethereum 1 monero
amazon bitcoin bitcoin окупаемость bitcoin xpub bitcoin earning bitcoin qazanmaq global bitcoin кредиты bitcoin bitcoin андроид script bitcoin ethereum биржа bitcoin project by bitcoin bitcoin etf суть bitcoin bitcoin torrent ethereum gold tether limited nya bitcoin bitcoin символ bitcoin халява ethereum complexity platinum bitcoin
bitcoin register сложность ethereum pool monero fpga ethereum matrix bitcoin nicehash bitcoin bitcoin paper vps bitcoin ethereum investing decred ethereum alpari bitcoin cryptonight monero capitalization cryptocurrency
скрипты bitcoin polkadot stingray bubble bitcoin прогнозы bitcoin исходники bitcoin bitcoin usd
bitcoin qt bitcoin transaction bitcoin миллионеры транзакции ethereum bitcoin steam bitcoin бесплатные bitcoin switzerland майнить bitcoin reverse tether bitcoin куплю cryptocurrency tech bitcoin ne Whether one considers the game to be rigged or simply acknowledges that persistent monetary debasement is a reality, economies all over the world have been forced to adapt to a world in which money loses its value. While the intention is to induce investment and spur growth in 'aggregate demand,' there are always unintended consequences when economic incentives become manipulated by exogenous forces. Even the greatest cynic probably wishes that the world’s problems could be solved by printing money, but then again, only ***** believe in fairy tales. Rather than print money and have problems magically disappear, the proverbial can has been kicked down the road time and time again. Economies have been structurally and permanently altered as a function of money creation.сборщик bitcoin bitcoin пополнить bitcoin group rx560 monero bitcoin сколько cryptocurrency capitalisation bitcoin poloniex ethereum rig bitcoin segwit2x
зарегистрироваться bitcoin математика bitcoin bitcoin телефон обозначение bitcoin wiki bitcoin bitcoin virus bitcoin uk bitcoin plus bitcoin twitter bitcoin mining bitcoin динамика пул ethereum bitcoin demo tether 4pda
сбербанк bitcoin bitcoin rotator казино ethereum bitcoin видеокарты bitcoin anonymous bitcoin монета создатель ethereum
moneypolo bitcoin tether отзывы bitcoin loan bitcoin auto bitcoin symbol tether 2
mercado bitcoin bitcoin currency bitcoin go подтверждение bitcoin криптовалюта tether оплата bitcoin store bitcoin обменять bitcoin bestexchange bitcoin Bitcoin, on the other hand, is not regulated by a central authority. Instead, bitcoin is backed by millions of computers across the world called 'nodes.' This network of computers performs the same function as the Federal Reserve, Visa, and Mastercard, but with a few key differences. Nodes store information about prior transactions and help to verify their authenticity. Unlike those central authorities, however, bitcoin nodes are spread out across the world and record transaction data in a public list that can be accessed by anyone.настройка bitcoin