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 руб ico ethereum bitcoin investing earn bitcoin bitcoin china bonus bitcoin ethereum кошелька tether верификация bitcoin services форекс bitcoin bitcoin banking bitcoin 0
minergate bitcoin
bitcoin 100 bitcoin бесплатно cryptocurrency calculator tether usd шрифт bitcoin bitcoin history se*****256k1 bitcoin
bitcoin рейтинг bitcoin income bitcoin государство tether майнинг cryptocurrency charts видео bitcoin рулетка bitcoin bitcoin nodes payable ethereum bitcoin презентация bitcoin alien видеокарта bitcoin node bitcoin ethereum скачать bitcoin 4096 bitcoin расшифровка
mining bitcoin server bitcoin bitcoin links bitcoin ваучер bitcoin grant All of these simple systems are ideal for small businesses testing bitcoin acceptance or for those doing odd-jobs for small amounts. Businesses which are larger in scale will likely look into a dedicated solution that fits in with their existing POS systems.wikileaks bitcoin bitcoin login Tweetsteam bitcoin арбитраж bitcoin проекты bitcoin market bitcoin cudaminer bitcoin best bitcoin
ethereum контракт bitcoin plugin coindesk bitcoin card bitcoin 600 bitcoin bitcoin department bitcoin step txid bitcoin armory bitcoin 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.ethereum ico blogspot bitcoin bitcoin accelerator россия bitcoin bitcoin mining bcc bitcoin 6000 bitcoin bcc bitcoin ethereum обвал bitcoin mempool autobot bitcoin
xronos cryptocurrency обменник bitcoin bitcoin теханализ bitcoin bitrix арбитраж bitcoin r bitcoin bitcoin видеокарты price bitcoin ethereum rig bitcoin community 6000 bitcoin bitcoin grant ethereum browser bitcoin crash bitcoin utopia bitcoin команды iphone tether bitcoin kazanma future bitcoin шахта bitcoin кошелек tether minergate bitcoin bitcoin bitcointalk bitcoin бесплатно As hopeful investors, it’s tempting to believe that we’ve found an altcoin or ICO that will improve on Bitcoin and thus make us early adopters in the revolution. Unfortunately, wishful thinking won’t change the properties as fundamental as the network effect or decentralization. Thousands of coins over seven years have not successfully replicated these properties and these properties are why Bitcoin is the real revolution.Bitcoin is Changing Communicationbitcoin protocol demo bitcoin
monero transaction Blockchain is a decentralized peer-to-peer network and there is no central point of failure. Even if a computer breaks or leaves the network, other computers will keep the network running. That's why this is a huge, huge advantage.bitcoin шифрование topfan bitcoin monero rub вывод ethereum кран ethereum алгоритм monero grayscale bitcoin bitcoin registration polkadot блог ethereum краны stock bitcoin bitcoin x2 видеокарты ethereum ethereum course bitcoin instagram blender bitcoin
bitcoin putin iota cryptocurrency ethereum chaindata bitcoin group accepts bitcoin адрес bitcoin datadir bitcoin bitcoin drip bitcoin ann bitcoin расчет ethereum complexity краны ethereum accepts bitcoin bitcoin home bitcoin minecraft bitcoin завести dat bitcoin bitcoin api api bitcoin сложность ethereum bitcoin рбк
location bitcoin monero xeon
location bitcoin bitcoin games bitcoin foto bitcoin simple rpg bitcoin bitcoin traffic monero algorithm bitcoin россия bitcoin bio андроид bitcoin
linux ethereum bitcoin film bitcoin server bitcoin дешевеет
simple bitcoin -Satoshi Nakamoto, August 2010ethereum telegram accelerator bitcoin bitcoin вектор цены bitcoin
bitcoin monero форки ethereum ethereum blockchain bitcoin trust
Bitcoin has an embedded independent property system.legal bitcoin eobot bitcoin top bitcoin earning bitcoin usb bitcoin bitcoin pools bitcoin programming
oil bitcoin ssl bitcoin bitcoin check bitcoin purse ethereum алгоритм
bitcoin qiwi
china bitcoin ethereum blockchain bitcoin софт bitcoin cny bitcoin хардфорк bitcoin community bitcoin knots bitcoin 2016 ethereum torrent
конвертер bitcoin bitcoin visa captcha bitcoin bitcoin links bitcoin ставки bitcoin payeer bitcoin 4 neo bitcoin ethereum supernova bitcoin weekly рынок bitcoin ads bitcoin carding bitcoin фермы bitcoin monero blockchain доходность bitcoin bitcoin review bitcoin conveyor coinbase ethereum bitcoin куплю bitcoin flip ethereum виталий exchange bitcoin bitcoin kurs взлом bitcoin ethereum chaindata bitcoin rt bcn bitcoin xbt bitcoin bitcoin компьютер bitcoin xpub цена ethereum ethereum история bitcoin genesis fork ethereum remix ethereum nicehash bitcoin bitcoin future stake bitcoin lavkalavka bitcoin bitcoin создать ethereum история bitcoin количество форумы bitcoin майнинг tether bitcoin игры cryptocurrency trading краны monero bitcoin poker wild bitcoin особенности ethereum tether clockworkmod bitcoin protocol книга bitcoin отзыв bitcoin So, what do '64-digit hexadecimal numbers' have to do with bitcoin mining? bitcoin tx ethereum price bitcoin maker bitcoin проверить clame bitcoin
bitcoin сигналы ru bitcoin bitcoin crane bitcoin joker bitcoin trinity bitcoin клиент x bitcoin 99 bitcoin ninjatrader bitcoin bitcoin gift bitcoin команды
nanopool ethereum bitcoin site bitcoin donate bittorrent bitcoin 'For over 2,000 years, evidence seemed to support Edgar Allan Poe's Assertion, ‘human ingenuity can-not concoct a cypher which human ingenuity cannot resolve,’ implying a cat-and-mouse game with an advantage to the party with more skills and resources. This changed abruptly in the 1970s owing to three separate developments: the symmetric cipher DES (Data Encryption Standard), the asymmetric cipher RSA, and Diffie-Hellman key exchange.'Of Bitcoin’s many properties, trustlessness, or the ability to use Bitcoin without trusting anything but the open-source software you run, is, by far, king. More specifically, interest in Bitcoin appears to almost exclusively derive from a desire to avoid needing to trust some third party or combination of third parties. This should hardly be news to anyone, but an understanding of exactly why this trustlessness is so important (and what forms it takes) is critical to building and upgrading Bitcoin technology.проверка bitcoin bitcoin блокчейн курсы bitcoin erc20 ethereum
torrent bitcoin bitcoin casino платформе ethereum bitcoin fire иконка bitcoin bitcoin ru earning bitcoin bitcoin com
bitcoin падение c bitcoin рулетка bitcoin bitcoin conference ethereum course
bitcoin терминал miner bitcoin bitcoin location майнить monero bitcoin japan ethereum кошельки bitcoin оборот ethereum casino
bitcoin statistic monero кран ethereum создатель
msigna bitcoin bitcoin habr lavkalavka bitcoin monero калькулятор bitcoin сети bitcoin 100
bitcoin майнинга monero майнить bitcoin cap bitcoin today javascript bitcoin bitcoin q биржи monero nanopool monero connect bitcoin пожертвование bitcoin nya bitcoin bitcoin python видеокарты bitcoin bitcoin регистрации x2 bitcoin
bitcoin страна bitcoin игры bubble bitcoin bitcoin venezuela bitcoin 4 green bitcoin bitcoin blocks bitcoin ether golden bitcoin ethereum supernova bitcoin stiller bitcoin stealer bitcoin blockchain ann bitcoin
футболка bitcoin 22 bitcoin bitcoin bounty технология bitcoin In the 13th century, academics like the renowned Italian mathematician Fibonacci began championing zero in their work, helping the Hindu-Arabic system gain credibility in Europe. As trade began to flourish and generate unprecedented levels of wealth in the world, math moved from purely practical applications to ever more abstracted functions. As Alfred North Whitehead said:bitcoin metal сложность bitcoin bitcoin btc ann ethereum торрент bitcoin 600 bitcoin moneybox bitcoin bitcoin generation cryptocurrency calculator play bitcoin bitcoin проверка 600 bitcoin ethereum заработок bitcoin office
bitcoin difficulty polkadot ico
bitcoin txid dog bitcoin wei ethereum bitcoin club
monero minergate bitcoin nonce bitcoin capitalization новые bitcoin maps bitcoin poloniex ethereum bitcoin зебра bitcoin monkey bitcoin bat bitcoin bear bitcoin вирус bitcoin matrix bitcoin dark bitcoin php bitcoin linux finney ethereum transactions bitcoin ethereum developer strategy bitcoin bitcoin hunter bitcoin home cryptocurrency bitcoin bitcoin earn форумы bitcoin bitcoin выиграть bitcoin trader кости bitcoin mikrotik bitcoin
форк bitcoin hashrate bitcoin mining bitcoin
заработка bitcoin bitcoin loans tether скачать bitcoin cnbc программа tether 2016 bitcoin bitcoin компьютер 2016 bitcoin bitcoin puzzle
bitcoin ваучер raspberry bitcoin tether верификация reddit ethereum bitcoin maps bitcoin поиск Blockchain technology here eliminates the need for a central authority and enables rapid access to data. Here, each block is connected to another block and distributed across the blockchain nodes, making it difficult for a hacker to corrupt the data. Keeping personal medical file information private is of the utmost concern, so blockchain technology makes the most sense, no?ethereum farm настройка ethereum email bitcoin ethereum ios nxt cryptocurrency ethereum address bitcoin golden bitcoin zona testnet bitcoin bitcoin 2048 bitcoin x information bitcoin
bitcoin electrum
metatrader bitcoin daemon bitcoin
putin bitcoin master bitcoin платформа bitcoin ethereum описание circle bitcoin падение ethereum credit bitcoin
blacktrail bitcoin etoro bitcoin wikipedia ethereum bitcoin блок bitcoin ютуб новости bitcoin bitcoin stock запрет bitcoin Satoshi gave the world Bitcoin, a true 'something for nothing.' His discovery of absolute scarcity for money is an unstoppable idea that is changing the world tremendously, just like its digital ancestor: the number zero.асик ethereum p2pool monero ethereum прогнозы bitcoin заработок bitcoin take putin bitcoin loans bitcoin bitcoin mt4 платформы ethereum future bitcoin майнить monero purse bitcoin bitcoin конвертер bitcoin доллар Ethereum has been built on a platform of transparent transactions from the beginning. While there is a central ‘body’ that created Ethereum and Ether, they do not hold authority over the miners who contribute to the global decentralization of the platform. This means that new protocols and processes must be agreed upon by the collective, regardless of what the central body believes is best.monero биржи раздача bitcoin bitcoin страна сборщик bitcoin кран bitcoin график ethereum rocket bitcoin ico bitcoin развод bitcoin zcash bitcoin
monero pool bitcoin golden investment bitcoin bitcoin simple withdraw bitcoin bitcoin вложения bitcoin халява bitcoin википедия bitcoin is
bitcoin 2018 cnbc bitcoin network bitcoin nicehash bitcoin 999 bitcoin bitcoin s bitcoin capital bitcoin спекуляция
bitcoin видеокарта erc20 ethereum bitcoin casinos
blocks bitcoin bitcoin rpg bitcoin donate salt bitcoin tether wallet ethereum com tether usb ethereum упал создатель ethereum buy bitcoin bitcoin комиссия bitrix bitcoin bitcoin конвектор ethereum обозначение стратегия bitcoin tether криптовалюта up bitcoin
bitcoin bittorrent bitcoin loan polkadot stingray nicehash ethereum
ethereum swarm майнинг ethereum bitcoin grant кошельки bitcoin bitcoin arbitrage bitcoin теория bitcoin elena tether io monero logo bitcoin status bitcoin passphrase wmx bitcoin microsoft bitcoin Image for postcryptocurrency dash цена ethereum раздача bitcoin сложность ethereum продажа bitcoin mini bitcoin bitcoin conf car bitcoin wikileaks bitcoin wild bitcoin film bitcoin testnet bitcoin bitcoin майнер
ubuntu bitcoin фьючерсы bitcoin raiden ethereum bitcoin сигналы
gadget bitcoin монета ethereum вирус bitcoin tether apk bitcoin register nanopool ethereum bitrix bitcoin ethereum contract copay bitcoin wikileaks bitcoin bitcoin адреса mmgp bitcoin
android tether ethereum supernova kraken bitcoin bitcoin капча ethereum сайт bitcoin usa bitcoin main bitcoin миксер bitcoin шахта bitcoin описание пополнить bitcoin новый bitcoin cryptocurrency capitalization bitcoin motherboard стратегия bitcoin ethereum логотип криптовалюту monero kran bitcoin gemini bitcoin bitcoin fork keepkey bitcoin bitcoin презентация добыча bitcoin *****p ethereum bitcoin расчет bitcoin super bitcoin video
bitcoin neteller bitcoin валюты finney ethereum prune bitcoin reddit bitcoin обменять ethereum bitcoin anonymous chaindata ethereum хардфорк ethereum bitcoin cache spots cryptocurrency bitcoin easy monero *****uminer bitcoin capital ethereum stratum отдам bitcoin bitcoin collector cryptocurrency ethereum bitcoin nedir dollar bitcoin alpari bitcoin ethereum stats криптовалюты bitcoin ethereum stratum ethereum coins bitcoin chains bitcoin уполовинивание купить monero ethereum forks bcn bitcoin 6000 bitcoin
Litecoin was launched in October 2011 and is one of the oldest cryptocurrencies in existence. Litecoin has similar characteristics to Bitcoin since it is a fork of Bitcoin. However, Litecoin does not share any history with the Bitcoin genesis block, and it has opted for shorter block generation times and higher base supply.half bitcoin tether usd
кошелек monero ethereum coin ethereum block s bitcoin nicehash monero bitcoin клиент bitcoin ротатор
bitcoin book bitcoin завести monero logo яндекс bitcoin bitcoin сервера direct bitcoin monero proxy
tracker bitcoin bitcoin софт earnings bitcoin advcash bitcoin bitcoin cny litecoin bitcoin 4000 bitcoin pool bitcoin Continuing our thought experiment: even if 'New Bitcoin' featured a diminishing money supply (in other words, a deflationary monetary policy), how would its rate of money supply decay (deflation) be determined? By what mechanism would its beneficiaries be selected? As market participants (nodes and miners) jockeyed for position to maximize their accrual of economic benefit from the deflationary monetary policy, forks would ensue that would diminish the liquidity, network effects, and chain security for 'New Bitcoin,' causing everyone to eventually pile back into the original Bitcoin—just like they did in the wake of Bitcoin Cash’s failure.ethereum заработок bitcoin investment проверка bitcoin алгоритм ethereum майнинг monero bitcoin куплю ethereum ios яндекс bitcoin lite bitcoin bitcoin путин bitcoin фильм бесплатный bitcoin http bitcoin difficulty monero conference bitcoin iso bitcoin oil bitcoin bitcoin check
monero биржи приват24 bitcoin халява bitcoin bitcoin фильм использование bitcoin bitcoin создать dollar bitcoin trezor bitcoin 6000 bitcoin bitcoin javascript bitcoin cli bitcoin обменники bitcoin будущее apple bitcoin адрес bitcoin
сервера bitcoin se*****256k1 ethereum mine ethereum bitcoin converter анонимность bitcoin multisig bitcoin cryptocurrency calendar vps bitcoin monero кран bitcoin ann ethereum siacoin bitcoin машины ethereum калькулятор bitcoin amazon
бесплатно ethereum bitcoin ukraine bitcoin antminer rates bitcoin bitcoin euro bitcoin com ethereum цена bitcoin rt bitcoin mmm bitcoin таблица forum ethereum dark bitcoin bitcoin exchanges bitcoin матрица bitcoin traffic up bitcoin
bitcoin казахстан bitcoin транзакции
курсы bitcoin обменники bitcoin bitcoin доходность bitcoin analytics bitcoin аналоги the ethereum bitcoin valet car bitcoin алгоритм bitcoin monero ann bitcoin jp 1060 monero bitcoin lion история ethereum chaindata ethereum ethereum course abi ethereum pow bitcoin видеокарта bitcoin fx bitcoin hashrate ethereum bcc bitcoin byzantium ethereum дешевеет bitcoin
ethereum swarm ethereum wikipedia bitcoin loan ethereum online attack bitcoin bitcoin mt5 вложить bitcoin bitcoin 15
bitcoin trend bitcoin cap bitcoin trader 99 bitcoin fields bitcoin rpc bitcoin кликер bitcoin wikileaks bitcoin monero форк difficulty ethereum bitcoin froggy By creating a world in which there is a fixed money supply such that no more or no less can be saved in aggregate, the incentive and propensity to save increases measurably on the individual level. It is a paradox; if more money cannot be saved in aggregate, more people will save on an individual basis. On one hand, it may appear to be a simple statement that individuals value scarcity. But in reality, it is more so an explanation that an incentive to save creates savers, even if more money can’t be saved in aggregate. And in order for someone to save, someone else must spend existing savings. After all, all consumption and investment comes from savings; the incentive to save creates savers, and the existence of more savers in turn creates more people with the means to consume and invest. At an individual level, if someone expects a monetary unit to increase in purchasing power, he or she might reasonably defer either consumption or investment to the future (the key word being ‘defer’). That is the incentive to save creating savers. It doesn’t eliminate consumption or investment; it merely ensures that the decision is evaluated with greater scrutiny when future purchasing power is expected to increase, not decrease. Imagine every single person simultaneously operating with that incentive mechanism, compared to the opposite which exists today.coffee bitcoin bitcoin comprar bitcoin get ethereum claymore ethereum mist bitcoin plus trezor ethereum rpg bitcoin cryptocurrency capitalization bitcoin usd bitcoin rotators ethereum алгоритмы