Bls.aggregate
Aggregates a set of BLS points that are either on the G1 or G2 curves (ie. public keys or signatures).
Imports
Named
import { Bls } from 'ox'
Examples
Aggregating Signatures
import { Bls, Hex } from 'ox'
const payload = Hex.random(32)
const signatures = [
Bls.sign({ payload, privateKey: '0x...' }),
Bls.sign({ payload, privateKey: '0x...' }),
]
const signature = Bls.aggregate(signatures)
Aggregating Public Keys
import { Bls } from 'ox'
const publicKeys = [
Bls.getPublicKey({ privateKey: '0x...' }),
Bls.getPublicKey({ privateKey: '0x...' }),
]
const publicKey = Bls.aggregate(publicKeys)
Definition
function aggregate<points>(
points: points,
): points extends readonly BlsPoint.G1[] ? BlsPoint.G1 : BlsPoint.G2
Source: src/core/Bls.ts
Parameters
points
- Type:
points
The points to aggregate.
Return Type
The aggregated point.
points extends readonly BlsPoint.G1[] ? BlsPoint.G1 : BlsPoint.G2