From 9efab84e65d923410ce4418794a5ca2ddcd74f37 Mon Sep 17 00:00:00 2001 From: poma Date: Sat, 2 Nov 2019 04:32:28 +0300 Subject: [PATCH] remove explicit constraints on inputs --- circuits/withdraw.circom | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/circuits/withdraw.circom b/circuits/withdraw.circom index cc1448d..36a4674 100644 --- a/circuits/withdraw.circom +++ b/circuits/withdraw.circom @@ -31,9 +31,9 @@ template Withdraw(levels, rounds) { signal input root; signal input nullifierHash; signal input receiver; // not taking part in any computations - signal input relayer; // not taking part in any computations - signal input fee; // not taking part in any computations - signal input refund; // not taking part in any computations + signal input relayer; // not taking part in any computations + signal input fee; // not taking part in any computations + signal input refund; // not taking part in any computations signal private input nullifier; signal private input secret; signal private input pathElements[levels]; @@ -52,18 +52,6 @@ template Withdraw(levels, rounds) { tree.pathElements[i] <== pathElements[i]; tree.pathIndex[i] <== pathIndex[i]; } - - // Add hidden signals 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 2 constraints - // Squares are used to prevent optimizer from removing those constraints - signal receiverSquare; - signal feeSquare; - signal relayerSquare; - signal refundSquare; - receiverSquare <== receiver * receiver; - feeSquare <== fee * fee; - relayerSquare <== relayer * relayer; - refundSquare <== refund * refund; } component main = Withdraw(16, 220);