@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
| Name | Type |
|---|---|
k | Uint8Array |
chainCode | Uint8Array |
Returns
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
| Name | Type |
|---|---|
path | string |
Returns
Defined in
packages/core/dist/hd-pubkey.d.ts:31
deriveChild
▸ deriveChild(idx): HDPubKey
Derives new HDPubKey from the given index integer.
Parameters
| Name | Type |
|---|---|
idx | number |
Returns
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
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
| Name | Type |
|---|---|
bytes | Uint8Array |
Returns
Defined in
packages/core/dist/hd-pubkey.d.ts:17
fromHex
▸ fromHex(str): HDPubKey
Returns a HDPubKey from the given hex-encoded string.
Parameters
| Name | Type |
|---|---|
str | string |
Returns
Defined in
packages/core/dist/hd-pubkey.d.ts:21
fromString
▸ fromString(str): HDPubKey
Returns a HDPubKey from the given bech32m-encoded string.
Parameters
| Name | Type |
|---|---|
str | string |
Returns
Defined in
packages/core/dist/hd-pubkey.d.ts:25