Questions tagged [bitcoinjs-lib]

15 questions
3
votes
2 answers

How to use Psbt on bitcoinjs-lib?

I am trying to create a raw transaction for sending to the blockchain. In doing so, I want to do this in a browser. Where can I get nonWitnessUtxo? All the information that I have outlined here, I found in the tests. Am I doing the right…
Narnik Gamarnik
  • 1,049
  • 1
  • 16
  • 35
3
votes
1 answer

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 child addresses, i.e. 3 BTC & 2 BTC. Now, I have to send 4…
Isha Padalia
  • 877
  • 7
  • 24
2
votes
0 answers

Cannot read property 'fromWIF' of undefined error

Im trying create and sign a raw transaction with bitcoinjs-lib. const assert = require('assert'); const ecpair = require('ecpair'); const bitcoin = require('bitcoinjs-lib'); var keys =new…
2
votes
1 answer

hd wallet bip44 in js - how to create an address for a chain other than bitcoin?

I have a small script basically taken from this test script in bitcoinjs-lib function getAddress(node) { const bitcoin = require('bitcoinjs-lib'); return bitcoin.payments.p2pkh({ pubkey: node.publicKey }).address; } function BIP44() { …
MetaStack
  • 3,266
  • 4
  • 30
  • 67
1
vote
0 answers

how to sign a PSBT with bitcoinjs-lib in node js?

I am trying to sign a PSBT that is generated by magicEden (NFT marketplace) so I can purchase ordinals NFT from it using code, am using node js, and I was able to debug the site to find how they generate the PSBT by using this Code. import { Psbt }…
Taha Daboussi
  • 350
  • 3
  • 14
1
vote
0 answers

Android BitcoinJ set up error: "Expected the service [FAILED] to be RUNNING, but the service has FAILED"

Issue: I have two classes MainActivity and BitcoinConfig (see below). Can someone please help me fix issues I'm having syncing the blockchain? The AndroidManifest.xml and build.gradle files are given below. Errors: I’ve attached the full logcat…
kaj202
  • 11
  • 2
1
vote
1 answer

bitcoinjs-lib node js raw transaction

var bitcoin = require('bitcoinjs-lib'); var rp = require('request-promise'); var data = Buffer.from('Hello World', 'utf8'); var testnet = bitcoin.networks.testnet; var privateKey = 'p2pkh'; var SourceAddress = "myaddress"; var url =…
Av1n4sh
  • 72
  • 1
  • 8
1
vote
3 answers

A question regarding automated derivation of addresses using xpub and path for Zcash

I'm currently developing an API for my company which utilizes xpub and path to generate an address. Thing is, I managed to do that for all cryptocurrencies we require except for Zcash. We're using trezor hardware wallet and Trezor connect doesn't…
1
vote
0 answers

Decoding data from raw tx

Suppose, I need to get data from the object tx that normally looks like this: { ins: [ { hash: , index: 1, script:…
0
votes
0 answers

How to build a transaction using bitcoinjs-lib

I'm trying to build a transaction using bitcoinjs-lib. Here is my last transaction. https://blockstream.info/api/tx/91feea5f5c7b67b3e56c0f5d23d6da3065855c23b4cc7dded8efd8ff8065500f { "weight" : 705, "txid" :…
Berry Blue
  • 15,330
  • 18
  • 62
  • 113
0
votes
1 answer

Error using React Native using bitcoinjs-lib and ECpair / tiny-secp256k1

I'm trying to use bitcoinjs-lib, but I get errors, I think it has to do with the explanation to use browserify. For this: import BIP32Factory from 'bip32'; const tinysecp = require('tiny-secp256k1') const bip32 = BIP32Factory(tinysecp); I get the…
miketery
  • 111
  • 1
  • 7
0
votes
1 answer

"bitcoinjs.ECPubKey.fromHex" not found

Currently I am creating Bitcoin Library in C# that related to my company use cases based on bitcoinjs-lib. I realized the function ECPubKey.fromHex written my company source code shown as follows is not found in bitcoinjs library. var ecPubKey =…
0
votes
2 answers

Convert UInt8Array to String

I'm working on an application involving cryptocurrency, and I'm having trouble with handling the conversion of some of the data involved. I'm using bitcoinjs-lib to generate Bitcoin addresses. The addresses are created successfully, and my response…
cpppatrick
  • 609
  • 3
  • 12
  • 29
0
votes
2 answers

invalid prefix with bitcoinjs-lib

I have this code: var bitcoin = require('bitcoinjs-lib') var testnet=bitcoin.networks.testnet; var bitcoin = require('bitcoinjs-lib') var privateKey = 'cV1hT8dqY6T3UnFjKk883N3nr895JeBVFjMMqi6VbPgDZyfVfzAF' var keyPair =…
user4543828
0
votes
1 answer

Getting 66: insufficient priority. when trying to push transaction

Basically I getting 66: insufficient priority. Code:-26 when I trying to push transaction I already tried to increase fees manually. AMOUNT_TOSEND is in satoshis I take total_received value from https://api.blockcypher.com/v1/btc/test3/addrs/ +…
Anonymous
  • 69
  • 12