NilFoundation / zkLLVM

Zero-Knowledge Proof Systems Circuit Compiler
https://docs.nil.foundation/zkllvm
274 stars 45 forks source link

Add BLS12-381 logic handling #288

Open nkaskov opened 9 months ago

nkaskov commented 9 months ago

We need BLS12-381 curve and field arithmetics support in order to build zk-apps with BLS signature.

As a result of this task, all types of BLS signatures (including aggregated ones) have to be efficiently implemented. This might require adding new builtins for BLS pairings.

The list of target signature algorithms is in the comment below.

Depends on: https://github.com/NilFoundation/zkLLVM/issues/288

ayashunsky commented 8 months ago

BLS12-381 uses 2 groups: G1: with points on an elliptic curve over the field F_p; G2: with points on an elliptic curve over the field field F_p² (implying the sextic twist is used). Thus, curve points are represented as 2 field elements in the first case and 4 field elements in the second.

BLS12-381 signature verification requires the following top-level components:

nkaskov commented 7 months ago

Part of this issue: https://github.com/NilFoundation/zkLLVM/issues/333