inclusion_proof.zk 408 B

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