privacy-scaling-explorations / maze

Multi proof Aggregation for Zk SNARK on Ethereum
61 stars 2 forks source link

verify proof fail caused by ERR_BN128_INVALID_POINT NotOnCurve #6

Open samzkback opened 1 year ago

samzkback commented 1 year ago

Follow the Step8 command as Readme suggested Carefully, this is all what I do

    git clone https://github.com/privacy-scaling-explorations/maze
    cd maze/maze-cli
    cargo build
    cargo install --path .
    cd testdata
    maze create-proof verification_key.json proofs.json public_signals.json hez_22.srs outputs

Got error

Reading circom-plonk verification key, proofs, and public signals

Reading parameters for the circuit
Took 60 seconds

Building aggregation circuit for 3 proofs

Generating proving key
Took 148 seconds

Generating proof
Took 348 seconds

Simulating evm verification

Gas used: 18446744073709551615
Verification failed

Debug on revm and find it finally failed while check a invalid point during ec_sclar_mul precompile(0x7), https://github.com/bluealloy/revm/blob/main/crates/precompile/src/bn128.rs#L110 https://github.com/paritytech/bn/blob/master/src/groups/mod.rs#L111

opcode ... 22 97 81 97 82 97 81 97 82 97 81 97 82 96 97 96 97 96 90 250
StaticCall call to 0x0000…0007
x : Fq(U256([244349042550991243437155908321476066049, 43950915908091919719540099847108744385]))
y : Fq(U256([317777436645032443397208182911248111240, 61049327462658569164156111837744252669]))
Not On Curve!!!

It's a low-level issue, I have no idea how to debug further.