# BitcoinJS (bitcoinjs-lib) [![Build Status](https://travis-ci.org/bitcoinjs/bitcoinjs-lib.png?branch=master)](https://travis-ci.org/bitcoinjs/bitcoinjs-lib) [![NPM](https://img.shields.io/npm/v/bitcoinjs-lib.svg)](https://www.npmjs.org/package/bitcoinjs-lib) [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) A javascript Bitcoin library for node.js and browsers. Released under the terms of the [MIT LICENSE](LICENSE). ## 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](https://github.com/bitcoinjs/bitcoinjs-lib/tags). ## Can I trust this code? > Don't trust. Verify. We recommend every user of this library and the [bitcoinjs](https://github.com/bitcoinjs) ecosystem to audit and verify any underlying code for its validity and suitability. Mistakes and bugs happen, but with your help in resolving and reporting [issues](https://github.com/bitcoinjs/bitcoinjs-lib/issues), together we can produce open source software that is: - Easy to audit and verify, - Tested, with test coverage >95%, - Advanced and feature rich, - Standardized, using [standard](http://github.com/standard/standard) and Node `Buffer`'s throughout, and - Friendly, with a strong and helpful community, ready to answer questions. ## Installation ``` bash npm install bitcoinjs-lib ``` Typically we support the [Node Maintenance LTS version](https://github.com/nodejs/Release). If in doubt, see the [.travis.yml](.travis.yml) for what versions are used by our continuous integration tests. **WARNING**: We presently don't provide any tooling to verify that the release on `npm` matches GitHub. As such, you should verify anything downloaded by `npm` against your own verified copy. ## Setup ### Node.js ``` javascript const 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](https://github.com/substack/node-browserify) is assumed to be installed for these steps. For your project, create an `index.js` file ``` javascript let bitcoin = require('bitcoinjs-lib') // your code here function myFunction () { return bitcoin.ECPair.makeRandom().toWIF() } module.exports = { myFunction } ``` Now, to compile for the browser: ``` bash browserify index.js --standalone foo > app.js ``` You can now put `