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.

Table of contents ​

Constructors ​

Methods ​

Constructors ​

constructor ​

• new BLSSecretKey(bytes): BLSSecretKey

Creates a new private key from a byte array.

Parameters ​

NameType
bytesUint8Array

Returns ​

BLSSecretKey

Defined in ​

web.d.ts:733

Methods ​

free ​

▸ free(): void

Returns ​

void

Defined in ​

web.d.ts:717


serialize ​

▸ serialize(): Uint8Array

Serializes the private key to a byte array.

Returns ​

Uint8Array

Defined in ​

web.d.ts:738


toHex ​

▸ toHex(): string

Formats the private key into a hex string.

Returns ​

string

Defined in ​

web.d.ts:749


fromHex ​

▸ fromHex(hex): BLSSecretKey

Parses a private key from its hex representation.

Parameters ​

NameType
hexstring

Returns ​

BLSSecretKey

Defined in ​

web.d.ts:744


generate ​

▸ generate(): BLSSecretKey

Generates a new private key from secure randomness.

Returns ​

BLSSecretKey

Defined in ​

web.d.ts:722


unserialize ​

▸ unserialize(bytes): BLSSecretKey

Deserializes a private key from a byte array.

Parameters ​

NameType
bytesUint8Array

Returns ​

BLSSecretKey

Defined in ​

web.d.ts:728