Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BLS12-381 logic handling #288

Open
nkaskov opened this issue Oct 9, 2023 · 2 comments
Open

Add BLS12-381 logic handling #288

nkaskov opened this issue Oct 9, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@nkaskov
Copy link
Contributor

nkaskov commented Oct 9, 2023

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: #288

@nkaskov nkaskov added the enhancement New feature or request label Oct 9, 2023
@ayashunsky
Copy link

ayashunsky commented Oct 27, 2023

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:

  • hash_to_point
    input: message = bls_field_array[n]. Apparently we should take n = ceil((message length in bytes)/47).
    output: group element (bls_field_array[2] or bls_field_array[4], depending on the group).

  • pairing
    input: element of G1 (bls_field_element[2]) and element of G2 (bls_field_element[4])
    output: bls_field_element[12]
    NB: it is posible to design an optimized component "pairing_check" with
    input: first element of G1 (bls_field_element[2]), first element of G2 (bls_field_element[4])
    second element of G1 (bls_field_element[2]), second element of G2 (bls_field_element[4])
    output: boolean

  • is_in_group
    input: candidate elliptic curve point (bls_field_array[2] or bls_field_array[4], depending on the group)
    output: boolean

@nkaskov
Copy link
Contributor Author

nkaskov commented Nov 15, 2023

Part of this issue: #333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Coming up
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants