Open cyphersnake opened 3 weeks ago
when tree height is large e.g. 32 levels, then it is practical to start with default tree.
In bottom level (level 1), each leaf has default value v1=hash(NULL) In next level (level 2), each node has default value v2=hash(v1,v1), ... The root of merkle tree has default value v32=hash(v31,v31)
FYI
Apart from the benchmark itself, the only thing left is the correctness of the merkle-tree calculation on-circuit
Now you can rearrange the sibling in the counting of the original root and the new one - and the circuit will think that everything is correct, but it is wrong. I'll fix it tomorrow by fixing the order of hash input with index.
But except for this nuance - the circuit is ready and working and folding
I finished to implement merkle-tree-update-circuit, collect data for all the batch we are interested in, moved to the task of implementing this circuit within halo2, so far the problem is that MockProver
passes, but does not work full IPA. I'm figuring it out
Benchmark Update:
Start with initial tree state. The initial tree can be fully filled with default values (e.g. hash(NULL)). Then batch update the merkle tree by a list of nodes.
Public Input
[Old Root Hash, Root Hash]
Private InputVec<(leaf_index, new_leaf_value)>