implement the specified sparse merkletree (#82)

* wip

* prototype custom predicates 1b

* feat: implement custom pred recursion

* files reorg, add github CI for rustfmt checks

* start sparsemerkletree. impl add_leaf method, initial Leaf & Intermediate types with methods

* mt: add hash computation of all the nodes in the tree, add method to print the tree to visualize it as a graphviz

* mt: add  (till the leaf) method which is used by get,contains,prove methods

* mt: add verify (of inclusion) method

* mt: update 'down' method to reuse siblings, update get,contains,prove methods (the three use 'down' under the hood)

* Add nonexistence proofs and iterator

* Add iterator test

* migrate usage of old merkletree to the new merkletree impl in POD2 code

---------

Co-authored-by: Eduard S. <eduardsanou@posteo.net>
Co-authored-by: Ahmad <root@ahmadafuni.com>
This commit is contained in:
arnaucube 2025-02-21 02:13:58 +01:00 committed by GitHub
parent 2e9719a1ca
commit c101d94530
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 649 additions and 198 deletions

View file

@ -510,7 +510,7 @@ pub mod tests {
let pay_stub = pay_stub.sign(&mut signer).unwrap();
println!("{}", pay_stub);
let kyc = zu_kyc_pod_builder(&params, &gov_id, &pay_stub);
let kyc = zu_kyc_pod_builder(&params, &gov_id, &pay_stub)?;
println!("{}", kyc);
// TODO: prove kyc with MockProver and print it
@ -520,7 +520,7 @@ pub mod tests {
#[test]
fn test_front_great_boy() -> Result<()> {
let great_boy = great_boy_pod_full_flow();
let great_boy = great_boy_pod_full_flow()?;
println!("{}", great_boy);
// TODO: prove kyc with MockProver and print it
@ -530,7 +530,7 @@ pub mod tests {
#[test]
fn test_front_tickets() -> Result<()> {
let builder = tickets_pod_full_flow();
let builder = tickets_pod_full_flow()?;
println!("{}", builder);
Ok(())