Questions tagged [bitcoinjs]

BitcoinJS allows you to create webpages that pull information from the blockchain.

27 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3 votes
0 answers
216 views

BitcoinJS with no storage?

I have a use-case where I'd only need to be monitoring the mempool transactions and recently-committed blocks/transactions (the last month's worth of blocks would be sufficient). Is there a way to ...
user avatar
2 votes
0 answers
278 views

How to send & receive bitcoin using bitcoinjs-lib?

First I create HD Wallet using BIP32 using mnemonics. Now I want to generate new child addresses with private key using xpub & xpriv for every receive. Then for example, I received BTC in 2 ...
user avatar
1 vote
0 answers
21 views

How to secure exchange hot wallet keys

Am currently working on an exchange, am building the hot wallet using bitcoinjs-lib. I generate my wallet pub /sec keys and addresses using this library (I don't want to use wallet.dat file). Now is ...
user avatar
1 vote
0 answers
106 views

Error validating transaction ... Script was NOT verified successfully

I'm getting this error below when trying to broadcast a transaction with the code below. I'm new to blockchain development and I've been trying to solve this but can't seem to figure it out. I believe ...
user avatar
1 vote
0 answers
83 views

How can I use PSBT in a JavaScript project?

I am trying to use PSBT in a Bitcoin project. The idea is to generate keys and sign transactions client-side. I am already familiar with bitcoinjs-lib but I find the API rather complicated. It would ...
user avatar
1 vote
0 answers
75 views

How to use Digital Signature to Sign Unsigned Transaction?

so I was trying to sign my unsigned transaction: ...
user avatar
  • 113
1 vote
2 answers
287 views

How to verify the compressed signature in Bitcoin? It is 138 long in hex

I am using the bicoinjs-message npm module for signature verification. I learned that there are few signatures which are of length 138 in hexadecimal. When I tried to verify such a signature it is ...
user avatar
1 vote
1 answer
937 views

Tracking incoming transactions using nodejs and own node

I need to verify that user from my database has sent btc to my wallet. Ideally I want to generate a unique address for each user transaction and then track all those addresses but I suppose it will ...
user avatar
1 vote
0 answers
323 views

bitcoinjs-lib seems to skip a step in deriving addresses from a BIP 44 wallet

According to this wiki page to create a bitcoin address, 1) you have your public key of the properly derived path 2) Then SHA256 it 3) Then RIPEMD-160 it, Add version byte at the front and boom ...
user avatar
  • 1,379
1 vote
0 answers
82 views

Using blockcypher BitcoinJs at clientside is secure or not?

I am trying to create new transaction using bitcoinjs at client side. Is it a secure way to create a transaction from Client side, which includes curl call. Scenario, if I start from creating the new ...
user avatar
1 vote
1 answer
526 views

How to get unspents for inputs using bitcoinjs-lib?

I would like my simple wallet app to automatically select UTXOs for inputs. I realize that I can't accomplish this with just bitcoinjs, but is there something I can add to it to keep track of unspents?...
user avatar
1 vote
0 answers
116 views

BItcoinjs - safest way to manage wallet on a potentially untrusted device

As per the title, what would be the safest way to run a Bitcoin wallet on a potentially untrusted device, such as a mobile phone? The question assumes the usage of bitcoinjs-lib (which allows, among ...
user avatar
  • 11
1 vote
0 answers
1k views

Getting wallet balance with BitcoinJS + Bitcoin-lib (client lib)

I have server with BitcoinJS and Bitcoin ExitNode running. I try to fetch wallet balance from client with code from manual on wiki page. I have send money on client generated address, but app says ...
user avatar
0 votes
1 answer
37 views

testnet output address has no matching Script?

Here is my code to create a PSBT on the testnet: const bitcoin = require("bitcoinjs-lib") const privKey1 = "..." const address1 = "mkVPHMR5euGTcvpFj6tfyVERstDdH4RtQs" ...
user avatar
0 votes
0 answers
19 views

Bitcoin-lib js error on read blocks?

When i try to read raw first block all be ok, but when i load last blocks i have issue with raw transactions. Error: Cannot read slice out of bounds at BufferReader.readSlice (C:\Users\usmim\...
user avatar
0 votes
0 answers
50 views

bitcoinjs-lib: P2SH (purpose 49) addresses derived from an xpub are not matching Ian Coleman's Bip39

Code: export function xpubTo49Addresses(xpub: string, index: number = 10): string | undefined[] { const cache = bip32.fromBase58(xpub).derive(0) const addresses: string | undefined[] = [] for (...
user avatar
  • 1
0 votes
1 answer
464 views

In bip32-utils for bitcoinjs, node.getAddress is not a function

I am trying to run the example code in the bip32-utils taken here (https://github.com/bitcoinjs/bip32-utils) of: const bip39 = require('bip39') const bitcoin = require('bitcoinjs-lib') const ...
user avatar
0 votes
2 answers
212 views

Storing entire seed from bip39 mnemonic using WIF

I'm using the bitcoinjs collection of libraries, specifically https://github.com/bitcoinjs/wif, https://github.com/bitcoinjs/bip32 and https://github.com/bitcoinjs/bip39 with nodejs. I have a mnemonic ...
user avatar
0 votes
1 answer
141 views

Missing Witness field in p2wpkh decoded tx hex

I have placed together a raw tx hex but when it's unable to be broadcasted as I keep getting an error below sendrawtransaction RPC error: {"code":-25,"message":"bad-txns-...
user avatar
0 votes
1 answer
30 views

What are some different ways to retrieve btc transaction information of an address using bitcoinjs?

What are some different ways to retrieve btc transaction information of an address using bitcoinjs? I've tried using the syntax from this page (https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/...
user avatar
0 votes
0 answers
368 views

Need help with (Script failed an OP_EQUALVERIFY operation)

This is a repost of a question which i posted directly on the repository of bitcoinjs-lib, which you can see here I'm getting the following error when trying to push transactions: Err: ...
user avatar
0 votes
0 answers
53 views

How to get raw tx in hex format by not fetching API from provider?

I've looking for some solution to encode raw transaction in hex format by programmatically without fetching data from any blockchain provider. Are there any way to do this?
user avatar
0 votes
1 answer
346 views

Can we sign a psbt raw tx having multiple inputs created from BTC node with bitcoinjs lib?

Due to secruity reasons, unavailablity of private keys on my end and as per project requirements I need to build back end apis where I will provide a PSBT raw transaction hex (having multiple inputs) ...
user avatar
0 votes
1 answer
282 views

How to calculate fee in BitcoinJS raw transaction?

I have a transaction with 3 inputs and 2 outputs. 1output is the recipient and the other output is change address. How should I calculate the fee and apply it to output?
user avatar
0 votes
2 answers
145 views

How to get BTC transfer amount from raw tx using bitcoinjs

Suppose I have following object console.log(bitcoinjs.Transaction.fromHex(rawTx)); The output Transaction { version: 2, locktime: 1655960, ins: [ { hash: <Buffer dc 4d aa 10 db ...
user avatar
0 votes
0 answers
58 views

Sign a Partially Signed rawtransaction with bitcoinjs-lib

I was trying to figure out how to use the bitcoinjs-lib. I was thinking if I could sign a partially signed raw transaction in bitcoijs-lib. For example - If I have a hex String whose input1 is ...
user avatar
0 votes
1 answer
230 views

Looking for JS/Node.js code example to sign a transaction (with multiple UTXOs) with only the extended private key

Is there any Javascript code out there or examples on how to sign a transaction by using the extended-private-key? What I am essentially looking for is code that will help derive the private key, ...
user avatar