merkle tree

Complete

Summary

Merkle tree

OperationMethodPerformance
insert(f)propagate hash up to the root, add new subtree if full- , amortized
verify(i,j)retrieve and , calculate and check -
update(i, f)propagate hash up to the root-

Concept

Data structure

  • complete binary tree - unfilled leaves are usually 0
  • abit like divide-and-conquer
h12345678h1234h12h1h2h34h3h4h5678h56h5h6h78h7h8H(h1234jjh5678)=H(h12jjh34)=H(h1jjh2)=

Application

Querying

  • query(1,4)
h12345678h1234h12h1h2h34h3h4h5678h56h5h6h78h7h8
  • query(1,3)
h12345678h1234h12h1h2h34h3h4h5678h56h5h6h78h7h8