{"name":"@scure/bip39","version":"1.5.3","keywords":["bip39","mnemonic","phrase","code","bip0039","bip-39","wordlist","scure","noble"],"author":{"url":"https://paulmillr.com","name":"Paul Miller"},"license":"MIT","_id":"@scure/bip39@1.5.3","contributors":[{"name":"Patricio Palladino","email":"patricio@nomiclabs.io"},{"url":"https://paulmillr.com","name":"Paul Miller"}],"homepage":"https://paulmillr.com/","bugs":{"url":"https://github.com/paulmillr/scure-bip39/issues"},"dist":{"shasum":"b47ec6d2e60030212ce04ff7074f06ac59cbee53","tarball":"http://registry-npm.ywwl.com/@scure/bip39/download/@scure/bip39-1.5.3.tgz","fileCount":49,"integrity":"sha512-wnotIoLL/spR8pdMO/JKnckpPxYPXzTXQX/pF4UM9w6SoJWHByH74Mg5DrA4nRSpuwtoAjM1vbRhptvH919KFg==","signatures":[{"sig":"MEYCIQC/dlOe46nX3yZvynvFlDqWNHA72ltzvoo01aG6k3tTQAIhAMJ+kNsa0YLkuQ+xNR/PNHgddG85SC2mUZdoQor5YXjE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@scure%2fbip39@1.5.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":382767,"size":94041,"noattachment":false,"key":"/@scure/bip39/-/@scure/bip39-1.5.3.tgz"},"main":"index.js","types":"./index.d.ts","exports":{".":{"import":"./esm/index.js","require":"./index.js"},"./index":{"import":"./esm/index.js","require":"./index.js"},"./wordlists/czech":{"import":"./esm/wordlists/czech.js","require":"./wordlists/czech.js"},"./wordlists/french":{"import":"./esm/wordlists/french.js","require":"./wordlists/french.js"},"./wordlists/korean":{"import":"./esm/wordlists/korean.js","require":"./wordlists/korean.js"},"./wordlists/english":{"import":"./esm/wordlists/english.js","require":"./wordlists/english.js"},"./wordlists/italian":{"import":"./esm/wordlists/italian.js","require":"./wordlists/italian.js"},"./wordlists/spanish":{"import":"./esm/wordlists/spanish.js","require":"./wordlists/spanish.js"},"./wordlists/japanese":{"import":"./esm/wordlists/japanese.js","require":"./wordlists/japanese.js"},"./wordlists/portuguese":{"import":"./esm/wordlists/portuguese.js","require":"./wordlists/portuguese.js"},"./wordlists/simplified-chinese":{"import":"./esm/wordlists/simplified-chinese.js","require":"./wordlists/simplified-chinese.js"},"./wordlists/traditional-chinese":{"import":"./esm/wordlists/traditional-chinese.js","require":"./wordlists/traditional-chinese.js"}},"funding":"https://paulmillr.com/funding/","gitHead":"01521a176855a9b0bf316261f2b5f63878e0e110","scripts":{"lint":"prettier --check 'src/**/*.ts' 'test/*.test.ts' 'scripts/*.js'","test":"node test/index.js","build":"tsc && tsc -p tsconfig.cjs.json","format":"prettier --write 'src/**/*.ts' 'test/*.test.ts' 'scripts/*.js'","test:bun":"bun test/index.js","test:deno":"deno --allow-env --allow-read test/index.js","build:release":"npx jsbt esbuild test/build","fetch-wordlist":"./scripts/fetch-wordlist.js"},"_npmUser":{"name":"paulmillr","email":"paul@paulmillr.com"},"repository":{"url":"git+https://github.com/paulmillr/scure-bip39.git","type":"git"},"_npmVersion":"10.9.2","description":"Secure, audited & minimal implementation of BIP39 mnemonic phrases","directories":{},"sideEffects":false,"_nodeVersion":"22.13.0","dependencies":{"@scure/base":"~1.2.3","@noble/hashes":"~1.7.1"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.3.2","typescript":"5.5.2","micro-bmark":"0.4.0","micro-should":"0.5.1","@paulmillr/jsbt":"0.3.1"},"_npmOperationalInternal":{"tmp":"tmp/bip39_1.5.3_1737195190835_0.8466262434233474","host":"s3://npm-registry-packages-npm-production"},"readme":"# scure-bip39\n\nAudited & minimal JS implementation of [BIP39 mnemonic phrases](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki).\n\n- 🔒 [**Audited**](#security) by an independent security firm\n- 🔻 Tree-shakeable: unused code is excluded from your builds\n- 📦 ESM and common.js\n- ➰ Only 2 audited dependencies by the same author:\n  [noble-hashes](https://github.com/paulmillr/noble-hashes) and [scure-base](https://github.com/paulmillr/scure-base)\n- 🪶 37KB with all deps bundled and 279KB with wordlists: much smaller than similar libraries\n\nCheck out [scure-bip32](https://github.com/paulmillr/scure-bip32) if you need\nhierarchical deterministic wallets (\"HD Wallets\").\n\n### This library belongs to *scure*\n\n> **scure** — audited micro-libraries.\n\n- Zero or minimal dependencies\n- Highly readable TypeScript / JS code\n- PGP-signed releases and transparent NPM builds\n- Check out [homepage](https://paulmillr.com/noble/#scure) & all libraries:\n  [base](https://github.com/paulmillr/scure-base),\n  [bip32](https://github.com/paulmillr/scure-bip32),\n  [bip39](https://github.com/paulmillr/scure-bip39),\n  [btc-signer](https://github.com/paulmillr/scure-btc-signer),\n  [starknet](https://github.com/paulmillr/scure-starknet)\n\n## Usage\n\n> `npm install @scure/bip39`\n\n> `deno add jsr:@scure/bip39`\n\n> `deno doc jsr:@scure/bip39`  # command-line documentation\n\nWe don't provide source maps.\nWordlists are large, including source maps would double package size.\n\n```js\nimport * as bip39 from '@scure/bip39';\nimport { wordlist } from '@scure/bip39/wordlists/english';\n\n// Generate x random words. Uses Cryptographically-Secure Random Number Generator.\nconst mn = bip39.generateMnemonic(wordlist);\nconsole.log(mn);\n\n// Reversible: Converts mnemonic string to raw entropy in form of byte array.\nconst ent = bip39.mnemonicToEntropy(mn, wordlist)\n\n// Reversible: Converts raw entropy in form of byte array to mnemonic string.\nbip39.entropyToMnemonic(ent, wordlist);\n\n// Validates mnemonic for being 12-24 words contained in `wordlist`.\nbip39.validateMnemonic(mn, wordlist);\n\n// Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password.\nawait bip39.mnemonicToSeed(mn, 'password');\nbip39.mnemonicToSeedSync(mn, 'password');\n```\n\nThis submodule contains the word lists defined by BIP39 for Czech, English, French, Italian, Japanese, Korean, Portuguese, Simplified and Traditional Chinese, and Spanish. These are not imported by default, as that would increase bundle sizes too much. Instead, you should import and use them explicitly.\n\n```typescript\nfunction generateMnemonic(wordlist: string[], strength?: number): string;\nfunction mnemonicToEntropy(mnemonic: string, wordlist: string[]): Uint8Array;\nfunction entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): string;\nfunction validateMnemonic(mnemonic: string, wordlist: string[]): boolean;\nfunction mnemonicToSeed(mnemonic: string, passphrase?: string): Promise<Uint8Array>;\nfunction mnemonicToSeedSync(mnemonic: string, passphrase?: string): Uint8Array;\n```\n\nAll wordlists:\n\n```typescript\nimport { wordlist as czech } from '@scure/bip39/wordlists/czech';\nimport { wordlist as english } from '@scure/bip39/wordlists/english';\nimport { wordlist as french } from '@scure/bip39/wordlists/french';\nimport { wordlist as italian } from '@scure/bip39/wordlists/italian';\nimport { wordlist as japanese } from '@scure/bip39/wordlists/japanese';\nimport { wordlist as korean } from '@scure/bip39/wordlists/korean';\nimport { wordlist as portuguese } from '@scure/bip39/wordlists/portuguese';\nimport { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese';\nimport { wordlist as spanish } from '@scure/bip39/wordlists/spanish';\nimport { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese';\n```\n\n## Security\n\nTo audit wordlist content, run `node scripts/fetch-wordlist.js`.\n\nThe library has been independently audited:\n\n- at version 1.0.0, in Jan 2022, by [cure53](https://cure53.de)\n  - PDFs: [online](https://cure53.de/pentest-report_hashing-libs.pdf), [offline](./audit/2022-01-05-cure53-audit-nbl2.pdf)\n  - [Changes since audit](https://github.com/paulmillr/scure-bip39/compare/1.0.0..main).\n  - The audit has been funded by [Ethereum Foundation](https://ethereum.org/en/) with help of [Nomic Labs](https://nomiclabs.io)\n\nThe library was initially developed for [js-ethereum-cryptography](https://github.com/ethereum/js-ethereum-cryptography).\nAt commit [ae00e6d7](https://github.com/ethereum/js-ethereum-cryptography/commit/ae00e6d7d24fb3c76a1c7fe10039f6ecd120b77e),\nit was extracted to a separate package called `micro-bip39`.\nAfter the audit we've decided to use `@scure` NPM namespace for security.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com)\n","publish_time":1737195191038,"maintainers":[{"name":"paulmillr","email":"paul@paulmillr.com"}],"_cnpm_publish_time":1737195191038,"dist-tags":{"beta":"2.0.0-beta.1","latest":"2.4.0"}}