mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-08 22:28:12 -05:00
smt: simplify ZK gadget. Use root = sparse_merkle_root(pos, path, leaf) instead of the more complicated is_member = sparse_tree_is_member(root, path, pos, leaf)
This commit is contained in:
@@ -5,17 +5,12 @@ constant "SMT" {
|
||||
}
|
||||
|
||||
witness "SMT" {
|
||||
Base root,
|
||||
SparseMerklePath path,
|
||||
Base leaf,
|
||||
}
|
||||
|
||||
circuit "SMT" {
|
||||
is_member = sparse_tree_is_member(root, path, leaf, leaf);
|
||||
|
||||
ONE = witness_base(1);
|
||||
constrain_equal_base(is_member, ONE);
|
||||
|
||||
root = sparse_merkle_root(leaf, path, leaf);
|
||||
constrain_instance(root);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user