inclusion_proof.zk 390 B

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