diff --git a/circuits/transaction.circom b/circuits/transaction.circom index 27520f8..24f7c80 100644 --- a/circuits/transaction.circom +++ b/circuits/transaction.circom @@ -43,7 +43,6 @@ template Transaction(levels, nIns, nOuts, zeroLeaf) { component inKeypair[nIns]; component inUtxoHasher[nIns]; component nullifierHasher[nIns]; - component inAmountCheck[nIns]; component tree[nIns]; component checkRoot[nIns]; var sumIns = 0; @@ -77,9 +76,9 @@ template Transaction(levels, nIns, nOuts, zeroLeaf) { checkRoot[tx].in[1] <== tree[tx].root; checkRoot[tx].enabled <== inAmount[tx]; - // Check that amount fits into 248 bits to prevent overflow - inAmountCheck[tx] = Num2Bits(248); - inAmountCheck[tx].in <== inAmount[tx]; + // We don't need to range check input amounts, since all inputs are valid UTXOs that + // were already checked as outputs in the previous transaction (or zero amount UTXOs that don't + // need to be checked either). sumIns += inAmount[tx]; }