# BlsPoint.toBytes

Converts a BLS point to [`Bytes.Bytes`](/api/Bytes/types#bytes).

## Imports

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

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

## Examples

### Public Key to Bytes

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

const publicKey = Bls.getPublicKey({ privateKey: '0x...' })
const publicKeyBytes = BlsPoint.toBytes(publicKey)
// @log: Uint8Array [172, 175, 255, ...]
```

### Signature to Bytes

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

const signature = Bls.sign({
  payload: '0x...',
  privateKey: '0x...'
})
const signatureBytes = BlsPoint.toBytes(signature)
// @log: Uint8Array [172, 175, 255, ...]
```

## Definition

```ts
function toBytes<point>(
  point: point,
): point extends G1 ? G1Bytes : G2Bytes
```

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

## Parameters

### point

* **Type:** `point`

The BLS point to convert.

## Return Type

The bytes representation of the BLS point.

`point extends G1 ? G1Bytes : G2Bytes`
