1 | # Bitcore JavaScript Library for Bitcoin
|
2 |
|
3 | [![NPM Package](https://img.shields.io/npm/v/bitcore-lib.svg?style=flat-square)](https://www.npmjs.org/package/bitcore-lib)
|
4 | [![Build Status](https://img.shields.io/travis/bitpay/bitcore-lib.svg?branch=master&style=flat-square)](https://travis-ci.org/bitpay/bitcore-lib)
|
5 | [![Coverage Status](https://img.shields.io/coveralls/bitpay/bitcore-lib.svg?style=flat-square)](https://coveralls.io/r/bitpay/bitcore-lib)
|
6 |
|
7 | **A pure and powerful JavaScript library for Bitcoin.**
|
8 |
|
9 | ## Principles
|
10 |
|
11 | Bitcoin is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Bitcoin network allows for highly resilient bitcoin infrastructure, and the developer community needs reliable, open-source tools to implement bitcoin apps and services. Bitcore JavaScript Library provides a reliable API for JavaScript apps that need to interface with Bitcoin.
|
12 |
|
13 | ## Get Started
|
14 |
|
15 | Clone the Bitcore monorepo and `npm install`:
|
16 | ```sh
|
17 | git clone https://github.com/bitpay/bitcore.git
|
18 | npm install
|
19 | ```
|
20 | `cd` into bitcore-lib repository:
|
21 | ```sh
|
22 | cd packages/bitcore-lib
|
23 | ```
|
24 |
|
25 | ## Building the Browser Bundle
|
26 |
|
27 | To build a bitcore-lib full bundle for the browser:
|
28 |
|
29 | ```sh
|
30 | gulp browser
|
31 | ```
|
32 |
|
33 | This will generate files named `bitcore-lib.js` and `bitcore-lib.min.js`.
|
34 |
|
35 | ## Running Tests
|
36 |
|
37 | ```sh
|
38 | npm test
|
39 | ```
|
40 |
|
41 | You can also run just the Node.js tests with `gulp test:node`, just the browser tests with `gulp test:browser` or create a test coverage report (you can open `coverage/lcov-report/index.html` to visualize it) with `gulp coverage`.
|
42 |
|
43 | ## Documentation
|
44 |
|
45 | ### Addresses and Key Management
|
46 |
|
47 | - [Addresses](docs/address.md)
|
48 | - [Using Different Networks](docs/networks.md)
|
49 | - [Private Keys](docs/privatekey.md) and [Public Keys](docs/publickey.md)
|
50 | - [Hierarchically-derived Private and Public Keys](docs/hierarchical.md)
|
51 |
|
52 | ### Payment Handling
|
53 |
|
54 | - [Using Different Units](docs/unit.md)
|
55 | - [Acknowledging and Requesting Payments: Bitcoin URIs](docs/uri.md)
|
56 | - [The Transaction Class](docs/transaction.md)
|
57 | - [Unspent Transaction Output Class](docs/unspentoutput.md)
|
58 |
|
59 | ### Bitcoin Internals
|
60 |
|
61 | - [Scripts](docs/script.md)
|
62 | - [Block](docs/block.md)
|
63 |
|
64 | ### Extra
|
65 |
|
66 | - [Crypto](docs/crypto.md)
|
67 | - [Encoding](docs/encoding.md)
|
68 |
|
69 | ### Module Development
|
70 |
|
71 | - [Browser Builds](docs/browser.md)
|
72 |
|
73 | ### Modules
|
74 |
|
75 | Some functionality is implemented as a module that can be installed separately:
|
76 |
|
77 | - [Peer to Peer Networking](https://github.com/bitpay/bitcore/tree/master/packages/bitcore-p2p)
|
78 | - [Bitcoin Core JSON-RPC](https://github.com/bitpay/bitcoind-rpc)
|
79 | - [Payment Channels](https://github.com/bitpay/bitcore-channel)
|
80 | - [Mnemonics](https://github.com/bitpay/bitcore/tree/master/packages/bitcore-mnemonic)
|
81 | - [Elliptical Curve Integrated Encryption Scheme](https://github.com/bitpay/bitcore-ecies)
|
82 | - [Blockchain Explorers](https://github.com/bitpay/bitcore-explorers)
|
83 | - [Signed Messages](https://github.com/bitpay/bitcore-message)
|
84 |
|
85 | ## Examples
|
86 |
|
87 | - [Generate a random address](docs/examples.md#generate-a-random-address)
|
88 | - [Generate a address from a SHA256 hash](docs/examples.md#generate-a-address-from-a-sha256-hash)
|
89 | - [Import an address via WIF](docs/examples.md#import-an-address-via-wif)
|
90 | - [Create a Transaction](docs/examples.md#create-a-transaction)
|
91 | - [Sign a Bitcoin message](docs/examples.md#sign-a-bitcoin-message)
|
92 | - [Verify a Bitcoin message](docs/examples.md#verify-a-bitcoin-message)
|
93 | - [Create an OP RETURN transaction](docs/examples.md#create-an-op-return-transaction)
|
94 | - [Create a 2-of-3 multisig P2SH address](docs/examples.md#create-a-2-of-3-multisig-p2sh-address)
|
95 | - [Spend from a 2-of-2 multisig P2SH address](docs/examples.md#spend-from-a-2-of-2-multisig-p2sh-address)
|
96 |
|
97 | ## Security
|
98 |
|
99 | We're using the Bitcore JavaScript Library in production, as are many others, but please use common sense when doing anything related to finances! We take no responsibility for your implementation decisions.
|
100 |
|
101 | If you find a security issue, please email security@bitpay.com.
|
102 |
|
103 | ## Contributing
|
104 |
|
105 | See [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/Contributing.md) on the main bitcore repo for information about how to contribute.
|
106 |
|
107 | ## License
|
108 |
|
109 | Code released under [the MIT license](https://github.com/bitpay/bitcore/blob/master/LICENSE).
|
110 |
|
111 | Copyright 2013-2022 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.
|