iden3/circom

Error: Scalar size does not match

design-smith opened this issue · 1 comments

I am trying to create a really simple circuit that takes in an array and gives 1 as the output. Here is my circuit code:

pragma circom 2.0.0;

template ArrayReceived(n) {
signal input arr[n];
signal output out;

out <== 1;

}

component main = ArrayReceived(10);

Is this a common error? What could I be doing wrong?

Hey, @design-smith, this is a common issue. When a circuit has 0 constraints, snarkjs throws this exact error.

From circom docs:

Note that constraints must be quadratic, linear or constant equations ...

In your example, the <== operator does not generate a constraint since the equation is not quadratic.