docs and minor changes

This commit is contained in:
poma 2019-07-10 15:35:46 +03:00
parent 5db6595c61
commit 9d75637b8c
5 changed files with 37 additions and 14 deletions

View file

@ -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;