filecoin-project / rust-fil-proofs

Proofs for Filecoin in Rust
Other
493 stars 317 forks source link

Switch from pairing to bls12-381 #1005

Closed DrPeterVanNostrand closed 4 years ago

DrPeterVanNostrand commented 4 years ago

Description

Currently we depend on filecoin's fork of pairing, it would be ideal to switch that dependency to the bls12-381 crate. The bls12-381 crate refactors out the bls12_381 module from pairing and makes some improvements to the API which are currently using.

It would be ideal to switch this dependency for the following reasons:

Things that have not (as of today) changed from pairing to bls12-381:

Why we can't switch today

We use Zcash's sapling-crypto crate which depends on pairing. Sapling has not yet been ported to using the new bls12-381 crate. Some of the functionality that we rely on has been refactored out of sapling-crypto into the crate jubjub, but this refactor does not include every part of Sapling that we depend on (mainly Pedersen hash, params, and circuit).

Notes for when switching from pairing to bls12-381

The the two crates are almost identical except for:

dignifiedquire commented 4 years ago

Not needed anymore, we are now using blstrs and paired, with the goal to merge them into a single implementation at some point. We might consider updating our APIs there to match bls12-381 but this will be work happening there first.