Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
rn-bitcoinjs-lib
Advanced tools
This is a React Native compatible version of bitcoinjs-lib,a pure JavaScript Bitcoin library for node.js and browsers. Estimated to be in use by over 15 million wallet users and is the backbone for almost all Bitcoin web wallets in production today.
yarn add https://github.com/coreyphillips/react-native-bitcoinjs-lib
Install the following dependencies:
yarn add buffer-reverse react-native-randombytes crypto buffer@5
yarn add --dev rn-nodeify
react-native link react-native-randombytes
Add the following to your script in package.json:
"postinstall": "rn-nodeify --install buffer,stream,assert,events,crypto,vm --hack"
Install any remaining dependencies and run postinstall.
NOTE: (If you receive an error about "shim.js" not existing just run yarn install
again):
yarn install
Add the following to shim.js:
if (typeof Buffer.prototype.reverse === 'undefined') {
var bufferReverse = require('buffer-reverse');
Buffer.prototype.reverse = function () {
return bufferReverse(this);
};
}
Add/Uncomment "require('crypto')" at the bottom of shim.js:
require('crypto')
Usage
import "./shim";
const bitcoin = require("bitcoinjs-lib");
const keyPair = bitcoin.ECPair.makeRandom();
const { address } = bitcoin.payments.p2pkh({ pubkey: keyPair.publicKey });
console.log(address);
RN BitcoinJS-Lib (4.0.1) Setup
Use bitcoinjs-lib
Use bitcoinjs-lib
The below examples are implemented as integration tests, they should be very easy to understand. Otherwise, pull requests are appreciated. Some examples interact (via HTTPS) with a 3rd Party Blockchain Provider (3PBP).
If you have a use case that you feel could be listed here, please ask for it!
We are always accepting of pull requests, but we do adhere to specific standards in regards to coding style, test driven development and commit messages.
Please make your best effort to adhere to these when contributing to save on trivial corrections.
npm test
npm run-script coverage
4.0.1
fixed
tiny-secp256k1
dependency version (used ecurve
) (#1139)TransactionBuilder
throwing when trying to sign P2WSH(P2WPKH)
(#1135)FAQs
Client-side Bitcoin JavaScript library
The npm package rn-bitcoinjs-lib receives a total of 2 weekly downloads. As such, rn-bitcoinjs-lib popularity was classified as not popular.
We found that rn-bitcoinjs-lib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.