iden3 / snarkjs

zkSNARK implementation in JavaScript & WASM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using BLS12-381 curve to generate groth16 solidity verifier results in out of range error in solidity

madhav-madhusoodanan opened this issue · comments

Hi

Thank you so much for creating and maintaining this project.

I would like to point out that the verification key data values (alphas, betas, gammas, deltas) in solidity have a value which is outside the range of the uint256 data type when groth16 verification system on the bls12-381 curve is used.

I'm attaching an example solidity verifier with this issue for reference: verify.sol

Do let me know how I can help with sorting this issue.

Thank you so much.

Would it be suggestible to use a Solidity Big-Integer library for handling such numbers?

For example, the solidity-BigNumber library (however it has not been audited properly)