1 | # Bitcore Lib
|
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 Bitcoin library.**
|
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.
|
12 |
|
13 | ## Get Started
|
14 |
|
15 | ```sh
|
16 | npm install bitcore-lib
|
17 | ```
|
18 |
|
19 | ```sh
|
20 | bower install bitcore-lib
|
21 | ```
|
22 |
|
23 | ## Documentation
|
24 |
|
25 | The complete docs are hosted here: [bitcore documentation](https://github.com/bitpay/bitcore). There's also a [bitcore API reference](https://github.com/bitpay/bitcore/blob/master/packages/bitcore-node/docs/api-documentation.md) available generated from the JSDocs of the project, where you'll find low-level details on each bitcore utility.
|
26 |
|
27 | ## Examples
|
28 |
|
29 | - [Generate a random address](docs/examples.md#generate-a-random-address)
|
30 | - [Generate a address from a SHA256 hash](docs/examples.md#generate-a-address-from-a-sha256-hash)
|
31 | - [Import an address via WIF](docs/examples.md#import-an-address-via-wif)
|
32 | - [Create a Transaction](docs/examples.md#create-a-transaction)
|
33 | - [Sign a Bitcoin message](docs/examples.md#sign-a-bitcoin-message)
|
34 | - [Verify a Bitcoin message](docs/examples.md#verify-a-bitcoin-message)
|
35 | - [Create an OP RETURN transaction](docs/examples.md#create-an-op-return-transaction)
|
36 | - [Create a 2-of-3 multisig P2SH address](docs/examples.md#create-a-2-of-3-multisig-p2sh-address)
|
37 | - [Spend from a 2-of-2 multisig P2SH address](docs/examples.md#spend-from-a-2-of-2-multisig-p2sh-address)
|
38 |
|
39 | ## Building the Browser Bundle
|
40 |
|
41 | To build a bitcore-lib full bundle for the browser:
|
42 |
|
43 | ```sh
|
44 | gulp browser
|
45 | ```
|
46 |
|
47 | This will generate files named `bitcore-lib.js` and `bitcore-lib.min.js`.
|
48 |
|
49 | You can also use our pre-generated files, provided for each release along with a PGP signature by one of the project's maintainers. To get them, checkout the [releases](https://github.com/bitpay/bitcore/blob/master/packages/bitcore-lib/CHANGELOG.md).
|
50 |
|
51 | ## Development & Tests
|
52 |
|
53 | ```sh
|
54 | git clone https://github.com/bitpay/bitcore-lib
|
55 | cd bitcore-lib
|
56 | npm install
|
57 | ```
|
58 |
|
59 | Run all the tests:
|
60 |
|
61 | ```sh
|
62 | gulp test
|
63 | ```
|
64 |
|
65 | 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`.
|
66 |
|
67 | ## Security
|
68 |
|
69 | We're using Bitcore 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.
|
70 |
|
71 | If you find a security issue, please email security@bitpay.com.
|
72 |
|
73 | ## Contributing
|
74 |
|
75 | See [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/Contributing.md) on the main bitcore repo for information about how to contribute.
|
76 |
|
77 | ## License
|
78 |
|
79 | Code released under [the MIT license](https://github.com/bitpay/bitcore/blob/master/LICENSE).
|
80 |
|
81 | Copyright 2013-2019 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.
|