zkas/zk: add sparse_tree_is_member() opcode

This commit is contained in:
zero
2024-03-04 10:03:30 +01:00
parent 39223c6a98
commit 376784af2e
11 changed files with 223 additions and 14 deletions

21
proof/smt.zk Normal file
View File

@@ -0,0 +1,21 @@
k = 13;
field = "pallas";
constant "SMT" {
}
witness "SMT" {
Base root,
SparseMerklePath path,
Base leaf,
}
circuit "SMT" {
is_member = sparse_tree_is_member(root, path, leaf);
ONE = witness_base(1);
constrain_equal_base(is_member, ONE);
constrain_instance(root);
}