@exodus/bitcoinjs-lib-zcash

中文文档
0.1.0发布于 2026/11/13MITES Module近 30 天下载 2.2万

Client-side Zcash JavaScript library

原始使用文档
文档目录15 节
  1. Features
  2. Should I use this in production?
  3. Installation
  4. Setup
  5. Node.js
  6. Browser
  7. Typescript or VSCode users
  8. Flow
  9. Examples
  10. Projects utilizing BitcoinJS
  11. Contributing
  12. Running the test suite
  13. Complementing Libraries
  14. Alternatives
  15. LICENSE MIT

BitcoinJS Zcash (@exodus/bitcoinjs-lib-zcash)

JavaScript Style Guide

BitcoinJS, forked to support Zcash. Does not support z-addresses, only t-addresses.

All-new test suite; not nearly as exhaustive as bitcoinjs-lib's suite. May be bugs in parts of code not used by Exodus or the tests.

Original bitcoinjs-lib README below:


The pure JavaScript Bitcoin library for node.js and browsers. Estimated to be in use by over 15 million wallet users and is the backbone for almost all Bitcoin web wallets in production today.

Features

  • Clean: Pure JavaScript, concise code, easy to read.
  • Tested: Coverage > 90%, third-party integration tests.
  • Careful: Two person approval process for small, focused pull requests.
  • Compatible: Works on Node.js and all modern browsers.
  • Powerful: Support for advanced features, such as multi-sig, HD Wallets.
  • Secure: Strong random number generation, PGP signed releases, trusted developers.
  • Principled: No support for browsers with crap RNG (IE < 11)
  • Standardized: Node community coding style, Browserify, Node's stdlib and Buffers.
  • Fast: Optimized code, uses typed arrays instead of byte arrays for performance.
  • Experiment-friendly: Bitcoin Mainnet and Testnet support.
  • Altcoin-ready: Capable of working with bitcoin-derived cryptocurrencies (such as Dogecoin).

Should I use this in production?

If you are thinking of using the master branch of this library in production, stop. Master is not stable; it is our development branch, and only tagged releases may be classified as stable.

Installation

npm install bitcoinjs-lib

Setup

Node.js

var bitcoin = require('bitcoinjs-lib')

Browser

If you're familiar with how to use browserify, ignore this and proceed normally. These steps are advisory only, and may not be suitable for your application.

Browserify is assumed to be installed for these steps.

For your project, create an index.js file

let bitcoin = require('bitcoinjs-lib')

// your code here
function myFunction() {
  return bitcoin.ECPair.makeRandom().toWIF()
}

module.exports = {
  myFunction,
}

Now, to compile for the browser:

browserify index.js --standalone foo > app.js

You can now put <script src="app.js" /> in your web page, using foo.myFunction to create a new Bitcoin private key.

NOTE: If you uglify the javascript, you must exclude the following variable names from being mangled: BigInteger, ECPair, Point. This is because of the function-name-duck-typing used in typeforce.

Example:

uglifyjs ... --mangle reserved=['BigInteger','ECPair','Point']

NOTE: This library tracks Node LTS features, if you need strict ES5, use --transform babelify in conjunction with your browserify step (using an es2015 preset).

NOTE: If you expect this library to run on an iOS 10 device, ensure that you are using [email protected] or greater.

Typescript or VSCode users

Type declarations for Typescript are available for version ^3.0.0 of the library.

npm install @types/bitcoinjs-lib

You can now use bitcoinjs-lib as a typescript compliant library.

import { HDNode, Transaction } from 'bitcoinjs-lib'

For VSCode (and other editors), users are advised to install the type declarations, as Intellisense uses that information to help you code (autocompletion, static analysis).

Report any typescript related bugs at @dlebrecht DefinitelyTyped fork, submit PRs to DefinitelyTyped

Flow

Definitions for Flow typechecker are available in flow-typed repository.

You can either download them directly from the repo, or with the flow-typed CLI

# npm install -g flow-typed
$ flow-typed install -f 0.27 [email protected] # 0.27 for flow version, 2.2.0 for bitcoinjs-lib version

The definitions are complete and up to date with version 2.2.0. The definitions are maintained by @runn1ng.

Examples

The below examples are implemented as integration tests, they should be very easy to understand. Otherwise, pull requests are appreciated. Some examples interact (via HTTPS) with a 3rd Party Blockchain Provider (3PBP).

If you have a use case that you feel could be listed here, please ask for it!

Projects utilizing BitcoinJS

Contributing

We are always accepting of pull requests, but we do adhere to specific standards in regards to coding style, test driven development and commit messages.

Please make your best effort to adhere to these when contributing to save on trivial corrections.

Running the test suite

npm test
npm run-script coverage

Complementing Libraries

  • BIP21 - A BIP21 compatible URL encoding library
  • BIP38 - Passphrase-protected private keys
  • BIP39 - Mnemonic generation for deterministic keys
  • BIP32-Utils - A set of utilities for working with BIP32
  • BIP66 - Strict DER signature decoding
  • BIP68 - Relative lock-time encoding library
  • BIP69 - Lexicographical Indexing of Transaction Inputs and Outputs
  • Base58 - Base58 encoding/decoding
  • Base58 Check - Base58 check encoding/decoding
  • Bech32 - A BIP173 compliant Bech32 encoding library
  • coinselect - A fee-optimizing, transaction input selection module for bitcoinjs-lib.
  • merkle-lib - A performance conscious library for merkle root and tree calculations.
  • minimaldata - A module to check bitcoin policy: SCRIPT_VERIFY_MINIMALDATA

Alternatives

LICENSE MIT

版本与发布记录

@exodus/bitcoinjs-lib-zcash 共发布 26 个版本,首次发布于 2018/09/28;过去 12 个月发布了 9 个版本。

版本发布日期距今
0.1.0latest2026/11/131 天前
0.0.232026/11/067 天前
0.0.222026/08/043 个月前
0.0.212026/07/303 个月前
0.0.202026/07/163 个月前
0.0.192026/06/045 个月前

关于 @exodus/bitcoinjs-lib-zcash 的常见问题

@exodus/bitcoinjs-lib-zcash 是什么?

Client-side Zcash JavaScript library

如何安装 @exodus/bitcoinjs-lib-zcash?

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

@exodus/bitcoinjs-lib-zcash 支持 TypeScript 吗?

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

@exodus/bitcoinjs-lib-zcash 支持 ESM 还是 CommonJS?

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

@exodus/bitcoinjs-lib-zcash 可以商用吗?

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

@exodus/bitcoinjs-lib-zcash 的下载量有多少?

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

@exodus/bitcoinjs-lib-zcash 还在维护吗?

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