Skip to content

Merkle package

David Vorick requested to merge merkle into master

I left all of the other merkle stuff because it's working well enough. I put the new merkle stuff into it's own package.

I sat down and worked through everything, and I feel like I have a pretty pristine understanding of how and why all this code works. I haven't documented it well, but I plan on it. The proof builder needs a few more tests, marked with TODO. Unfortunately, they have 15 nodes each, so it'll be a decent amount of code to build everything by hand.

I would like more thorough coverage of the smaller numbers too, but practically speaking we can't manually build all of the possible trees. I don't think that the existing merkle code would pass the tests I have written, we never did any manual testing for the proof building and verification.

Verification is not implemented, though it's probably going to be quite a bit simpler than everything else. Testing it should also be pretty simple, just build stuff with the already-tested builder and see that the verifier passes it. (then change the index and see that the verifier fails it for all possible other indices). No need to make anything by hand.

Merge request reports