# Bls.aggregate

Aggregates a set of BLS points that are either on the G1 or G2 curves (ie. public keys or signatures).

## Imports

:::code-group
```ts [Named]
import { Bls } from 'ox'
```

```ts [Entrypoint]
import * as Bls from 'ox/Bls'
```
:::

## Examples

### Aggregating Signatures

```ts twoslash
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

```ts twoslash
import { Bls } from 'ox'

const publicKeys = [
  Bls.getPublicKey({ privateKey: '0x...' }),
  Bls.getPublicKey({ privateKey: '0x...' })
]
const publicKey = Bls.aggregate(publicKeys)
```

## Definition

```ts
function aggregate<points>(
  points: points,
): BlsPoint.BlsPoint
```

**Source:** [src/core/Bls.ts](https://github.com/wevm/ox/blob/main/src/core/Bls.ts#L767)

## Parameters

### points

* **Type:** `points`

The points to aggregate.

## Return Type

The aggregated point.

`points extends readonly BlsPoint.G1[] ? BlsPoint.G1 : BlsPoint.G2`
