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

Circom Public Inputs Example not working, Snarkjs 0.7.4, Circom 2.1.9 #293

Open
jonas089 opened this issue Sep 9, 2024 · 0 comments
Open

Comments

@jonas089
Copy link

jonas089 commented Sep 9, 2024

[ERROR] snarkJS: Error: Scalar size does not match
    at _multiExp (/opt/homebrew/lib/node_modules/snarkjs/node_modules/ffjavascript/build/main.cjs:4978:19)
    at WasmCurve.multiExpAffine (/opt/homebrew/lib/node_modules/snarkjs/node_modules/ffjavascript/build/main.cjs:5015:22)
    at groth16Prove$1 (/opt/homebrew/lib/node_modules/snarkjs/build/cli.cjs:5768:33)
    at async Object.groth16Prove [as action] (/opt/homebrew/lib/node_modules/snarkjs/build/cli.cjs:12975:36)
    at async clProcessor (/opt/homebrew/lib/node_modules/snarkjs/build/cli.cjs:481:27)

for circuit:

pragma circom 2.0.0;

template Multiplier2(){
   //Declaration of signals
   signal input in1;
   signal input in2;
   signal output out;
   out <== in1 * in2;
}

component main {public [in1,in2]} = Multiplier2();

with inputs:

{"in1": "3", "in2": "11"}

Is this a known issue? I followed the tutorial exactly yet it does not generate a proof. If I make either of the inputs private it works e.g. component main {public [in1]} = Multiplier2(); is ok.

Screenshot 2024-09-09 at 22 45 55

See example for reference:
https://docs.circom.io/circom-language/signals/

I suspect this might be due to the two inputs forming a quadratic constraint. When I introduce a third input and make it public it works again.

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

1 participant