Merge branch 'master' of github.com:poma/mixer-huyixer

This commit is contained in:
Roman Storm 2019-08-01 17:20:00 -07:00
commit 5634c0cfb4
1 changed files with 6 additions and 1 deletions

View File

@ -30,7 +30,6 @@ template CommitmentHasher() {
template Withdraw(levels, rounds) {
signal input root;
signal input nullifierHash;
// TODO: Check if we need some kind of explicit constraints or something for those 2 inputs
signal input receiver; // not taking part in any computations
signal input fee; // not taking part in any computations
signal private input nullifier;
@ -51,6 +50,12 @@ template Withdraw(levels, rounds) {
tree.pathElements[i] <== pathElements[i];
tree.pathIndex[i] <== pathIndex[i];
}
// Add hidden signal to make sure that tampering with receiver or fee will invalidate the snark proof
// Most likely it is not required, but it's better to stay on the safe side and it only takes 1 constraint
// Multiplication is used to prevent optimizer from removing this constraint
signal unused;
unused <== receiver * fee;
}
component main = Withdraw(16, 220);