Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@samouraiwallet/bip47
Advanced tools
A set of utilities for working with BIP47 and bitcoinjs-lib.
This library uses ES Modules. Node.js v14 or later is required.
Source code was written in Typescript. Type definitions are included in the published bundle.
You need to provide your own implementation of secp256k1
elliptic curve.
tiny-secp256k1 is recommended but you can use any other which has the same API.
All necessary documentation of usage is provided via test files.
You will need webpack/browserify to bundle this library and it's dependencies to be able to use it in browser
environment.
Since tiny-secp256k1
is a WASM library, it will require such bundler to be able to load WASM code.
Please consult the docs of a bundler that you use for further information.
For example current webpack will require you to set { experiments: { asyncWebAssembly: true }}
in your config.
import * as ecc from 'tiny-secp256k1';
import {BIP47Factory} from '@samouraiwallet/bip47';
const bip47 = BIP47Factory(ecc);
const aliceB58PCode = 'PM8TJTLJbPRGxSbc8EJi42Wrr6QbNSaSSVJ5Y3E4pbCYiTHUskHg13935Ubb7q8tx9GVbh2UuRnBc3WSyJHhUrw8KhprKnn9eDznYGieTzFcwQRya4GA';
const bobSeed = '87eaaac5a539ab028df44d9110defbef3797ddb805ca309f61a69ff96dbaa7ab5b24038cf029edec5235d933110f0aea8aeecf939ed14fc20730bba71e4b1110';
const alicePcode = bip47.fromBase58(aliceB58PCode);
const bobPcode = bip47.fromSeed(Buffer.from(bobSeed, 'hex'), 0);
const bobNotifPrivKey = bobPcode.getNotificationPrivateKey();
const alicePaymentAddr1 = alicePcode.getPaymentAddress(bobNotifPrivKey, 0, 'p2pkh'); // derive P2PKH payment address
const alicePaymentAddr2 = alicePcode.getPaymentAddress(bobNotifPrivKey, 1, 'p2wpkh'); // derive P2WPKH payment address
import * as ecc from 'tiny-secp256k1';
import {BIP47Factory, utils} from '@samouraiwallet/bip47';
const networks = utils.networks;
const bip47 = BIP47Factory(ecc);
const b58PCode = 'PM8TJS2JxQ5ztXUpBBRnpTbcUXbUHy2T1abfrb3KkAAtMEGNbey4oumH7Hc578WgQJhPjBxteQ5GHHToTYHE3A1w6p7tU6KSoFmWBVbFGjKPisZDbP97';
const alicePcode = bip47.fromBase58(b58PCode, networks.testnet);
const aliceNotifAddr = alicePcode.getNotificationAddress();
FAQs
A set of utilities for working with BIP47 and bitcoinjs-lib
The npm package @samouraiwallet/bip47 receives a total of 38 weekly downloads. As such, @samouraiwallet/bip47 popularity was classified as not popular.
We found that @samouraiwallet/bip47 demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.