gnosis / dex-zksnarks

Code to generate snark proofs for batch auction result validation of the Gnosis d.exchange
46 stars 7 forks source link

Use Gadget for is_negative in pepper #36

Open fleupold opened 5 years ago

fleupold commented 5 years ago

We are currently getting a lot of warnings WARNING: Coefficient larger than prime due to the way isNegative is implemented for Pepper. It's probably best to implement our own gadget and compare the 254 bits to (p-1)/2. Ideally we can use a gadget from the Ethsnarks library.

https://github.com/gnosis/dex-zksnarks/blob/79d91908d44fc97b07989584c1495a523a321c47/pepper/apps/dex_common.h#L77

This could be a good first issue since it teaches how to create and integrate a new gadget into the codebase.

fleupold commented 5 years ago

Turns out the other warning Warning - change references on a polynomial is also related to the isNegative is implemented.