Skip to content

Class: BLSKeyPair

A BLS keypair It is used by validators to vote during Tendermint rounds. This is just a wrapper around our internal BLS structs

Constructors

new BLSKeyPair()

new BLSKeyPair(secret_key, public_key): BLSKeyPair

Parameters

secret_key

BLSSecretKey

public_key

BLSPublicKey

Returns

BLSKeyPair

Defined in

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

Properties

publicKey

readonly publicKey: BLSPublicKey

Gets the keypair's public key.

Defined in

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


secretKey

readonly secretKey: BLSSecretKey

Gets the keypair's secret key.

Defined in

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

Methods

free()

free(): void

Returns

void

Defined in

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


serialize()

serialize(): Uint8Array

Serializes to a byte array.

Returns

Uint8Array

Defined in

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


toHex()

toHex(): string

Formats the keypair into a hex string.

Returns

string

Defined in

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


derive()

static derive(private_key): BLSKeyPair

Derives a keypair from an existing private key.

Parameters

private_key

BLSSecretKey

Returns

BLSKeyPair

Defined in

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


deserialize()

static deserialize(bytes): BLSKeyPair

Deserializes a keypair from a byte array.

Parameters

bytes

Uint8Array

Returns

BLSKeyPair

Defined in

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


generate()

static generate(): BLSKeyPair

Generates a new keypair from secure randomness.

Returns

BLSKeyPair

Defined in

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