PrivMX DOCS
API Reference/PrivMX Endpoint Web/Crypto

ExtKey

Class representing instance of ExtKey

Methods

fromSeed

Creates ExtKey from given seed.

Params

seed

Uint8Array

the seed used to generate Key

fromSeed(seed)

Returns

Promise<ExtKey> · object

fromBase58

Decodes ExtKey from Base58 format.

Params

base58

string

the ExtKey in Base58

fromBase58(base58)

Returns

Promise<ExtKey> · object

generateRandom

Generates a new ExtKey.

generateRandom()

Returns

Promise<ExtKey> · object

derive

Generates child ExtKey from a current ExtKey using BIP32.

Params

index

number

number from 0 to 2^31-1

derive(index)

Returns

Promise<ExtKey> · object

deriveHardened

Generates hardened child ExtKey from a current ExtKey using BIP32.

Params

index

number

number from 0 to 2^31-1

deriveHardened(index)

Returns

Promise<ExtKey> · object

getPrivatePartAsBase58

Converts ExtKey to Base58 string.

getPrivatePartAsBase58()

Returns

Promise<string> · ExtKey in Base58 format

getPublicPartAsBase58

Converts the public part of ExtKey to Base58 string.

getPublicPartAsBase58()

Returns

Promise<string> · ExtKey in Base58 format

getPrivateKey

Extracts ECC PrivateKey.

getPrivateKey()

Returns

Promise<string> · ECC key in WIF format

getPublicKey

Extracts ECC PublicKey.

getPublicKey()

Returns

Promise<string> · ECC key in BASE58DER format

getPrivateEncKey

Extracts raw ECC PrivateKey.

getPrivateEncKey()

Returns

Promise<Uint8Array> · ECC PrivateKey

getPublicKeyAsBase58Address

Extracts ECC PublicKey Address.

getPublicKeyAsBase58Address()

Returns

Promise<string> · ECC Address in BASE58 format

getChainCode

Gets the chain code of Extended Key.

getChainCode()

Returns

Promise<Uint8Array> · Raw chain code

verifyCompactSignatureWithHash

Validates a signature of a message.

Params

message

Uint8Array

data used on validation

signature

Uint8Array

signature of data to verify

verifyCompactSignatureWithHash(message, signature)

Returns

Promise<boolean> · message validation result

isPrivate

Checks if ExtKey is Private.

isPrivate()

Returns

Promise<boolean> · true if ExtKey is private

We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.