@exodus/bip39

中文文档
1.1.1发布于 2026/10/10MITES Module近 30 天下载 4.5万

Exodus BIP39 module

原始使用文档
文档目录10 节
  1. Installation
  2. Entropy Sizes
  3. API Reference
  4. generateMnemonic({ bitsize, wordlist = english })
  5. mnemonicToSeed({ mnemonic, password, validate, wordlist, fo…
  6. mnemonicToEntropy({ mnemonic, wordlist, format })
  7. entropyToMnemonic({ entropy, wordlist })
  8. mnemonicIsInvalid({ mnemonic, wordlist })
  9. wordlistHasWord({ word, wordlist })
  10. Wordlists

@exodus/bip39

JavaScript 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

Installation

npm install @exodus/bip39

Entropy Sizes

  • 128 bits → 12 words
  • 160 bits → 15 words
  • 192 bits → 18 words
  • 224 bits → 21 words
  • 256 bits → 24 words

API Reference

generateMnemonic({ bitsize, wordlist = english })

Generate a random mnemonic with a given bitsize.

Parameters:

  • bitsize (number): Entropy size in bits. Must be one of: 128, 160, 192, 224, or 256
  • wordlist (array, optional): Word list to use. Defaults to English wordlist

Returns: Promise - The generated mnemonic phrase

mnemonicToSeed({ mnemonic, password, validate, wordlist, format })

Convert a mnemonic to a seed for key derivation.

Parameters:

  • mnemonic (string): The mnemonic phrase
  • password (string, optional): Optional passphrase. Defaults to empty string
  • validate (boolean, optional): Whether to validate the mnemonic. Defaults to true
  • wordlist (array, optional): Word list for validation. Defaults to English wordlist
  • format (string, optional): Output format - 'uint8', 'buffer', or 'hex'. Defaults to 'uint8'

Returns: Promise<Uint8Array|Buffer|string> - The seed in the specified format

mnemonicToEntropy({ mnemonic, wordlist, format })

Convert a mnemonic back to its original entropy.

Parameters:

  • mnemonic (string): The mnemonic phrase
  • wordlist (array, optional): Word list to use. Defaults to English wordlist
  • format (string, optional): Output format - 'uint8', 'buffer', 'hex', or 'null'. Defaults to 'uint8'

Returns: Promise<Uint8Array|Buffer|string|null> - The entropy in the specified format

entropyToMnemonic({ entropy, wordlist })

Convert entropy to a mnemonic phrase.

Parameters:

  • entropy (Uint8Array): The entropy bytes. Must be 16, 20, 24, 28, or 32 bytes
  • wordlist (array, optional): Word list to use. Defaults to English wordlist

Returns: Promise - The mnemonic phrase

mnemonicIsInvalid({ mnemonic, wordlist })

[!WARNING] Read carefully! This returns true if the mnemonic is invalid

Parameters:

  • mnemonic (string): The mnemonic phrase to validate
  • wordlist (array, optional): Word list to use. Defaults to English wordlist

Returns: Promise - true if invalid, false if valid

wordlistHasWord({ word, wordlist })

Check if a word exists in a wordlist.

Parameters:

  • word (string): The word to check
  • wordlist (array, optional): Word list to check. Defaults to English wordlist

Returns: boolean - true if word exists in wordlist

Wordlists

The library comes with an English wordlist by default. For other languages, you'll need to provide them yourself.

版本与发布记录

@exodus/bip39 共发布 6 个版本,首次发布于 2025/06/05;过去 12 个月发布了 3 个版本。

版本发布日期距今
1.1.1latest2026/10/101 个月前
1.1.02026/01/279 个月前
1.0.42025/12/0511 个月前
1.0.32025/06/131.4 年前
1.0.22025/06/061.4 年前
1.0.12025/06/051.4 年前

关于 @exodus/bip39 的常见问题

@exodus/bip39 是什么?

Exodus BIP39 module

如何安装 @exodus/bip39?

在项目目录运行 npm install @exodus/bip39,或使用 pnpm add / yarn add / bun add。

@exodus/bip39 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/exodus__bip39 是否存在。

@exodus/bip39 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@exodus/bip39 可以商用吗?

@exodus/bip39 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@exodus/bip39 的下载量有多少?

根据 npm 官方下载统计,@exodus/bip39 在 2026/10/14 – 2026/11/12 这 30 天内被下载 44,620 次,日均约 1,487 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@exodus/bip39 还在维护吗?

最新版本 1.1.1 发布于 2026/10/10(1 个月前);至今共发布 6 个版本,其中过去 12 个月发布了 3 个;首次发布于 2025/06/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。