143 votes

Ethereum block architecture

Here's my interpretation, based on the yellow paper: ...the Tries should look more like this:
  • 8,004
77 votes
Accepted

Ethereum block architecture

Lets first start with my adaptation of this figure illustrating the Bitcoin block structure: So far so good. All fairly basic. Enter Ethereum and things get a wee bit more complex. After reading ...
  • 5,070
32 votes
Accepted

Where is the state data stored?

Conceptually, there are 2 important components of an account-based blockchain: transactions represent state transition functions the result of these functions can be stored A "full/archival" node ...
22 votes

Ethereum block architecture

Here is a complete structure of a block and where it plays its role in Ethereum's blockchain. You asked for a diagram but i think this would be more explanatory.
21 votes

Ethereum Merkle Tree Explanation

The state has the information of all accounts in the blockchain, it is not stored in each block. The state is generated processing each block since the genesis block. Each block will only modify parts ...
  • 30.1k
16 votes

Where is the state data stored?

Technically the states are assembled into a state tree (patricia-tree) linked to the account (balance in case of EAOs and balance and storage in case of contract's account) and to the blocks (figures ...
  • 17.8k
14 votes

Ethereum Merkle Tree Explanation

Ethereum is said to have an account-based blockchain. The state isn't directly stored in each the block. To build a better conceptual understanding, we can say that all account states reside locally ...
  • 1,550
12 votes

Ethereum block architecture

The description can be found in the Yellow Paper which is the formal specification of the Ethereum protocol. Here are the main pieces of a block: 4.3. The Block. The block in Ethereum is the ...
  • 79.8k
12 votes
Accepted

Getting complete state of a smart contract

There is no way to do it via JSON RPC or with web3 API. I've created a repository on Github with an example showing how to read all Patricia trie entries in a block and in any contract storage using ...
  • 10.5k
9 votes

Ethereum block architecture

Here's a picture from V's article regarding data structures for light clients: https://blog.ethereum.org/2014/02/18/ethereum-scalability-and-decentralization-updates/
  • 4,636
8 votes
Accepted

Is it possible to access storage history from a contract in solidity?

No, Solidity code (and EVM code in general) is only able to read the current state at the block at which it is being called. If it were able to read state at previous blocks you would need the entire ...
  • 16.4k
8 votes
Accepted

How many trie's does Ethereum have?

This sounds correct to me. Referring to the graphical interpretation of the descriptions in the Yellow Paper, your 4 tries are shown in the "Information required to derive block header" section. ...
6 votes
Accepted

How was the state-bloat attack that led to the EIP 150 hardfork performed?

Ancient history, but here goes :-) There was one coordinating contract for the initial attack. A later version had a more complex algorithm to generate the empty account addresses, presumably to try ...
  • 8,762
6 votes

Ethereum block architecture

Vitalik Buterin gives a compact answer: Every block header in Ethereum contains 3 trees for three kinds of objects: Transactions, Receipts (essentially, pieces of data showing the effect of each ...
6 votes
Accepted

Full node sync only preserve the last 128 history states

The behavior has changed with the release of geth v1.8.0 Fromt the release notes Tracing and pruning: By default, state for the last 128 blocks kept in memory. Most states are garbage collected. ...
  • 30.1k
5 votes

Where is the state data stored?

Fusing nuggets of information from multiple sources (primarily, this and this): State data (together with account balances, contract code and account nonce) is stored by every Ethereum ...
  • 5,070
5 votes
Accepted

Getting current full state

Each node keeps a complete copy of the current state, and update it with each new block. New nodes need to reconstruct the state by replaying the state changes in each block, although state-trie ...
  • 34.8k
4 votes

Is it possible to access storage history from a contract in solidity?

Yes, it is possible with Web3 at any given block. If your contract has: contract ValueStore { function getValue(uint param) constant returns (uint returnedValue); } Then, after instantiating ...
4 votes

Are there multiple instances of Ethereum state or a single latest image?

The ethereum state is stored on disk in a merkle tree separate from the actual data of the blockchain (ie. the blocks of transactions). The state is not included in blocks - only the state root is ...
  • 724
4 votes
Accepted

How is a post-transaction state calculated?

The state trie contains the balance of each account. Even transactions that throw an exception result in a reduction in the sender's balance through gas costs, which means that the resulting state is ...
  • 34.8k
4 votes

How Ethereum state tree is formed?

[Q1] Records in the state trie can exist independently of the state root that references them. Each node is stored in what is essentially a flat hashmap, and nodes have references to allow them to ...
  • 541
4 votes
Accepted

Does geth --syncmode light download the State Trie?

The light client does not download state data. It downloads the header chain, and verifies the proof-of-work but not the transactions themselves. Each block includes a state root, which allows it to ...
  • 541
4 votes
Accepted

Why are transaction tries in Ethereum not plain Merkle Tries?

First, it should be noted that there is no such thing as a "plain Merkle Trie". The Merkle tree found in Bitcoin is not a radix tree (trie). The main reason Ethereum uses a Patricia Trie for ...
  • 34.8k
4 votes

Where are the Ethereum smart contracts actually stored?

from the ethereum yellow paper The world state, is a mapping between addresses and account states (a data structure serialised as RLP). Though not stored on the blockchain, it is assumed that the ...
3 votes

Ethereum block architecture

Extrapolating from the syntactic block structure, we can also ask what the semantic ethereum world state structure looks like. I use this diagram to explain the relationship between "on-chain&...
  • 130
3 votes

Reading Ethereum contract state variables

In the context of your question, you can think of the blockchain as a database. A database on its own cannot "send data to the external world" - it requires some script to query the database and then ...
  • 1,165
3 votes

Reading Ethereum contract state variables

Yes, this is correct. Everything on the blockchain is public, but only the current state is visible to smart contracts. Interestingly, using a Merkel proof, you can prove to a contract that another ...
  • 34.8k
3 votes
Accepted

How can empty accounts with a nonce of zero appear on the blockchain?

When you send a zero value transaction to an account that does not exist. The same works for zero value creates (both through transactions and the CREATE opcode) as well as CALLing in to an account ...
  • 1,899
3 votes
Accepted

In the Ethereum Modified Merkle-Particia tree, what do the prefix, key and value signify?

Appendix D of the Yellow Paper, in defining the node types, states (italics mine): Leaf: A two-item structure whose first item corresponds to the nibbles in the key not already accounted for by ...
  • 8,004
3 votes

How Ethereum transaction tree is formed

I'm going to disagree with the conversation in the comments to the other answer. (Apologies in advance!) I think what's being outlined in the question is generally correct, at least from the way I'd ...

Only top scored, non community-wiki answers of a minimum length are eligible