@aeternity/bip39

中文文档
0.1.0发布于 2018/09/25ISCCommonJS近 30 天下载 3411

Bitcoin BIP39: Mnemonic code for generating deterministic keys

此软件包已被标记为弃用

This package is no longer maintained. Migrate to @scure/bip39

原始使用文档

BIP39

Build Status NPM

js-standard-style

JavaScript implementation of Bitcoin BIP39: Mnemonic code for generating deterministic keys

Reminder for developers

Please remember to allow recovery from mnemonic phrases that have invalid checksums (or that you don't have the wordlist)

When a checksum is invalid, warn the user that the phrase is not something generated by your app, and ask if they would like to use it anyway. This way, your app only needs to hold the wordlists for your supported languages, but you can recover phrases made by other apps in other languages.

However, there should be other checks in place, such as checking to make sure the user is inputting 12 words or more separated by a space. ie. phrase.trim().split(/\s+/g).length >= 12

Examples

// Generate a random mnemonic (uses crypto.randomBytes under the hood), defaults to 128-bits of entropy
var mnemonic = bip39.generateMnemonic()
// => 'seed sock milk update focus rotate barely fade car face mechanic mercy'

bip39.mnemonicToSeedHex('basket actual')
// => '5cf2d4a8b0355e90295bdfc565a022a409af063d5365bb57bf74d9528f494bfa4400f53d8349b80fdae44082d7f9541e1dba2b003bcfec9d0d53781ca676651f'

bip39.mnemonicToSeed('basket actual')
// => <Buffer 5c f2 d4 a8 b0 35 5e 90 29 5b df c5 65 a0 22 a4 09 af 06 3d 53 65 bb 57 bf 74 d9 52 8f 49 4b fa 44 00 f5 3d 83 49 b8 0f da e4 40 82 d7 f9 54 1e 1d ba 2b ...>

bip39.validateMnemonic(mnemonic)
// => true

bip39.validateMnemonic('basket actual')
// => false
var bip39 = require('bip39')

// defaults to BIP39 English word list
// uses HEX strings for entropy
var mnemonic = bip39.entropyToMnemonic('00000000000000000000000000000000')
// => abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about

// reversible
bip39.mnemonicToEntropy(mnemonic)
// => '00000000000000000000000000000000'

版本与发布记录

@aeternity/bip39 共发布 1 个版本,首次发布于 2018/09/25;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.0latest2018/09/258 年前

关于 @aeternity/bip39 的常见问题

@aeternity/bip39 是什么?

Bitcoin BIP39: Mnemonic code for generating deterministic keys注意:该包已被作者标记为弃用——This package is no longer maintained. Migrate to @scure/bip39

如何安装 @aeternity/bip39?

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

@aeternity/bip39 支持 TypeScript 吗?

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

@aeternity/bip39 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@aeternity/bip39 可以商用吗?

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

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

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

@aeternity/bip39 还在维护吗?

最新版本 0.1.0 发布于 2018/09/25(8 年前);至今共发布 1 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/09/25。作者已将其标记为弃用,新项目建议寻找替代方案。