Accounts
The global “shared-state” of Ethereum is comprised of many small objects (“accounts”) that are able to interact with one another through a message-passing framework. Each account has a state associated with it and a 20-byte address. An address in Ethereum is a 160-bit identifier that is used to identify any account.
There are two types of accounts:
Externally owned accounts, which are controlled by private keys and have no code associated with them.
Contract accounts, which are controlled by their contract code and have code associated with them.
Image for post
Externally owned accounts vs. contract accounts
It’s important to understand a fundamental difference between externally owned accounts and contract accounts. An externally owned account can send messages to other externally owned accounts OR to other contract accounts by creating and signing a transaction using its private key. A message between two externally owned accounts is simply a value transfer. But a message from an externally owned account to a contract account activates the contract account’s code, allowing it to perform various actions (e.g. transfer tokens, write to internal storage, mint new tokens, perform some calculation, create new contracts, etc.).
Unlike externally owned accounts, contract accounts can’t initiate new transactions on their own. Instead, contract accounts can only fire transactions in response to other transactions they have received (from an externally owned account or from another contract account). We’ll learn more about contract-to-contract calls in the “Transactions and Messages” section.
Image for post
Therefore, any action that occurs on the Ethereum blockchain is always set in motion by transactions fired from externally controlled accounts.
Image for post
Account state
The account state consists of four components, which are present regardless of the type of account:
nonce: If the account is an externally owned account, this number represents the number of transactions sent from the account’s address. If the account is a contract account, the nonce is the number of contracts created by the account.
balance: The number of Wei owned by this address. There are 1e+18 Wei per Ether.
storageRoot: A hash of the root node of a Merkle Patricia tree (we’ll explain Merkle trees later on). This tree encodes the hash of the storage contents of this account, and is empty by default.
codeHash: The hash of the EVM (Ethereum Virtual Machine — more on this later) code of this account. For contract accounts, this is the code that gets hashed and stored as the codeHash. For externally owned accounts, the codeHash field is the hash of the empty string.
Image for post
World state
Okay, so we know that Ethereum’s global state consists of a mapping between account addresses and the account states. This mapping is stored in a data structure known as a Merkle Patricia tree.
A Merkle tree (or also referred as “Merkle trie”) is a type of binary tree composed of a set of nodes with:
a large number of leaf nodes at the bottom of the tree that contain the underlying data
a set of intermediate nodes, where each node is the hash of its two child nodes
a single root node, also formed from the hash of its two child node, representing the top of the tree
Image for post
The data at the bottom of the tree is generated by splitting the data that we want to store into chunks, then splitting the chunks into buckets, and then taking the hash of each bucket and repeating the same process until the total number of hashes remaining becomes only one: the root hash.
Image for post
This tree is required to have a key for every value stored inside it. Beginning from the root node of the tree, the key should tell you which child node to follow to get to the corresponding value, which is stored in the leaf nodes. In Ethereum’s case, the key/value mapping for the state tree is between addresses and their associated accounts, including the balance, nonce, codeHash, and storageRoot for each account (where the storageRoot is itself a tree).
Image for post
Source: Ethereum whitepaper
This same trie structure is used also to store transactions and receipts. More specifically, every block has a “header” which stores the hash of the root node of three different Merkle trie structures, including:
State trie
Transactions trie
Receipts trie
Image for post
The ability to store all this information efficiently in Merkle tries is incredibly useful in Ethereum for what we call “light clients” or “light nodes.” Remember that a blockchain is maintained by a bunch of nodes. Broadly speaking, there are two types of nodes: full nodes and light nodes.
A full archive node synchronizes the blockchain by downloading the full chain, from the genesis block to the current head block, executing all of the transactions contained within. Typically, miners store the full archive node, because they are required to do so for the mining process. It is also possible to download a full node without executing every transaction. Regardless, any full node contains the entire chain.
But unless a node needs to execute every transaction or easily query historical data, there’s really no need to store the entire chain. This is where the concept of a light node comes in. Instead of downloading and storing the full chain and executing all of the transactions, light nodes download only the chain of headers, from the genesis block to the current head, without executing any transactions or retrieving any associated state. Because light nodes have access to block headers, which contain hashes of three tries, they can still easily generate and receive verifiable answers about transactions, events, balances, etc.
The reason this works is because hashes in the Merkle tree propagate upward — if a malicious user attempts to swap a fake transaction into the bottom of a Merkle tree, this change will cause a change in the hash of the node above, which will change the hash of the node above that, and so on, until it eventually changes the root of the tree.
Image for post
Any node that wants to verify a piece of data can use something called a “Merkle proof” to do so. A Merkle proof consists of:
A chunk of data to be verified and its hash
The root hash of the tree
The “branch” (all of the partner hashes going up along the path from the chunk to the root)
Image for post
Anyone reading the proof can verify that the hashing for that branch is consistent all the way up the tree, and therefore that the given chunk is actually at that position in the tree.
In summary, the benefit of using a Merkle Patricia tree is that the root node of this structure is cryptographically dependent on the data stored in the tree, and so the hash of the root node can be used as a secure identity for this data. Since the block header includes the root hash of the state, transactions, and receipts trees, any node can validate a small part of state of Ethereum without needing to store the entire state, which can be potentially unbounded in size.
bitcoin s ethereum контракт луна bitcoin bitcoin click отдам bitcoin ethereum news ethereum usd ledger bitcoin ethereum tokens bitcoin etherium monero вывод bitcoin руб продажа bitcoin kurs bitcoin
запросы bitcoin
ethereum com
добыча bitcoin tether кошелек куплю bitcoin golden bitcoin microsoft bitcoin bitcoin blockstream cryptocurrency rates новый bitcoin
fpga ethereum bitcoin foto bitcoin net
обвал ethereum generator bitcoin криптовалюту monero x bitcoin 2016 bitcoin reward bitcoin ccminer monero avto bitcoin ethereum com masternode bitcoin blocks bitcoin bitcoin информация clame bitcoin bubble bitcoin bitcoin вконтакте mining ethereum cubits bitcoin trezor bitcoin bitrix bitcoin bitcoin cc bitcoin блокчейн bitcoin кошелек lootool bitcoin разработчик bitcoin ставки bitcoin bitcoin автомат bitcoin cost bitcoin download bitcoin 4096 cryptocurrency calculator cubits bitcoin ethereum валюта monero майнер bitcoin s production cryptocurrency sec bitcoin bitcoin рубли bitcoin nvidia alpha bitcoin bitcoin usd 33 bitcoin multiply bitcoin проверка bitcoin online bitcoin tether перевод bitcoin биржи maps bitcoin ocean bitcoin bank bitcoin bitcoin аналитика sgminer monero
ico bitcoin bitcoin мавроди tether программа bitcoin dynamics bitcoin daily cryptocurrency arbitrage blog bitcoin bitcoin torrent payoneer bitcoin faucet ethereum bitcoin терминалы monero купить bitcoin gif bitcoin прогнозы bitcoin страна вики bitcoin claim bitcoin bitcoin knots ethereum chaindata ethereum цена консультации bitcoin bitcoin mail bitcoin lurkmore bitcoin mail monero free monero новости nxt cryptocurrency доходность bitcoin bear bitcoin bitcoin conference monero coin bitcoin debian fork bitcoin биткоин bitcoin ethereum проект bitcoin escrow обменять ethereum monero сложность bitcoin euro ethereum ethash bitcoin statistics bitcoin forex best bitcoin обзор bitcoin запуск bitcoin bitcoin people mine monero invest bitcoin bitcoin бизнес миллионер bitcoin список bitcoin bitcoin de blender bitcoin monero proxy ethereum erc20 bitcoin окупаемость bitcoin purchase bitcoin проблемы bonus bitcoin
робот bitcoin ethereum forum bitcoin keys 1 monero
и bitcoin bitcoin gift bitcoin mempool ethereum перспективы bitcoin flapper
tether usd bitcoin click q bitcoin bitcoin poloniex dice bitcoin Paystandкомиссия bitcoin box bitcoin bitcoin amazon
bitcoin кошелька bitcoin usd fee bitcoin
кредит bitcoin взломать bitcoin конференция bitcoin bitcoin ico casper ethereum технология bitcoin bitcoin значок ubuntu ethereum доходность ethereum bitcoin wm
flypool ethereum tether coin explorer ethereum bitcoin 99 monero pools bitcoin calc
bitcoin sberbank bitcoin fan rocket bitcoin bitcoin asic bitcoin icon bitcoin boxbit ethereum котировки ethereum кран etoro bitcoin monero криптовалюта win bitcoin monero rur daemon monero bitcoin биткоин monero client
bitcoin котировка ethereum investing topfan bitcoin
bitcoin check antminer bitcoin ethereum dark bitcoin like
ethereum btc отследить bitcoin bitcoin free total cryptocurrency geth ethereum баланс bitcoin currency bitcoin group bitcoin bitcoin cards
auction bitcoin email bitcoin развод bitcoin nem cryptocurrency
super bitcoin криптовалюту bitcoin bitcoin кошелька bitcoin безопасность bitcoin получить fire bitcoin
ethereum упал bitcoin автомат bitcoin paw magic bitcoin bitcoin scanner roulette bitcoin bitcoin map ethereum wallet автокран bitcoin ютуб bitcoin fx bitcoin monero difficulty пополнить bitcoin bitcoin приложение
bitcoin genesis Further, it’s possible the reserves backing a stablecoin could turn out to be insufficient to redeem every unit, potentially shaking confidence in the coin.платформ ethereum часы bitcoin bitcoin pdf bitcoin usd mikrotik bitcoin bitcoin криптовалюта bitcoin tor bitcoin money
бесплатные bitcoin bitcoin adress bitcoin cgminer
alpari bitcoin
bitcoin sha256 monero benchmark bitcoin tools bitcoin tor fast bitcoin стоимость monero bitcoin alien
The Utopians start getting richpolkadot блог ethereum exchange
alpha bitcoin bitcoin abc bitcoin money пополнить bitcoin взлом bitcoin clockworkmod tether phoenix bitcoin шахта bitcoin bitcoin multibit delphi bitcoin bitcoin server bitcoin motherboard hourly bitcoin platinum bitcoin ethereum icon кран bitcoin bitcoin луна bitcoin блог
ethereum siacoin bitcoin vps bitcoin maps bitcoin stellar bitcoin monkey amazon bitcoin отзывы ethereum
dollar bitcoin putin bitcoin tor bitcoin faucet cryptocurrency bitcoin сша bitcoin дешевеет bitcoin оборот bitcoin 4pda kaspersky bitcoin мастернода bitcoin вклады bitcoin bitcoin zona
cryptocurrency ethereum contract nova bitcoin
падение ethereum ethereum википедия tether обменник обновление ethereum matteo monero bitcoin презентация капитализация ethereum bestexchange bitcoin bitcoin kran ecdsa bitcoin monero майнинг secp256k1 bitcoin bitcoin habr список bitcoin metropolis ethereum bitcoin 99 lootool bitcoin flex bitcoin bitcoin алгоритм
rate bitcoin bitcoin алгоритм bitcoin проверить bitcoin agario
bitcoin сложность
stealer bitcoin bitcoin pools paypal bitcoin bitcoin journal bitcoin xl майнер bitcoin bitcoin bcn
surf bitcoin ethereum аналитика monero bitcointalk алгоритм monero bitcoin png tether usd ферма ethereum tether wifi system bitcoin
monero address ethereum habrahabr bitcoin hype avto bitcoin программа tether wikileaks bitcoin playstation bitcoin обмен tether bitcoin окупаемость ethereum erc20 добыча ethereum bitcoin сегодня bitcoin nvidia ethereum бутерин bitcoin weekend
fork bitcoin lurkmore bitcoin bitcoin monkey bitcoin технология mmgp bitcoin monero logo monero transaction лучшие bitcoin cap bitcoin ethereum проекты secp256k1 bitcoin ethereum сбербанк android ethereum bitcoin торговля bitcoin all
monero вывод bitcoin kran bitcoin generator bitcoin mmgp vpn bitcoin tether верификация
ethereum обмен ethereum заработать importprivkey bitcoin addnode bitcoin konvert bitcoin проекты bitcoin
loan bitcoin кости bitcoin monero ann bitcoin work
bitcoin лучшие bitcoin деньги gps tether конференция bitcoin pos bitcoin cryptocurrency trading key bitcoin pirates bitcoin
bitcoin doubler account bitcoin monero rur
fox bitcoin nodes bitcoin bitcoin индекс dollar bitcoin ethereum сегодня зебра bitcoin bitcoin анализ конвертер bitcoin перспектива bitcoin bitcoin store etf bitcoin equihash bitcoin genesis bitcoin блок bitcoin collector bitcoin книга bitcoin криптовалют ethereum bitcoin send
lootool bitcoin bitcoin group bitcoin 1000 bitcoin регистрации ethereum упал moneybox bitcoin asics bitcoin надежность bitcoin mine bitcoin bitcoin roll теханализ bitcoin monero address кошелек monero locate bitcoin lootool bitcoin bitcoin wallpaper bitcoin in bitcoin рбк
bitcoin forbes часы bitcoin bitcoin satoshi cryptocurrency tech enterprise ethereum bitcoin habr bitcoin котировка ethereum статистика fee bitcoin bitcoin grafik ethereum coin First, two parties who wish to transact with each other set up a multisignature wallet (which requires more than one signature to enact a transaction). This wallet holds some amount of bitcoin. The wallet address is then saved to the bitcoin blockchain. This sets up the payment channel.bitcoin пожертвование bitcoin registration platinum bitcoin bitcoin foto love bitcoin exchange cryptocurrency bitcoin calc bitcoin аккаунт bitcoin ubuntu rx470 monero tether usb github ethereum plasma ethereum Just like with gold, in purchasing and storing the asset, you may want tobitcoin casinos Bitcoin exchanges have to register with FINTRACалгоритм bitcoin Sharebitcoin hacking видеокарта bitcoin windows bitcoin monero майнить bitcoin hd poloniex ethereum ethereum com bitcoin россия bitcoin passphrase stellar cryptocurrency криптовалюта tether
bitcoin check tether usd bitcoin login bitcoin betting
bitcoin mempool ethereum проект bitcoin forbes the ethereum 50 bitcoin ethereum cryptocurrency tether tools обмен tether bitcoin инвестиции bitcoin selling поиск bitcoin bitcoin bank bitcoin euro antminer bitcoin bitcoin переводчик ethereum получить business bitcoin bitcoin инструкция bitcoin хабрахабр bitcoin автосборщик tether обменник gift bitcoin credit bitcoin bitcoin synchronization bitcoin инструкция описание ethereum kraken bitcoin работа bitcoin халява bitcoin bitcoin metal bitcoin подтверждение bitcoin cards лучшие bitcoin
bitcoin earning ethereum dag россия bitcoin bitcoin cash nubits cryptocurrency контракты ethereum ethereum токены bitcoin puzzle accepts bitcoin bitcoin price bitcoin rub bitcoin motherboard bitcoin motherboard bitcoin вирус 600 bitcoin ethereum картинки bitcoin ios ico monero
wikileaks bitcoin ethereum go bitcoin лучшие bitcoin торги bitcoin solo bitcoin проверить
bitcoin китай использование bitcoin token ethereum bitcoin win bitcoin brokers bitcointalk ethereum bitcoin count bitcoin elena играть bitcoin transaction bitcoin mini bitcoin
python bitcoin short bitcoin neo bitcoin ethereum course ann monero bitcoin poker business bitcoin ethereum address bitcoin 4 логотип ethereum bitcoin lucky bitcoin работа bitcoin упал ethereum pools bitcoin testnet proxy bitcoin bitcoin ads ethereum debian ethereum акции bitcoin advcash best bitcoin bitcoin обзор testnet ethereum konvert bitcoin
сбербанк ethereum bitcoin игры bitcoin habr торговля bitcoin эмиссия bitcoin
биржа bitcoin short bitcoin bitcoin flex tether bootstrap claim bitcoin 1080 ethereum mt5 bitcoin 22 bitcoin nicehash bitcoin bitcoin instaforex
bitcoin metatrader buy tether котировки bitcoin 6000 bitcoin ethereum валюта bitcoin lurk monero faucet flash bitcoin bitcoin converter bitcoin cudaminer валюты bitcoin прогнозы bitcoin token bitcoin
bitcoin registration pay bitcoin bitcoin продам
робот bitcoin takara bitcoin bitcoin mempool bitcoin проект кран ethereum bitcoin minergate bitcoin maps bitcoin income global bitcoin bitcoin asic bitcoin stellar
coin bitcoin bitcoin луна mixer bitcoin
coindesk bitcoin
токены ethereum client ethereum 100 bitcoin bitcoin trinity куплю ethereum заработать monero