iden3 / snarkjs

zkSNARK implementation in JavaScript & WASM
GNU General Public License v3.0
1.76k stars 421 forks source link

circuit too big for this power of tau ceremony. 9514*2 > 2**12 #123

Closed heypran closed 2 years ago

eigmax commented 2 years ago

Same error here when verifying EDDSA. did you solve it? @heypran

eigmax commented 2 years ago

The code :

pragma circom 2.0.0;
include "../../circomlib/circuits/eddsamimc.circom";
include "../../circomlib/circuits/mimc.circom";

template VerifyEdDSAMiMC() {
    signal input Ax;
    signal input Ay;
    signal input R8x;
    signal input R8y;
    signal input S;
    signal input M;

    //signal input preimage[k];

    //component M = MultiMiMC7(k,91);
    //M.in[0] <== preimage[0];
    //M.in[1] <== preimage[1];
    //M.in[2] <== preimage[2];
    //M.in[3] <== preimage[3];
    //M.in[4] <== preimage[4];

    component verifier = EdDSAMiMCVerifier();
    verifier.enabled <== 1;
    verifier.Ax <== Ax;
    verifier.Ay <== Ay;
    verifier.R8x <== R8x;
    verifier.R8y <== R8y;
    verifier.S <== S;
    //verifier.M <== M.out;
    verifier.M <== M;
}

component main {public [Ax, Ay, R8x, R8y, S, M]} = VerifyEdDSAMiMC();
eigmax commented 2 years ago

Even I use this case, the error is still raised.

Hi, @jbaylina May I ask for a favor of you to give some tips for how to debug such a problem?

eigmax commented 2 years ago

@heypran I fixed it by changing the power to a bigger one when starting a power ceremony: snarkjs powersoftau new bn128 $POWER ...

heypran commented 2 years ago

Oh cool I will try that, for now I bypassed it by using an existing powers of tau. But will need to generate a final one post testing.