Skip to content

Class: BLSSecretKey

The secret part of the BLS keypair. This is specified in the config file, and is used by Validators to vote.

Constructors

new BLSSecretKey()

new BLSSecretKey(bytes): BLSSecretKey

Creates a new private key from a byte array.

Parameters

bytes: Uint8Array

Returns

BLSSecretKey

Defined in

@nimiq/core/types/wasm/web.d.ts:751

Methods

free()

free(): void

Returns

void

Defined in

@nimiq/core/types/wasm/web.d.ts:735


serialize()

serialize(): Uint8Array

Serializes the private key to a byte array.

Returns

Uint8Array

Defined in

@nimiq/core/types/wasm/web.d.ts:756


toHex()

toHex(): string

Formats the private key into a hex string.

Returns

string

Defined in

@nimiq/core/types/wasm/web.d.ts:767


fromHex()

static fromHex(hex): BLSSecretKey

Parses a private key from its hex representation.

Parameters

hex: string

Returns

BLSSecretKey

Defined in

@nimiq/core/types/wasm/web.d.ts:762


generate()

static generate(): BLSSecretKey

Generates a new private key from secure randomness.

Returns

BLSSecretKey

Defined in

@nimiq/core/types/wasm/web.d.ts:740


unserialize()

static unserialize(bytes): BLSSecretKey

Deserializes a private key from a byte array.

Parameters

bytes: Uint8Array

Returns

BLSSecretKey

Defined in

@nimiq/core/types/wasm/web.d.ts:746