import { HDPubKey, PubKey } from './internal.js'; /** * Hierarchical deterministic private key * * Implements [BIP32-ed25519](https://github.com/LedgerHQ/orakolo/blob/master/papers/Ed25519_BIP%20Final.pdf) * with hashing primitives swapped out for BLAKE3. * * To use with BIP39, we recommend using [@scure/bip39](https://github.com/paulmillr/scure-bip39). * * ```ts * import { generateMnemonic, mnemonicToSeedSync } from '@scure/bip39' * import { wordlist } from '@scure/bip39/wordlists/english' * import { HDPrivKey } from '@aldea/core' * * const mnemonic = generateMnemonic(wordlist) * const seed = mnemonicToSeedSync(mnemonic) * const rootKey = HDPrivKey.fromSeed(seed) * const childKey = rootKey.derive('m/1/2/3') * ``` */ export declare class HDPrivKey { private k; readonly chainCode: Uint8Array; constructor(k: Uint8Array, chainCode: Uint8Array); /** * Returns a HDPrivKey from the given bytes. * * HD Private Keys are 96 bytes. */ static fromBytes(bytes: Uint8Array): HDPrivKey; /** * Returns a HDPrivKey from the given hex-encoded string. */ static fromHex(str: string): HDPrivKey; /** * Returns a HDPrivKey from the given bech32m-encoded string. */ static fromString(str: string): HDPrivKey; /** * Generates and returns a new random HDPrivKey. */ static fromRandom(): HDPrivKey; /** * Generates and returns an HDPrivKey from the given seed bytes. */ static fromSeed(seed: Uint8Array): HDPrivKey; /** * Derives a new HD key from the given derivation path. Returns either a * HDPrivKey or HDPubKey. * * The derivation path must of the format described in [BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). * All of the following examples are valid derivation paths: * * ```text * m/1/2/3 - derives HDPrivkey * M/1/2/3 - derives HDPubkey * m/1'/200 - derives hardened HDPrivkey * m/1h/200 - equivalent * m/1H/200 - equivalent * ``` */ derive(path: string): HDPrivKey | HDPubKey; /** * Derives new HDPrivKey from the given index integer. */ deriveChild(idx: number): HDPrivKey; /** * Returns the HDPrivKey as bytes. * * HD Private Keys are 96 bytes. */ toBytes(): Uint8Array; /** * Returns the HDPrivKey as hex-encoded string. */ toHex(): string; /** * Returns the HDPrivKey as bech32m-encoded string. */ toString(): string; /** * Returns the HDPrivKey's corresponding HDPubKey. */ toHDPubKey(): HDPubKey; /** * Returns the HDPrivKey's corresponding normal PubKey. */ toPubKey(): PubKey; private pubkeyBytes; } //# sourceMappingURL=hd-privkey.d.ts.map