Client-side Bitcoin JavaScript library for React Native
npm install @parsh/react-native-bitcoinjs-lib


A javascript Bitcoin library for node.js and browsers.
ReactNative-ready fork of the original bitcoinjs package.
Used by over a million wallet users and the backbone for almost all Bitcoin web wallets in production today.
npm i react-native-bitcoinjs-lib --save
bash
npm install bitcoinjs-lib
`Typically we support the Node Maintenance LTS version.
If in doubt, see the .travis.yml for what versions are used by our continuous integration tests.
Create the react native project.
react-native init fooAppInstall rn-nodeify to be able to use Node.js libs.
npm i rn-nodeify -gAdd this postinstall script to install & hack the Node.js libs for the usage in React Native.
"postinstall": "rn-nodeify --install stream,buffer,events,assert --hack"Install & link required dependencies.
npm i react-native-bitcoinjs-lib react-native-randombytes --save && react-native link react-native-randombytesRun the postinstall, it will create a shim.js file which you need to include in your index file (see Usage).
npm run postinstallRun the app
react-native run-android or react-native run-iosUsage
Edit index.android.js and index.ios.js
`javascript
// node.js libs
import './shim' // make sure to use es6 import and not require()
import Bitcoin from 'react-native-bitcoinjs-lib'
[...]
const keypair = Bitcoin.ECPair.makeRandom()
console.log(keypair.getAddress()) // your brand new base58-encoded Bitcoin address
``Run the example app or refer to the original repository for more available examples.
- BitAddress
- Blockchain.info
- Blocktrail
- Dark Wallet
- DecentralBank
- Dogechain Wallet
- EI8HT Wallet
- GreenAddress
- Robocoin
- Skyhook ATM
There are currently no alternatives for React Native.