Questions tagged [bitcoinjs]

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

24 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
212 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 ...
2
votes
0answers
192 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 ...
1
vote
0answers
38 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 ...
1
vote
0answers
34 views

How to use Digital Signature to Sign Unsigned Transaction?

so I was trying to sign my unsigned transaction: ...
1
vote
2answers
74 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 ...
1
vote
1answer
384 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 ...
1
vote
0answers
251 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 ...
1
vote
0answers
75 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 ...
1
vote
1answer
429 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?...
1
vote
0answers
106 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 ...
1
vote
0answers
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 ...
0
votes
0answers
28 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?
0
votes
1answer
45 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) ...
0
votes
0answers
41 views

Using a bitcoin library to create digital signatures in TypeScript/Javascript

I have been trying to sign my transactions with a digital signature for the past few days but seems that libraries in bitcoin, as far as to my knowledge do not provide a simple way to sign the ...
0
votes
1answer
81 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?
0
votes
0answers
213 views

Bitcoinjs Transactions using PSBT in Bitcoinjs Lib

I am trying to use the bitcoinjs lib to create a tx using PSBT const testnet = Bitcoin.networks.testnet const tx = new Bitcoin.Psbt(testnet) I am not using transaction builder as it throws ...
0
votes
1answer
76 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 ...
0
votes
1answer
222 views

Why do I get: Error: <address> has no matching Script

The example code for psbt.addOutput() with address '1KRMKfeZcmosxALVYESdPNez1AP1mEtywp' works as expected. But if I change this to an testnet address I get this error: ' has no matching script'. I ...
0
votes
1answer
111 views

How to get Bitcoin input transaction hash string from bitcoinjslib Transaction object?

I'm using bitcoinjs-lib and its Transaction object. Transaction.ins is an array of objects, each which has a hash and script property. Both of these properties are Uint8Arrays. I am trying to get ...
0
votes
0answers
40 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 ...
0
votes
3answers
483 views

how to generate bitcoin adddres using seed?

Hi i am new to bitcoin all i want to know is how to generate address using mnemonic seed? let testnet =Bitcoin.networks.testnet; let keypair =Bitcoin.ECPair.makeRandom({network:testnet}); let address=...
0
votes
1answer
822 views

How to retrieve readable private key from bitcoinjs-lib

I'm still new to bitcoin and experimenting a lot with bitcoinjs-lib in JavaScript. How do I create a readable string from a private key? This is my current setup: const seed = bip39....
0
votes
1answer
177 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, ...
0
votes
1answer
114 views

how to create a transaction that can only run in bch-abc using javascript?

I use the "bitcoincashjs" or "bch-lib" and want to add a new opcode "OP_CHECKDATASIG" to output.How to do? const utxo = { 'txId' : '...