-
Notifications
You must be signed in to change notification settings - Fork 692
Closed
Labels
Milestone
Description
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
- Replace BN128 with BLS-12-381 curve.
- Implement and
BLSVerify
andBLSMultiVerify
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
- Plus
aggregate_sigs
, pseudocode:def aggregate_sigs(sigs): o = FQ12(1) for s in sigs: o *= s return o
- Replace the current blake hashing function with keccak-256.