Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Scalar size does not match #289

Open
design-smith opened this issue Aug 27, 2024 · 1 comment
Open

Error: Scalar size does not match #289

design-smith opened this issue Aug 27, 2024 · 1 comment

Comments

@design-smith
Copy link

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?

@Arvolear
Copy link
Contributor

Arvolear commented Sep 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants