Ethereum Data Structure And Storage Analysis

admin 63 0

one. Overview In Ethereum, data storage is roughly divided into three parts: state data, blockchain, and underlying data. Among them, the underlying data stores all data in Ethereum, and the storage format is [k, v] key-value pairs. The database currently used is; all data related to transactions and operations are stored on-chain; it is used to manage accounts. Every account has one. two. Block structure of the block part: The blockchain is one of the cores of Ethereum. All transactions and structures are stored in blocks. Next we take a look at the block structure in Ethereum. Basically all structure definitions in Ethereum can be found in core/types, while the block structure is defined in block.go: Influenced by the Bitcoin blockchain data structure, I think blocks can be simply divided into Two parts: head and body. . But after reading the Ethereum source code, I found that it was not designed this way. In block.go, the block structure of the Ethereum blockchain is defined as: you can see body+head!=block. In addition, many structures are also defined in the block.go file, such as structures used for protocols, structures used for storage, etc. It can be seen that this structure is used very frequently. Let's take a look at how the structure is defined: The member variables are explained as follows: : Pointer to the parent block (). Except for the genesis block (Block), each block has one and only one parent block. : The address of the miner who mined this block. Used to issue rewards. : The hash value of the Block structure member. Note that this field is an array. Root: The hash value of the root node of the "State Trie". In Block, each account is represented by an object, the account is uniquely identified, and its information is modified during the execution of related transactions (). All account objects can be inserted one by one [...]

标签: #Block #Structure #Ether #Storage #Account

  • 评论列表

留言评论