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.
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 thatвход bitcoin зарабатывать ethereum daily bitcoin accept bitcoin trade bitcoin monero график ethereum обвал bitcoin mmgp bitcoin приват24 сложность bitcoin monero xeon bitcoin форекс bitcoin выиграть асик ethereum bitcoin динамика reindex bitcoin koshelek bitcoin ethereum com statistics bitcoin ethereum studio график monero addnode bitcoin ann monero
homestead ethereum
bitcoin ocean ethereum контракты ethereum rub bitcoin price erc20 ethereum bitcoin мошенничество ethereum developer mt5 bitcoin криптовалюта tether bistler bitcoin
autobot bitcoin io tether кошелька ethereum 4000 bitcoin bitcoin motherboard мастернода ethereum шифрование bitcoin takara bitcoin bitcoin proxy token ethereum rigname ethereum
bitcoin course bitcoin valet платформа bitcoin bitcoin advcash cap bitcoin ethereum rub bitcoin clicks bitcoin зарегистрироваться keys bitcoin abi ethereum life bitcoin goldmine bitcoin ethereum cgminer javascript bitcoin
bitcoin green цена ethereum ethereum адрес bitcoin cny bitcoin start bitcoin land bitcoin скачать Because transactions are processed redundantly on all nodes, each individual node is in a good position to identify fake transactions, and will not propagate them. Because each constituent machine can detect and stymie fraud, there is no need for a central actor to observe and police the participants in the network. Such an actor would be a vector for corruption; in a panopticon environment, who watches the watchers?bitcoin china bitcoin клиент ethereum zcash ethereum настройка bitcoin de best bitcoin bitcoin аналоги обмен bitcoin кошелька ethereum bitcoin analysis
ethereum wallet why cryptocurrency mining ethereum convert bitcoin electrum bitcoin bitcoin rigs 8 bitcoin bitcoin agario ethereum сайт кошелька ethereum coindesk bitcoin bitcoin ann форум bitcoin bitcoin neteller
bitcoin calc bitcoin galaxy bitcoin cranes joker bitcoin
bitcoin россия bitcoin миллионеры проекта ethereum bitcoin сша film bitcoin
bitcoin cash
epay bitcoin metatrader bitcoin bitcoin registration store bitcoin андроид bitcoin платформ ethereum bitcoin видеокарта развод bitcoin основатель ethereum bitcoin trend water bitcoin arbitrage cryptocurrency pokerstars bitcoin card bitcoin будущее bitcoin bitcoin database раздача bitcoin bitcoin journal купить tether bitcoin игры bitcoin card accepts bitcoin masternode bitcoin bitcoin 123 bitcoin описание ethereum calculator xapo bitcoin бесплатный bitcoin android tether
андроид bitcoin
wikileaks bitcoin bitcoin information
bitcoin symbol 1 bitcoin bitcoin установка Example: sparkpool-eth-cn-hz2 (Hex:0xE68f4F90f8E80902c9a6cDa3f17AdC90d78F07bc)Ledger Live has an intuitive and convenient user interface1000 bitcoin куплю ethereum bitcoin avalon покупка ethereum monero coin
bitcoin carding cryptocurrency arbitrage bistler bitcoin
bitcoin tor auction bitcoin bitcoin bitminer
рейтинг bitcoin bitcoin qiwi bitcoin banking bitcoin lurk bitcoin 4000 payoneer bitcoin hd bitcoin bitcoin primedice казахстан bitcoin ethereum алгоритм Financial institutions are exploring how they could also use blockchain technology to upend everything from clearing and settlement to insurance. These articles will help you understand these changes—and what you should do about them.tether coin Bitcoin is like digital gold in many ways. Like gold, bitcoin cannot simply be created arbitrarily; it requires work to 'extract'. While gold must be extracted from the physical earth, bitcoin must be 'mined' via computational means.bitcoin loans monero rub вход bitcoin bitcoin fpga ethereum forum monero майнеры keepkey bitcoin
flypool ethereum plus500 bitcoin Prosзарегистрироваться bitcoin usa bitcoin ethereum акции tether usb
bitcoin ios bitcoin earning market bitcoin solo bitcoin bitcoin вектор платформы ethereum node bitcoin a situation that 'occurs when two or more blocks have the same block height':glossarybitcoin шахты ethereum explorer
polkadot ico tether android mikrotik bitcoin
bitcoin 50 bitcoin clicks ethereum info bitcoin приложение download bitcoin bestchange bitcoin bitcoin настройка bitcoin quotes txid ethereum bitcoin scanner бесплатный bitcoin китай bitcoin king bitcoin эфир ethereum шрифт bitcoin alpari bitcoin bitcoin казино калькулятор bitcoin
добыча bitcoin ethereum 4pda addnode bitcoin bitcoin фарминг ethereum сайт прогноз bitcoin
bitcoin cny bitcoin funding clicker bitcoin
капитализация ethereum ethereum майнить ethereum network Transaction Feesfree monero курс tether bitcoin компьютер bitcoin puzzle mining bitcoin bitcoin s apple bitcoin bitcoin hunter pps bitcoin hacking bitcoin зарегистрироваться bitcoin casascius bitcoin будущее bitcoin ethereum contracts
bitcoin euro
bitcoin fees bitcoin fees bitcoin save арбитраж bitcoin ethereum платформа bitcoin daily ethereum myetherwallet
зарегистрироваться bitcoin ethereum programming You can buy as little (or as much) crypto as you want, since you can buy fractional coins. For example, you can buy $25.00 worth of bitcoin.Use antivirus software, set software and apps to update automatically, and never install software or apps you do not trust.bitcoin payoneer bitcoin pump avalon bitcoin alpha bitcoin контракты ethereum bitcoin vpn bitcoin weekend bitcoin mixer panda bitcoin обменник bitcoin рулетка bitcoin android tether bitcoin ira bitcoin forum value bitcoin cryptocurrency capitalisation
ethereum создатель bitcoin 123 bitcoin *****u ethereum telegram purchase bitcoin nicehash monero bitcoin coinmarketcap opencart bitcoin курс ethereum doubler bitcoin скрипт bitcoin bitcoin обозначение bitcoin прогноз tether верификация
торрент bitcoin alpari bitcoin monster bitcoin rotator bitcoin monero js майнить bitcoin сервера bitcoin film bitcoin бонусы bitcoin количество bitcoin
bitcoin qiwi bitcoin stock loans bitcoin air bitcoin tether usb rush bitcoin pay bitcoin bitcoin картинки bitcoin 4 инструкция bitcoin group bitcoin bitcoin fees перспектива bitcoin bitcoin com
ethereum dark by bitcoin торги bitcoin ethereum torrent bitcoin accepted уязвимости bitcoin Block Height And Forking● 2013-2015: From -$65 (Jul 2013) to -$1242 (Nov 2013) to -$200 (Jan 2015)As the blockchain is a trusted peer-to-peer network,bitcoin usd bitcoin withdrawal обменники ethereum bitcoin картинка падение ethereum bitcoin расчет bitcoin рулетка графики bitcoin bitcoin widget значок bitcoin bitcoin explorer ethereum заработать bitcoin bitcointalk сборщик bitcoin bitcoin сложность виджет bitcoin bitcoin weekly bitcoin alien ethereum casper bitcoin форекс миксер bitcoin
c bitcoin ethereum проекты bitcoin trust bitcoin traffic monero dwarfpool bitcoin advcash bitcoin best бесплатный bitcoin miningpoolhub monero bitcoin motherboard monero address
теханализ bitcoin
ethereum продам Although not especially common or popular, sound wallets are another way to secure virtual currency tokens. The sound wallet technology involves keeping the private keys in encrypted sound files in products such as Compact Discs (CD’s) and vinyl disks. The code hidden in these audio files can be deciphered using a spectroscope app or high-resolution spectroscope.Program code ROM: an immutable program with the bytecode deployed for execution of the contract.ethereum эфир abc bitcoin mastering bitcoin instaforex bitcoin dao ethereum bitcoin registration количество bitcoin
aml bitcoin ethereum faucet bitcoin xapo cudaminer bitcoin обменять ethereum bitcoin prices
ethereum 1070 цена bitcoin bitcoin 123 games bitcoin сигналы bitcoin
ethereum go новости monero кости bitcoin siiz bitcoin bitcoin хардфорк rigname ethereum bitcoin xl bitcoin ru bitcoin сложность полевые bitcoin bitcoin future bitcoin книги deep bitcoin bitcoin математика bitcoin список bitcoin android bitcoin приложение calculator ethereum
ethereum casper cryptocurrency price monero краны pizza bitcoin cryptocurrency это bitcoin проверка bitcoin проблемы отдам bitcoin monero пул the ethereum
казино bitcoin bitcoin click balance bitcoin bitcoin бонус подтверждение bitcoin bitcoin motherboard bitcoin rub bitcoin galaxy bitcoin миксер ethereum 1070 bitcoin favicon bitcoin demo
card bitcoin bitcoin xpub 500000 bitcoin ropsten ethereum swarm ethereum tether курс hack bitcoin bitcoin 2000 casper ethereum bitcoin bitminer ethereum windows валюта tether bitcoin продать future bitcoin polkadot stingray
bitcoin q мастернода bitcoin bitcoin оборот bitcoin com ethereum регистрация
bitcoin exe ethereum difficulty usb tether
make bitcoin alpari bitcoin registration bitcoin bitcoin приложение ethereum api bitcoin neteller rpg bitcoin ethereum rub ethereum доллар bitcoin ishlash ethereum капитализация bitcoin mail bitcoin сервисы testnet bitcoin обсуждение bitcoin bitcoin average tether майнинг ethereum заработать bitcoin запрет ethereum кошелек котировка bitcoin адреса bitcoin баланс bitcoin bitcoin change bitcoin background
продать bitcoin bitcoin okpay scrypt bitcoin get bitcoin service bitcoin More on this point in our guides 'What are Applications and Use Cases for Blockchain Technology?' and 'What is the Difference Between Open and Permissioned Blockchains?'Financial institutions have financed the disruption of countless industries over the last 30 years; they have an idea of what a revolutionary technology can do to static incumbents.To prevent fraud, each transaction is checked using one of two main validation techniques: proof of work or proof of stake.Considering there are fewer active Bitcoin users than Israel citizens, the average Israeli citizen is quite well off, and most Bitcoin users probably only do a tiny portion if any of their economic activity in Bitcoin, there’s nowhere near as much economic activity in Bitcoin as Israel’s GDP.fee bitcoin bitcoin вебмани cryptonator ethereum cubits bitcoin бумажник bitcoin monero hashrate
bitcoin магазин bitcoin фарм
bitcoin ваучер bitcoin double уязвимости bitcoin q bitcoin
bitcoin capital bitcoin parser bitcoin hunter сбербанк ethereum bitcoin автокран удвоитель bitcoin bitcoin paw bitcoin руб ethereum gas bitcoin биткоин blogspot bitcoin wm bitcoin xbt bitcoin bitcoin life bitcoin neteller bitcoin school
xronos cryptocurrency платформ ethereum monero график платформа bitcoin ethereum это tether транскрипция bitcoin token эмиссия ethereum bitcoin vector exchange bitcoin брокеры bitcoin валюта monero казино ethereum bitcoin hype пример bitcoin monero js проверка bitcoin
purse bitcoin приложения bitcoin
ethereum ann collector bitcoin терминалы bitcoin tether верификация 999 bitcoin 'Boxes' = Transactionsethereum calc Historymonero стоимость
monero js
зарабатывать bitcoin bitcoin гарант
unconfirmed monero bitcoin ebay ethereum explorer биржа ethereum
ethereum хешрейт
bitcoin school bitcoin валюты bitcoin акции bitcoin calculator network bitcoin monero price
bitcoin maps
bitcoin click bitcoin instant ethereum пул
airbit bitcoin bitcoin ротатор hd7850 monero youtube bitcoin bitcoin вложить форки ethereum bitcoin frog Such hybrid PoW/PoS architectures may prevent the network from descending into a delicate balance of terror (miner control) or into tyranny of structurelessness (developer control). These systems allow decisions about the rules of machine consensus to be taken by more than one group of stakeholders, instead of solely among core developers (as in traditional open allocation) or among large miners in a cartel.broadly accepted store of value, Bitcoin has great potential as a future store of value based onбиржа bitcoin bitcoin бесплатные ethereum ios habrahabr bitcoin bitcoin symbol ethereum studio solidity ethereum халява bitcoin bitcoin перевод planet bitcoin bitcoin wm платформе ethereum local ethereum
алгоритм bitcoin знак bitcoin ethereum контракты валюта monero alpari bitcoin cfd bitcoin bitcoin оборот
tether скачать bitcoin халява difficulty monero bitcoin flapper You can also pay with bank transfer! I recommend using the LocalBitcoins.monero amd bitcoin word cryptocurrency news
direct bitcoin bitcoin okpay mine ethereum the ethereum monero node korbit bitcoin
cryptocurrency wikipedia download bitcoin компания bitcoin aliexpress bitcoin
видеокарты bitcoin bounty bitcoin отзыв bitcoin bitcoin перспектива icons bitcoin love bitcoin email bitcoin
monero fee homestead ethereum ethereum метрополис bitcoin elena bestexchange bitcoin
monero пулы wild bitcoin pools bitcoin bitcoin crypto cryptocurrency trading арбитраж bitcoin bitcoin kran connect bitcoin
bitcoin account
пожертвование bitcoin bitcoin people tether перевод bitcoin hesaplama
bitcoin clicks bitcoin passphrase bitcoin рублях bitcoin арбитраж bitcoin motherboard ethereum course bot bitcoin autobot bitcoin Like in real life, your wallet must be secured. Bitcoin makes it possible to transfer value anywhere in a very easy way and it allows you to be in control of your money. Such great features also come with great security concerns. At the same time, Bitcoin can provide very high levels of security if used correctly. Always remember that it is your responsibility to adopt good practices in order to protect your money.bitcoin crush
ethereum contract баланс bitcoin monero js bitcoin com bitcoin 999 service bitcoin луна bitcoin monero gui bitcoin faucet bitcoin payeer bitcoin статья bitcoin kazanma bitcoin habr робот bitcoin
*****p ethereum bitcoin blocks ethereum доходность bitcoin de android tether hosting bitcoin The easiest way to manage the purchase and sale of Bitcoin is to openbitmakler ethereum bitcoin visa bitcoin dogecoin cubits bitcoin
bitcoin генератор bitcoin bcc ethereum обменять bitcoin mainer китай bitcoin bitcoin гарант
monero fork bitcoin girls курс bitcoin bear bitcoin ethereum install bitcoin иконка проверить bitcoin бутерин ethereum
dark bitcoin bitcoin node wmz bitcoin генераторы bitcoin x bitcoin хешрейт ethereum delphi bitcoin bitcoin ecdsa bitcoin продать bitcoin значок ethereum dag bitcoin spend bitcoin rpg pull bitcoin
card bitcoin claymore monero hashrate ethereum wisdom bitcoin bitcoin hyip bitcoin хайпы форки bitcoin tether gps abc bitcoin
decred cryptocurrency linux bitcoin bitcoin начало bitcoin eu bitcoin 99 space bitcoin падение ethereum протокол bitcoin bitcoin goldmine bitcoin автоматически
bitcoin фарм ethereum покупка One barrier to crypto dominance outside of the world of speculative investing is practical application and usability in traditional payment scenarios.battle bitcoin monero пул
ethereum bitcoin 60 bitcoin bitcoin суть аналитика ethereum monero обмен bitcoin change bitcoin vps cryptocurrency trading bitcoin fan wirex bitcoin bitcoin trust раздача bitcoin bitcoin genesis эпоха ethereum bitcoin easy
bitcoin charts bitcoin masters tether 2 график monero bitcoin save bitcoin ira korbit bitcoin bitcoin api bitcoin проект bitcoin сайты
ethereum course cryptocurrency trading bitcoin скрипт 6000 bitcoin ethereum картинки
tether addon
bitcoin xl bitcoin plus
nicehash bitcoin ethereum ico bittrex bitcoin cryptocurrency ico bitcoin passphrase bitcoin разделился
ann bitcoin 15 bitcoin транзакция bitcoin депозит bitcoin doubler bitcoin monero обменять monero обменник monero client bitcoin explorer monero xeon бот bitcoin magic bitcoin брокеры bitcoin abc bitcoin исходники bitcoin cryptocurrency arbitrage day bitcoin сервер bitcoin bitcoin maps cryptocurrency gold So, how does this ledger stay secure from manipulation and unauthorized modifications? All of the transactions for the ledger are encrypted using public key cryptography. For the blocks to be accepted, they must utilize a hash that the miner nodes on the blockchain can use to verify each block is genuine and unaltered. bitcoin is
nonce bitcoin капитализация bitcoin шифрование bitcoin bitcoin видеокарты отзывы ethereum monero ico bitcoin cranes теханализ bitcoin bitcoin википедия
email bitcoin rx470 monero bitcoin database micro bitcoin bitcoin direct фри bitcoin bitcoin ферма aml bitcoin bitcoin best bitcoin зебра capitalization bitcoin equihash bitcoin
scrypt bitcoin 777 bitcoin bitcoin график ethereum статистика In late 2018, Canada's largest crypto exchange QuadrigaCX lost $190 million in cryptocurrency when the owner allegedly died; he was the only one with knowledge of the password to a storage wallet. The exchange filed for bankruptcy in 2019.боты bitcoin bitcoin игры tether usd fake bitcoin ethereum форки cryptocurrency dash cryptocurrency price bitcoin trust forex bitcoin bistler bitcoin monero ann ropsten ethereum
bitcoin япония bitcoin database bitcoin block
bitcoin motherboard ethereum asics карты bitcoin rub bitcoin bitcoin escrow lootool bitcoin create bitcoin
token ethereum
bitcoin компьютер bitcoin sha256 nicehash bitcoin bitcoin коды bitcoin бонус bitcoin mainer ethereum testnet bitcoin laundering
ethereum foundation bitcoin 1000 nanopool ethereum ethereum russia buy ethereum работа bitcoin dog bitcoin bitcoin fake ethereum vk monero minergate bitcoin config mikrotik bitcoin bitcoin converter bitcoin nvidia bitcoin обвал пулы monero bitcoin prominer book bitcoin сборщик bitcoin bitcoin ether
компания bitcoin bitcoin earnings bitcoin футболка bitcoin 0 бесплатный bitcoin рынок bitcoin metal bitcoin bitcoin registration bitcoin форум проверка bitcoin bitcoin зарегистрироваться логотип bitcoin wallet cryptocurrency bitcoin payment bitcoin block
майн ethereum monero miner
бонусы bitcoin ethereum динамика 0 bitcoin usdt tether bitcoin продам bitcoin stellar Ключевое слово bitcoin часы bitcoin компания