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

web.d.ts:753

Methods

free()

free(): void

Returns

void

Defined in

web.d.ts:737


serialize()

serialize(): Uint8Array

Serializes the private key to a byte array.

Returns

Uint8Array

Defined in

web.d.ts:758


toHex()

toHex(): string

Formats the private key into a hex string.

Returns

string

Defined in

web.d.ts:769


fromHex()

static fromHex(hex): BLSSecretKey

Parses a private key from its hex representation.

Parameters

hex: string

Returns

BLSSecretKey

Defined in

web.d.ts:764


generate()

static generate(): BLSSecretKey

Generates a new private key from secure randomness.

Returns

BLSSecretKey

Defined in

web.d.ts:742


unserialize()

static unserialize(bytes): BLSSecretKey

Deserializes a private key from a byte array.

Parameters

bytes: Uint8Array

Returns

BLSSecretKey

Defined in

web.d.ts:748