Skip to content

Latest commit

 

History

History
71 lines (34 loc) · 2.74 KB

File metadata and controls

71 lines (34 loc) · 2.74 KB

Steven

Hi, my name is Steven, studying and working in data. Looking forward to learning a lot from https://epf.wiki/#/ and meeting new amazing people. X/tele/ig: @im24steven

Notes

The Protocol: Data Structures

04/05

Referencing: https://epf.wiki/#/wiki/protocol/data-structures?id=data-structures-in-ethereum

(Delving into the data structures of eth for a better understanding of building relational databases for eth transactions.)

  1. Merkle Patricia Trie as the primary data structure for storing the execution layer state. PT: all data is stored in the leaf nodes. Space efficient.

    3 types of nodes in ETH MPT:

    • Branch Nodes: 1 node value + 16 branches = 17-element array.
    • Extension Nodes: optimized, compressed, eliminating redundant branch nodes with single children.
    • Leaf Nodes: key-value pairs. Value = node content; Key = node hash.

MPT (The root is also an extension node)

  1. Within one ETH block, 4 different modified MPTs:

    • Transaction Trie: Nonce, from, to, value, etc.
    • Receipt Trie: logs, status code, etc.
    • World State Trie: nonce, balance, storageRoot, etc.
    • Account State(Storage) Trie, storageRoot

(Visualization)

Insight: 1. Efficient data retrieval in MPT. 2. translating MPT into relational schemas, different parts of the Merkle tree can be stored in different tables. For building/saving historical data as relational databases using schemas with certain normalization levels, tables can be stored separately--nodes table, accounts state table, transactions table, etc.

  1. TODO: On Merkle Trees in ETH and ZKP: how ZKP project tables could be generated?

04/06

  1. More MPT: ETH vs ZKP

    Iden3 as an example:

    Store & validate claims:

    zkp-mt1

    zkp-mt2

    Able to design such a circuit which recreates the calculation model of the root of a merkle tree to verify the received proofs by recalculating the root of the merkle tree.

    zkp in identity systems

  2. Verkle Update: A better MPT, optimized by reducing witness size.

  • "The main difference between the Verkle tree and the Merkle tree structure is that the Verkle tree is much flatter, meaning there are fewer intermediate nodes linking a leaf to the root, and therefore less data required to generate a proof." eth org

    Merkle Tree Path Visualize