Files
darkfi/proof/inclusion_proof.zk
parazyd 6a024ab801 zkas: Add a field definition on top of the circuit file.
Currently unused, but will probably be expanded to define proofs over
different fields.
2023-08-14 17:09:18 +02:00

24 lines
408 B
Plaintext

k = 13;
field = "pallas";
constant "InclusionProof" {
}
witness "InclusionProof" {
Base leaf,
Uint32 leaf_pos,
MerklePath path,
Base blind,
}
circuit "InclusionProof" {
# Merkle root
root = merkle_root(leaf_pos, path, leaf);
constrain_instance(root);
# Also export the actual value but encrypted with a random blind
enc_leaf = poseidon_hash(leaf, blind);
constrain_instance(enc_leaf);
}