BIP39

Namespace

BIP39

Description:
  • BIP39 mnemonic phrase generation and seed derivation

Source:

Methods

(static) deriveSeed(mnemonicPhrase, passphraseopt, optionsopt) → {string}

Description:
  • Derive a seed from a mnemonic phrase

Source:
Parameters:
Name Type Attributes Default Description
mnemonicPhrase string

BIP39 mnemonic

passphrase string <optional>
''

Optional passphrase

options Object <optional>
{}

Derivation options

Throws:

If mnemonic or passphrase is invalid

Type
Error
Returns:

64-byte seed as hex string

Type
string

(static) generateMnemonic(strengthOrOptionsopt) → {Object}

Description:
  • Generate a new BIP39 mnemonic phrase

Source:
Parameters:
Name Type Attributes Default Description
strengthOrOptions number | Object <optional>
128

Entropy bits (128,160,192,224,256) or options object

Properties
Name Type Attributes Default Description
entropy Buffer <optional>

Custom entropy

strength number <optional>
128

Entropy bits

skipEntropyValidation boolean <optional>

Skip quality check

Throws:

If entropy is invalid or generation fails

Type
Error
Returns:

Result with mnemonic, entropyQuality, generationTime

Type
Object

(static) getWordList() → {Array.<string>}

Description:
  • Get the BIP39 English word list

Source:
Returns:

Copy of the 2048-word list

Type
Array.<string>

(static) mnemonicToEntropy(mnemonicPhrase) → {Buffer}

Description:
  • Convert mnemonic back to entropy bytes

Source:
Parameters:
Name Type Description
mnemonicPhrase string

Valid mnemonic phrase

Throws:

If mnemonic checksum is invalid

Type
Error
Returns:

Original entropy bytes

Type
Buffer

(static) validateChecksum(mnemonicPhrase) → {boolean}

Description:
  • Validate a mnemonic phrase checksum

Source:
Parameters:
Name Type Description
mnemonicPhrase string

Mnemonic to validate

Returns:

True if checksum is valid

Type
boolean

(static) validateMnemonic(mnemonicPhrase) → {boolean}

Description:
  • Validate a mnemonic phrase (alias for validateChecksum)

Source:
Parameters:
Name Type Description
mnemonicPhrase string

Mnemonic to validate

Returns:

True if valid

Type
boolean