Function deriveHdPrivateNodeFromSeed

  • Derive an HdPrivateNode from the provided seed following the BIP32 specification. A seed should include between 16 bytes and 64 bytes of entropy (recommended: 32 bytes).

    Type Parameters

    • AssumeValidity extends undefined | boolean

    • ThrowErrors extends boolean = true

    Parameters

    • seed: Uint8Array

      the entropy from which to derive the HdPrivateNode

    • __namedParameters: {
          assumeValidity?: AssumeValidity;
          crypto?: {
              sha512: {
                  hash: ((input) => Uint8Array) & ((input) => Uint8Array);
              };
          };
          hmacSha512Key?: Uint8Array;
          throwErrors?: ThrowErrors;
      } = {}
      • Optional assumeValidity?: AssumeValidity

        If set, the derived private key will not be checked for validity, and will be assumed valid if true or invalid if false (this is useful for testing).

      • Optional crypto?: {
            sha512: {
                hash: ((input) => Uint8Array) & ((input) => Uint8Array);
            };
        }

        An optional object containing an implementation of sha512.

        • sha512: {
              hash: ((input) => Uint8Array) & ((input) => Uint8Array);
          }
          • hash: ((input) => Uint8Array) & ((input) => Uint8Array)
      • Optional hmacSha512Key?: Uint8Array

        The HMAC SHA-512 key to use (defaults to the HMAC SHA-512 key used by BIP32, utf8ToBin('Bitcoin seed').

      • Optional throwErrors?: ThrowErrors

        If true, invalid key derivations (probability less than 1 in 2^127) will throw an Error rather than returning an HdPrivateNodeInvalid (defaults to true).

    Returns AssumeValidity extends false
        ? ThrowErrors extends false
            ? HdPrivateNode
            : HdPrivateNodeValid
        : HdPrivateNodeValid

Generated using TypeDoc