Skip to content

@aldea/sdk / Exports / HDPubKey

Class: HDPubKey ​

Hierarchical deterministic public key

Implements BIP32-ed25519 with hashing primitives swapped out for BLAKE3.

Table of contents ​

Constructors ​

Properties ​

Methods ​

Constructors ​

constructor ​

• new HDPubKey(k, chainCode): HDPubKey

Parameters ​

NameType
kUint8Array
chainCodeUint8Array

Returns ​

HDPubKey

Defined in ​

packages/core/dist/hd-pubkey.d.ts:11

Properties ​

chainCode ​

• Readonly chainCode: Uint8Array

Defined in ​

packages/core/dist/hd-pubkey.d.ts:10


k ​

• Private k: any

Defined in ​

packages/core/dist/hd-pubkey.d.ts:9

Methods ​

derive ​

▸ derive(path): HDPubKey

Derives a new HDPubKey from the given derivation path.

The derivation path must of the format described in BIP-32.

Parameters ​

NameType
pathstring

Returns ​

HDPubKey

Defined in ​

packages/core/dist/hd-pubkey.d.ts:31


deriveChild ​

▸ deriveChild(idx): HDPubKey

Derives new HDPubKey from the given index integer.

Parameters ​

NameType
idxnumber

Returns ​

HDPubKey

Defined in ​

packages/core/dist/hd-pubkey.d.ts:35


toBytes ​

▸ toBytes(): Uint8Array

Returns the HDPubKey as bytes.

HD Public Keys are 64 bytes.

Returns ​

Uint8Array

Defined in ​

packages/core/dist/hd-pubkey.d.ts:41


toHex ​

▸ toHex(): string

Returns the HDPubKey as hex-encoded string.

Returns ​

string

Defined in ​

packages/core/dist/hd-pubkey.d.ts:45


toPubKey ​

▸ toPubKey(): PubKey

Returns the HDPubKey's normal PubKey.

Returns ​

PubKey

Defined in ​

packages/core/dist/hd-pubkey.d.ts:53


toString ​

▸ toString(): string

Returns the HDPubKey as bech32m-encoded string.

Returns ​

string

Defined in ​

packages/core/dist/hd-pubkey.d.ts:49


fromBytes ​

▸ fromBytes(bytes): HDPubKey

Returns a HDPubKey from the given bytes.

HD Public Keys are 64 bytes.

Parameters ​

NameType
bytesUint8Array

Returns ​

HDPubKey

Defined in ​

packages/core/dist/hd-pubkey.d.ts:17


fromHex ​

▸ fromHex(str): HDPubKey

Returns a HDPubKey from the given hex-encoded string.

Parameters ​

NameType
strstring

Returns ​

HDPubKey

Defined in ​

packages/core/dist/hd-pubkey.d.ts:21


fromString ​

▸ fromString(str): HDPubKey

Returns a HDPubKey from the given bech32m-encoded string.

Parameters ​

NameType
strstring

Returns ​

HDPubKey

Defined in ​

packages/core/dist/hd-pubkey.d.ts:25