Open tchataigner opened 2 months ago
Already on the branch
add
, sub
, mul
of Fp
add
, sub
, mul
of Fp2
G1
in the unchecked endpoint
G2Affine addition has been landed to dev
of wp1 (https://github.com/wormhole-foundation/wp1/pull/160)
cc @tchataigner
Currently, we leverage the zkvm or the decompress branch to leverage the pre-compiles in our light client implementation. I'm opening this issue to keep track of what is needed, what is available and what is to come.
Usage in Light Client
For the Light Client usage we are leveraging the bls crate on two main structures:
PublicKey
andSignature
.PublicKey
are structure defined overG1
whileSignature
are defined overG2
. Those components have the following usage associated to them:PubllicKey
decompression
: Conversion from a compressed form (slice of 48 bytes) to its decompressed one.aggregate
: Addition ofG1
decompressed points. In the future, we might also need substraction for optimization purposes.Signature
decompression
: Conversion from a compressed form (slice of 96 bytes) to its decompressed one.signature_verification
: Verify an aggregated signature based on the aggregated public key, by leveraging thepairing
mechanism.What's to be integrated
After some exchange with @wwared here is what we believe should be integrated in this crate for our purposes:
Current status
Already on the branch
add
,sub
,mul
ofFp
add
,sub
,mul
ofFp2
G1
in the unchecked endpointadd
anddouble
forG1Affine
(used inG1Affine::add_affine
only for now)To add
add
forG2Affine
To add in future work
Fp2
sqrt
(done, but not merged as a PR - might not get merged in favor of a G2 decompress precompile)Fp
sqrt
(same as above)Fp
invert
Fp2
invert
double
forG2Affine
G2
decompress
in the unchecked endpoint