btcutil-js - v0.2.0
    Preparing search index...

    Variable hdkeychainConst

    hdkeychain: {
        address(key: string, network?: Network): Promise<string>;
        derive(key: string, index: number): Promise<string>;
        deriveHardened(key: string, index: number): Promise<string>;
        derivePath(key: string, path: string): Promise<string>;
        fromString(key: string): Promise<ExtendedKeyInfo>;
        generateSeed(length?: number): Promise<Uint8Array<ArrayBufferLike>>;
        neuter(key: string): Promise<string>;
        newMaster(seed: Bytes, network?: Network): Promise<string>;
        publicKey(key: string): Promise<Uint8Array<ArrayBufferLike>>;
    } = ...

    BIP-32 hierarchical deterministic key derivation.

    Type Declaration

    • address: function
      • Get the P2PKH address for an extended key. Calls Go: hdkeychain.ExtendedKey.Address() from btcutil/hdkeychain.

        Parameters

        • key: string
        • network: Network = 'mainnet'

        Returns Promise<string>

    • derive: function
      • Derive a child key at the given index. Use index >= 0x80000000 for hardened. Calls Go: hdkeychain.ExtendedKey.Derive() from btcutil/hdkeychain.

        Parameters

        • key: string
        • index: number

        Returns Promise<string>

    • deriveHardened: function
      • Derive a hardened child key (adds 0x80000000 to the index automatically). Calls Go: hdkeychain.ExtendedKey.Derive() with HardenedKeyStart from btcutil/hdkeychain.

        Parameters

        • key: string
        • index: number

        Returns Promise<string>

    • derivePath: function
      • Derive along a BIP-32 path like "m/44'/0'/0'/0/0". Supports both ' and h as hardened suffixes. Calls Go: hdkeychain.ExtendedKey.Derive() iteratively from btcutil/hdkeychain.

        Parameters

        • key: string
        • path: string

        Returns Promise<string>

    • fromString: function
      • Parse an extended key string (xprv/xpub/tprv/tpub) and return info. Calls Go: hdkeychain.NewKeyFromString() from btcutil/hdkeychain.

        Parameters

        • key: string

        Returns Promise<ExtendedKeyInfo>

    • generateSeed: function
      • Generate a random seed of the given length in bytes (default: 32). Calls Go: hdkeychain.GenerateSeed() from btcutil/hdkeychain.

        Parameters

        • Optionallength: number

        Returns Promise<Uint8Array<ArrayBufferLike>>

    • neuter: function
      • Convert a private extended key to its public counterpart. Calls Go: hdkeychain.ExtendedKey.Neuter() from btcutil/hdkeychain.

        Parameters

        • key: string

        Returns Promise<string>

    • newMaster: function
      • Create a master extended key from a seed (hex). Calls Go: hdkeychain.NewMaster() from btcutil/hdkeychain.

        Parameters

        Returns Promise<string>

    • publicKey: function
      • Get the compressed public key (hex) for an extended key. Calls Go: hdkeychain.ExtendedKey.ECPubKey() from btcutil/hdkeychain.

        Parameters

        • key: string

        Returns Promise<Uint8Array<ArrayBufferLike>>