mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-09-21 05:14:59 -04:00
docs and minor changes
This commit is contained in:
parent
5db6595c61
commit
9d75637b8c
5 changed files with 37 additions and 14 deletions
|
@ -2,6 +2,7 @@ include "../node_modules/circomlib/circuits/bitify.circom";
|
|||
include "../node_modules/circomlib/circuits/pedersen.circom";
|
||||
include "merkleTree.circom";
|
||||
|
||||
// computes Pedersen(nullifier + secret)
|
||||
template CommitmentHasher() {
|
||||
signal input nullifier;
|
||||
signal private input secret;
|
||||
|
@ -21,6 +22,7 @@ template CommitmentHasher() {
|
|||
hash <== commitment.out[0];
|
||||
}
|
||||
|
||||
// Verifies that commitment that corresponds to given secret and nullifier is included in the merkle tree of deposits
|
||||
template Withdraw(levels, rounds) {
|
||||
signal input root;
|
||||
signal input nullifier;
|
||||
|
@ -36,10 +38,11 @@ template Withdraw(levels, rounds) {
|
|||
|
||||
component tree = MerkleTree(levels, rounds);
|
||||
tree.leaf <== hasher.hash;
|
||||
tree.pathElements <== pathElements;
|
||||
tree.pathIndex <== pathIndex;
|
||||
|
||||
root === tree.root;
|
||||
tree.root <== root;
|
||||
for (var i = 0; i < levels; i++) {
|
||||
tree.pathElements[i] <== pathElements[i];
|
||||
tree.pathIndex[i] <== pathIndex[i];
|
||||
}
|
||||
|
||||
// TODO: Check if we need some kind of explicit constraints or something
|
||||
fee === fee;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue