Skip to content

Chainweb Merkle Tree

Lars Kuhtz edited this page Nov 22, 2023 · 30 revisions

Block Header Merkle Tree

The following diagram shows the structure of a Block Header Merkle tree for a twenty chain graph.

Legend:

  • rounded nodes: data leafs
  • diamond nodes: Merkle tree roots
  • round nodes: internal Merkle tree nodes
  • trapezoid: sub-Merkle trees with the listed leaf nodes
  • sub-graphs: nested Merkle trees
graph TD
  subgraph bht [BlockHeader]
    direction TB
    
    %% root
    bhash{{BlockHash}}

    %% leafs
    bf([BlockFlags])
    bc([BlockCreationTime])
    bp{{BlockParentHash}}
    bt([BlockTarget])
    %% block payloads
    bi([BlockChainId])
    bw([BlockWeight])
    bh([BlockHeight])
    bv([BlockChainwebVersion])
    be([BlockEpochStart])
    bn([BlockNonce])
    ba1{{BlockAdjacentParentHash_1}}
    ba2{{BlockAdjacentParentHash_2}}
    ba3{{BlockAdjacentParentHash_3}}

    %% inner nodes
    n0( ) --> bf & bc
    n1( ) --> bp & bt
    n2( ) --> n0 & n1
    n3( ) --> bpt & bi
    n4( ) --> bw & bh
    n5( ) --> n3 & n4
    n6( ) --> n2 & n5
    n7( ) --> bv & be
    n8( ) --> bn & ba1
    n9( ) --> n7 & n8
    n10( ) --> ba2 & ba3
    n11( ) --> n9 & n10
    bhash --> n6 & n11
    
  subgraph bpt [BlockPayload]
    direction TB
    bph{{BlockPayloadHash}}
    bph --> btt
    bph --> bot

    subgraph btt [BlockTransactions]
      direction TB
      bth{{BlockTransactionsHash}}
      bth --> txs[/MinerData, Transactions \]
    end

    subgraph bot [BlockOutputs]
      direction TB
      boh{{BlockOutputsHash}}
      boh --> outs[/Coinbase, Outputs\]
    end
  end
  end
Loading