Function deriveHdPrivateNodeFromBip39Mnemonic

  • Derive an HdPrivateNode from the provided BIP39 mnemonic phrase following the BIP32 and BIP39 specifications.

    Note that by design, BIP39 seed derivation is one-way: seeds derived from a mnemonic phrase cannot be used to recover the source phrase. Additionally, BIP39 seed derivation does not perform any validation on the provided mnemonic phrase, allowing derivation from any string.

    For use cases in which a particular mnemonic phrase is expected to be correctly formed (with a valid checksum), first verify that it can be decoded with decodeBip39Mnemonic.

    Parameters

    • mnemonic: string

      the BIP39 mnemonic phrase

    • __namedParameters: {
          crypto?: {
              pbkdf2HmacSha512: ((parameters, sha512Hmac?) => string | Uint8Array);
              sha512: {
                  hash: ((input) => Uint8Array) & ((input) => Uint8Array);
              };
          };
          hmacSha512Key?: Uint8Array;
          passphrase?: string;
      } = {}
      • Optional crypto?: {
            pbkdf2HmacSha512: ((parameters, sha512Hmac?) => string | Uint8Array);
            sha512: {
                hash: ((input) => Uint8Array) & ((input) => Uint8Array);
            };
        }
        • pbkdf2HmacSha512: ((parameters, sha512Hmac?) => string | Uint8Array)
            • (parameters, sha512Hmac?): string | Uint8Array
            • Derive a key using PBKDF2 and the HMAC SHA512 function as specified in RFC 2898.

              Note, if the provided parameters are valid, this method will never error.

              Parameters

              • parameters: Pbkdf2Parameters

                the PBKDF2 parameters to use

              • sha512Hmac: HmacFunction = hmacSha512

                the SHA512 HMAC implementation to use (defaults to the internal WASM implementation)

              Returns string | Uint8Array

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

    Returns HdPrivateNodeValid

Generated using TypeDoc