Skip to content

Update BLS signature module #1565

@hwwhww

Description

@hwwhww

What is wrong?

Update it with the latest spec.

How can it be fixed

Currently, the module is here: https://github.com/ethereum/py-evm/blob/master/eth/utils/bls.py

  1. Replace BN128 with BLS-12-381 curve.
  2. Implement and BLSVerify and BLSMultiVerify from spec. Pseudocode:
    def multi_verify(pubs, msgs, sig):
        len_msgs = len(msgs)
        assert len(pubs) == len_msgs
        o = FQ12(1)
        for m in set(msgs):
            group_pub = G1.zero()
            for i in range(len_msgs):
                if msgs[i] == m:
                    group_pub = add(group_pub, pubs[i])
            o *= pairing(group_pub, m, final_exponentiate=False)
        o *= pairing(neg(G1), sig, final_exponentiate=False)
        return o ** ((field_modulus ** 12 - 1) // curve_order) == 1
  3. Plus aggregate_sigs, pseudocode:
    def aggregate_sigs(sigs):
        o = FQ12(1)
        for s in sigs:
            o *= s
        return o
  4. Replace the current blake hashing function with keccak-256.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions