Exodus BIP39 module
npm install @exodus/bip39@exodus/bip39JavaScript implementation of Bitcoin BIP39: Mnemonic code for generating deterministic keys
This library prefers native webcrypto, so all methods are async.
Prior art: https://github.com/bitcoinjs/bip39
``bash`
npm install @exodus/bip39
- 128 bits → 12 words
- 160 bits → 15 words
- 192 bits → 18 words
- 224 bits → 21 words
- 256 bits → 24 words
Generate a random mnemonic with a given bitsize.
Parameters:
- bitsize (number): Entropy size in bits. Must be one of: 128, 160, 192, 224, or 256wordlist
- (array, optional): Word list to use. Defaults to English wordlist
Returns: Promise
Convert a mnemonic to a seed for key derivation.
Parameters:
- mnemonic (string): The mnemonic phrasepassword
- (string, optional): Optional passphrase. Defaults to empty stringvalidate
- (boolean, optional): Whether to validate the mnemonic. Defaults to truewordlist
- (array, optional): Word list for validation. Defaults to English wordlistformat
- (string, optional): Output format - 'uint8', 'buffer', or 'hex'. Defaults to 'uint8'
Returns: Promise
Convert a mnemonic back to its original entropy.
Parameters:
- mnemonic (string): The mnemonic phrasewordlist
- (array, optional): Word list to use. Defaults to English wordlistformat
- (string, optional): Output format - 'uint8', 'buffer', 'hex', or 'null'. Defaults to 'uint8'
Returns: Promise
Convert entropy to a mnemonic phrase.
Parameters:
- entropy (Uint8Array): The entropy bytes. Must be 16, 20, 24, 28, or 32 byteswordlist
- (array, optional): Word list to use. Defaults to English wordlist
Returns: Promise
> [!WARNING]
> Read carefully! This returns true if the mnemonic is _invalid_
Parameters:
- mnemonic (string): The mnemonic phrase to validatewordlist
- (array, optional): Word list to use. Defaults to English wordlist
Returns: Promise
Check if a word exists in a wordlist.
Parameters:
- word (string): The word to checkwordlist` (array, optional): Word list to check. Defaults to English wordlist
-
Returns: boolean - true if word exists in wordlist
The library comes with an English wordlist by default. For other languages, you'll need to provide them yourself.