Find a file
arnaucube 745d654048
MerkleTree insertion proofs (#344)
* implement merkletree insert & insert-proof-verification

* add merkletree circuit to verify insertion proof

wip

* fix merkletree's GraphViz generation for cases with empty siblings

* implement tree insert-verif circuit siblings checks

Note: I've implemented also an alternative version which instead of
inputting a witness value 'divergence_level' it inputs a bitmask. Both
approaches (divergence_level and divergence_bitmask) take the same
amount of constraints (336 constraints for a tree of 32 levels, and for
an hybrid approach it takes 331 constraints but the code gets a bit less
readable). So I've kept with the current implementation (using
divergence_level) which is more easy to follow.

* [tree] modify the strategy for the insert-proof (out-circuit)

* re-implement insert-proof verification circuit

* add pending checks and polish

* add tests for disabled(&enabled) cases that should fail

* update typos.toml config

* Add test with tampering

* add check 5.3, to prevent tampering (at insertion proof circuit)

* move old_leaf_hash computation outside the loop, simplify check 5.3 booleans

* apply @ed255 review suggestions

---------

Co-authored-by: Ahmad <root@ahmadafuni.com>
2025-07-24 12:02:44 +02:00
.github/workflows MerkleTree insertion proofs (#344) 2025-07-24 12:02:44 +02:00
book First iteration of circuits naming convention 2025-07-15 17:49:29 +02:00
examples Remove unnecessary mut in PodSigner trait (#340) 2025-07-15 17:37:26 +02:00
src MerkleTree insertion proofs (#344) 2025-07-24 12:02:44 +02:00
.gitignore Aard custom (#49) 2025-02-24 09:05:30 -08:00
Cargo.toml Assorted tweaks to support external playground crate (#322) 2025-07-02 09:27:54 -07:00
README.md Featurize middleware types that are actually defined by the backend (#94) 2025-02-27 14:15:31 +01:00
rust-analyzer.toml chore(qol): add rust-analyzer.toml (#187) 2025-04-08 08:33:49 +10:00
rust-toolchain.toml Add clippy (#191) 2025-04-08 11:52:02 -07:00
rustfmt.toml Organize imports (#188) 2025-04-07 16:19:13 -07:00

POD2

Usage

  • Run tests: cargo test --release
  • Rustfmt: cargo fmt
  • Check typos: typos -c .github/workflows/typos.toml

Book

The book contains the specification of POD2. A rendered version of the site can be found at: https://0xparc.github.io/pod2/

To run it locally:

  • Requirements
  • Go to the book directory: cd book
  • Run the mdbook: mdbook serve