---
title: "Class: BLSPublicKey"
canonical_url: "https://nimiq.dev/web-client/reference/classes/blspublickey"
---
# Class: BLSPublicKey

[@nimiq/core](../globals) / BLSPublicKey

Defined in: @nimiq/core/types/wasm/web.d.ts:774

The public part of the BLS keypair.
This is specified in the staking contract to verify votes from Validators.

## Constructors

### Constructor

> **new BLSPublicKey**(`bytes`): `BLSPublicKey`

Defined in: @nimiq/core/types/wasm/web.d.ts:792

Creates a new public key from a byte array.

#### Parameters

##### bytes

`Uint8Array`

#### Returns

`BLSPublicKey`

## Methods

### [dispose]()

> **[dispose]**(): `void`

Defined in: @nimiq/core/types/wasm/web.d.ts:776

#### Returns

`void`

---

### free()

> **free**(): `void`

Defined in: @nimiq/core/types/wasm/web.d.ts:775

#### Returns

`void`

---

### serialize()

> **serialize**(): `Uint8Array`

Defined in: @nimiq/core/types/wasm/web.d.ts:796

Serializes the public key to a byte array.

#### Returns

`Uint8Array`

---

### toHex()

> **toHex**(): `string`

Defined in: @nimiq/core/types/wasm/web.d.ts:800

Formats the public key into a hex string.

#### Returns

`string`

---

### derive()

> `static` **derive**(`secret_key`): `BLSPublicKey`

Defined in: @nimiq/core/types/wasm/web.d.ts:780

Derives a public key from an existing private key.

#### Parameters

##### secret_key

[`BLSSecretKey`](BLSSecretKey)

#### Returns

`BLSPublicKey`

---

### deserialize()

> `static` **deserialize**(`bytes`): `BLSPublicKey`

Defined in: @nimiq/core/types/wasm/web.d.ts:784

Deserializes a public key from a byte array.

#### Parameters

##### bytes

`Uint8Array`

#### Returns

`BLSPublicKey`

---

### fromHex()

> `static` **fromHex**(`hex`): `BLSPublicKey`

Defined in: @nimiq/core/types/wasm/web.d.ts:788

Parses a public key from its hex representation.

#### Parameters

##### hex

`string`

#### Returns

`BLSPublicKey`


## Sitemap

See the full [sitemap](https://nimiq.dev/sitemap.md) for all pages.
