inclusion_proof.zk 381 B

1234567891011121314151617181920
  1. constant "InclusionProof" {
  2. }
  3. witness "InclusionProof" {
  4. Base leaf,
  5. Uint32 leaf_pos,
  6. MerklePath path,
  7. Base blind,
  8. }
  9. circuit "InclusionProof" {
  10. # Merkle root
  11. root = merkle_root(leaf_pos, path, leaf);
  12. constrain_instance(root);
  13. # Also export the actual value but encrypted with a random blind
  14. enc_leaf = poseidon_hash(leaf, blind);
  15. constrain_instance(enc_leaf);
  16. }