A pure and powerful JavaScript library for the Zero (ZER) chain. bitcore-lib-zero
is the lowest layer of the Zero Insight stack: it provides addresses, transactions,
scripts, and serialization primitives that bitcore-node-zero and insight-api-zero
build on. It is a fork of BitPay's bitcore-lib, retargeted to Zero's parameters.
Source-of-record copy. This README is the corrected version staged under
error/bitcore-lib-zero/in the Insight docs repo: dead upstream links pruned and the generic-Bitcoin framing replaced with the actual Zero usage.
Lineage: this is the Zero rename-fork of the Zcash Insight stack (str4d/insight-api-zcash, str4d/insight-ui-zcash), itself derived from BitPay's bitcore-node and bitcore-lib.
npm install zerocurrencycoin/bitcore-lib-zerobower install zerocurrencycoin/bitcore-lib-zeroThis library is normally pulled in transitively when you install
bitcore-node-zero; install it directly only when developing against the
primitives.
The upstream BitPay bitcore documentation and API reference still describe the shared API surface. Zero-specific differences (network magic, address version bytes, the Sapling/ shielded transaction fields) live in this fork's source, not in the upstream docs.
The upstream example set applies to the transparent-address API:
- Generate a random address
- Generate an address from a SHA256 hash
- Import an address via WIF
- Create a Transaction
- Sign a message
- Verify a message
- Create an OP_RETURN transaction
- Create a 2-of-3 multisig P2SH address
- Spend from a 2-of-2 multisig P2SH address
Use common sense when handling anything related to finances; this code carries no warranty. If you find a security issue in the Zero fork, report it to the zerocurrencycoin maintainers via the repository issue tracker.
To build a full browser bundle:
gulp browserThis generates bitcore-lib.js and bitcore-lib.min.js.
git clone https://github.com/zerocurrencycoin/bitcore-lib-zero
cd bitcore-lib-zero
npm installRun all the tests:
gulp testYou can also run just the Node.js tests with gulp test:node, just the browser
tests with gulp test:browser, or a coverage report (open
coverage/lcov-report/index.html) with gulp coverage.
Built and tested under Node.js v8.17.0, matching the rest of the Zero Insight stack. The dependency tree is frozen circa 2021; newer Node is not supported.
Code released under the MIT license.
Copyright 2013-2015 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.