# BlsPoint.fromHex

Converts [`Hex.Hex`](/api/Hex/types#hex) to a BLS point.

## Imports

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

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

## Examples

### Hex to Public Key

```ts twoslash
// @noErrors
import { BlsPoint } from 'ox'

const publicKey = BlsPoint.fromHex(
  '0xacafff52270773ad1728df2807c0f1b0b271fa6b37dfb8b2f75448573c76c81bcd6790328a60e40ef5a13343b32d9e66',
  'G1'
)
// @log: {
// @log:   x: '0x00...ac',
// @log:   y: '0x00...af',
// @log:   z: '0x00...01',
// @log: }
```

### Hex to Signature

```ts twoslash
// @noErrors
import { BlsPoint } from 'ox'

const signature = BlsPoint.fromHex(
  '0xb4698f7611999fba87033b9cf72312c76c683bbc48175e2d4cb275907d6a267ab9840a66e3051e5ed36fd13aa712f9a9024f9fa9b67f716dfb74ae4efb7d9f1b7b43b4679abed6644cf476c12e79f309351ea8452487cd93f66e29e04ebe427c',
  'G2'
)
// @log: {
// @log:   x: { c0: '0x00...11', c1: '0x00...22' },
// @log:   y: { c0: '0x00...33', c1: '0x00...44' },
// @log:   z: { c0: '0x00...01', c1: '0x00...00' },
// @log: }
```

## Definition

```ts
function fromHex<group>(
  hex: Hex.Hex,
  group: group,
): group extends 'G1' ? G1 : G2
```

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

## Parameters

### hex

* **Type:** `Hex.Hex`

### group

* **Type:** `group`

## Return Type

The BLS point.

`group extends 'G1' ? G1 : G2`
