Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bitcoinjs]

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

-1
votes
0answers
48 views

Please can someone help with Bitcoinjs-lib?

I used a rebased branch(cash402) in bitcoinjs-lib In github for building a BCH wallet, I have been trying to get this to work here's my code. Would anybody point out what i might possibly be missing. ...
0
votes
1answer
68 views

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'fromSeedBuffer' of undefined

I am getting Getting error at this line var root = bitcoin.HDNode.fromSeedBuffer(seed); UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'fromSeedBuffer' of undefined Here is ...
1
vote
1answer
71 views

How to create a brainwallet with bitcoinjs?

This is how to create a brainwallet with bitcore const Bitcore = require("bitcore-lib"); // const Mnemonic = require("bitcore-mnemonic"); // https://bitcore.io/api/lib/crypto let brainsrc= 'satoshi' ...
1
vote
1answer
12 views

Can I use wallet balance in satoshis as input for transaction builder ( bitcoinjs-lib )? [closed]

Can I use wallet balance in satoshis as input for transaction builder using bitcoinjs-lib ? If yes, how?
0
votes
1answer
43 views

Can't generate same addresses as bitcoincore using xprv from bitcoin-core

First of all all addresses below are for testing purposes so I don't care about private keys. So dumped wallet created by Bitcoin-qt v0.16.2: extended private masterkey: ...
0
votes
0answers
22 views

sending & receiving bitcoin transactions - Semi - Automated

Hi I'm looking for a way to send transactions and track incoming transactions using some kind of software&/database/code that will let me choose how much to send dependant on preset formulas from ...
0
votes
0answers
96 views

bitcoin transaction error , mandatory-script-verify-flag-failed

The full stack is, Possibly unhandled Error: Validation Error: BitcoindException(super=com.neemre.btcdcli4j.core.BitcoindException: Error #-26: 16: mandatory-script-verify-flag-failed (Script ...
0
votes
1answer
42 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
0answers
74 views

Generating Output Script from Bitcoin.js or other Javascript Library

I'm attempting to use the Ledger Wallet API to sign a multi-sig transaction. The API works as follows: var inputs = [ [ "71f97fa2a21486ecd99674a8ae068d92acd2e9db49c199473be39984e6cbe0f6", "00000000"...
0
votes
1answer
69 views

Bitcoinjs-lib help with deterministc wallet

i'm learning about bitcoin, and bitcoinjs-lib (https://github.com/bitcoinjs/bitcoinjs-lib) I created a dummy wallet on coinomi using this mnemonic ('eight better wealth display father cave suffer ...
0
votes
2answers
157 views

How to change network on BitcoinJS-lib with Coininfo and generate Dogecoin address?

Can't find out how to change network on BitcoinJS-lib with Coininfo and generate Dogecoin address? In a Coininfo's example I found this: https://github.com/cryptocoinjs/coininfo#want-to-use-with-...
0
votes
1answer
58 views

Bitcoinjs module missing issue

I am trying to run this code with node and bitcoinjs-lib but I keep getting missing lib. Any idea what am I missing? I am on a Windows Server 2016. I try to create a P2SH address by hashing a ...
1
vote
0answers
87 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 ...
0
votes
2answers
98 views

Using BitcoinJS - How do you verify a message using a segwit bech32 (bc1…) / P2SH (3…) addresses?

I created a signature from a message using my private key. But how do I verify this signed message using my segwit addresses of 3... or bc1...? How do I verify this using the BitcoinJS library?
0
votes
0answers
112 views

Bitcoin SPV-based wallet using Cordova Ionic and bitcoinjs-lib

I am trying to build SPV-based bitcoin wallet app using Ionic Cordova. I want to integrate the bitcoinjs-lib in Ionic app, to implement the full wallet functionalities and transactions in peer-2-peer ...
0
votes
0answers
263 views

BitcoinJs-lib Multisig Multi-input Raw Transaction Creation

I can not construct this raw transaction correctly: var keyPairs = [ 'cTFWphyQSKUp9RNEftrXgbgbiTg49wz4wfhrAzmutigyjxUw4DqD', 'cQtNm3feFWK5hzR78wUtAowA8pqYDVJsdSVnm4b8qDExEmMvfCNs', '...
1
vote
1answer
364 views

How to sweep a segwit bech32 private key?

I'm testing segwit bech32 addresses and generated the following using bitcoinjs: address: bc1qc7u5njf4nf2rj3zys642mfc7nct6kdven8j4e9 private key: 5Kkzs8XrJNAmf9VQDFeGBfaRvSByAvPK6DbDXw5BVqswWaXSG2Y ...
1
vote
1answer
55 views

Where does the entropy of BitcoinJS' makeRandom() come from?

The library BitcoinJS (https://github.com/bitcoinjs) has a method called makeRandom(). Where does its entropy (randomness) come from? Is it as secure as the method from http://bitaddress.org/ (moving ...
1
vote
0answers
35 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 ...
2
votes
1answer
903 views

How to push a raw transaction using BitcoinJS (and Request)?

I'm using BitcoinJS to create a playground for Bitcoin transactions. I have created the following Javascript file: const request = require('request'); const proxiedRequest = request.defaults({proxy: "...
0
votes
0answers
113 views

HD to EC private key in JavaScript

I'm exploring bitcoinjs-lib and the library has been very useful thus far. Is it possible to create a private EC key from a private HD (BIP32) key?
0
votes
1answer
192 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?...
0
votes
1answer
128 views

ScriptHash from bitcoin address with BitcoinJS

I need to interact with Electrum server API, in order to get UTXOs of a bech32 address. Electrum doesn't support bech32 but supports searching by ScriptHash, which is be obtainable from an address. ...
0
votes
0answers
14 views

Transferring partial BTC between wallets if I know both private keys [duplicate]

Is there a way to transfer/import partial amounts of BTC from one wallet to another off the chain in order to avoid transaction fees? I assume this is how services like Coinbase get around letting you ...
0
votes
0answers
87 views

Coin Selection Algorithm Help

I'm having trouble figuring out how to make my app automatically select inputs for transactions. I'm using bitcoinjs-lib to make addresses and I'd like to be able to easily use them to send coins from....
0
votes
1answer
135 views

Having issues broadcasting BitcoinJS transaction.

I'm trying to send testnet with bitcoinjs, but when I go to broadcast the hex, it gives me an error code that says "fee is too high: 12372928". Now, from my understanding, the fee is the input - ...
1
vote
2answers
742 views

How to decode transaction inputs from raw data using bitcoinjs-lib?

I need to calculate fees for each transaction in block. I retrieve raw block data and use bitcoinjs-lib library to decode it to Block object: const block = Bitcoin.Block.fromHex(data.rawblock); It ...
0
votes
1answer
111 views

How BitcoinJS sync bitcoin blockchain/transaction data?

I see the reference code in BitcoinJS website about 'Creating a Transaction': var tx = new bitcoin.TransactionBuilder() // Add the input (who is paying): // [previous transaction hash, index of the ...
0
votes
2answers
247 views

Creating an OP_CSV transaction with bitcoinjs

I'm working on a tool for timelocked contract generation. My redeem script looks like so: OP_HASH160 <revocationHash> OP_EQUAL OP_IF <bobPubKey> OP_ELSE <timeDelay> ...
0
votes
1answer
892 views

HD wallet implementation

I want to create public addresses in offline browser from master public key so that owner of master private can access the funds available in child address. but I am not able to understand how to use ...
1
vote
1answer
362 views

Specifying fee amount using bitcoinjs

I'm currently playing with bitcoinjs (https://bitcoinjs.org/) and I'm creating offline transactions that I broadcast over the network after. I've successfully create my first transaction using this : ...
1
vote
1answer
699 views

How to create a deterministic wallet using bitcoinjs-lib

I'm new to bitcoin technology, however, I'm trying to develop a web wallet using bitcoinjs-lib that works like that of blockchain.info. I've gone through the code samples on the github repo but couldn'...
3
votes
1answer
995 views

How do you validate a bitcoin address using bitcoinjs library in javascript?

How would one validate a bitcoin address using the bitcoinjs library? Or is there another way to do this via javascript?
1
vote
1answer
194 views

How to convert a keyPair to JSON and back?

Using bitcoinjs you can generate a keyPair with the following code: var keyPair = bitcoin.ECPair.makeRandom(); How can I stringify this object to JSON and then parse it back to an object? JSON doesn'...
4
votes
1answer
275 views

Understanding signing messages with bitcoinjs-lib

I'm trying to understand what a specific line of code does when signing a message using bitcoinjs-lib. Here's the code: var bitcoin = require('bitcoinjs-lib') var bitcoinMessage = require('bitcoinjs-...
5
votes
1answer
991 views

How to use bitcoinjs-lib with Regtest?

I was trying to use the bitcoinjs-lib (1) with my regtest network. More specifically I was trying to build a tx with TransactionBuilder but it gave me a 'transaction has no matching Script' exception. ...
1
vote
0answers
94 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 ...
3
votes
1answer
318 views

OP_RETURN Promise with bitcoinjs-lib v2.2.0 and blockchain.info

So the below is the function I'm running. I'm sending in the key for this bitcoin address 16WBguy6KVyTGnF4KX7Vmdx8ztj4wENh4W and the message bkawk to this function // Require the packages that ...
1
vote
1answer
299 views

How to develop an ownership tracking service based on bitcoin blockchain

Now I expect to develop an ownership tracking service like Ascribe. I'm planning to develop it as following, however I am not sure whether my plan is correct. Therefore, please let me ask two ...
1
vote
1answer
238 views

OP_EQUALVERIFY Problem

I'm making a full-service wallet, I already made the UTXOs selection algorithm and now I want to push the transaction hex bytes. It works when I push only a transaction with only 1 input, but if I try ...
7
votes
1answer
693 views

Which language has better Bitcoin API experience, C# or Node.js?

At the moment it seems to me on the .NET side NBitcoin would compete with Bitcoin.js on the other. Update: I decided on NBitcoin. It has a great book to learn from. Note I will not form opinion on my ...
4
votes
2answers
1k views

How do you broadcast a transaction programatically?

What is the best way to broadcast a transaction to the network programatically? I know that blockchain.info has /pushtx but I'm pretty sure it rejects XHR requests from external sources because of ...
4
votes
1answer
167 views

Do all implementation of Deterministic RFC6979-compliant ECDSA signatures generate the same signed transaction given the same data?

So if I were to create the same transaction using bitcoinjs and bitcoinj, the end result of the signed transaction would be the same with both libraries, is that correct?
2
votes
1answer
302 views

Why am I unable to post two transactions (the second from the change address of the first) in the same block?

I'm attempting to make a transaction on the testnet with an OP_RETURN and a change address in it, and then make a second OP_RETURN transaction from first transaction's change address in the same ...
2
votes
1answer
277 views

Hybrid Bitcoin web wallet for performing multi-sig transaction on an e-commerce site

Two participants in a transaction, a buyer and a seller, need to interact financially. For security, they themselves keep their private keys and sign transactions on client using JS. I want to create ...
4
votes
4answers
186 views

Preventing the exposure of public addresses on a website

Rather than having a single, fixed address, I want to generate a new address on my website every time a user request comes in. I'm concerned about google or another web crawler indexing my website ...
2
votes
1answer
3k views

Create OP_RETURN tx with Bitcoinjs-lib

I know how to create a basic TX: var bitcoin = require('bitcoinjs-lib') var tx = new bitcoin.Transaction() // Add the input (who is paying) of the form [previous transaction hash, index of the ...
2
votes
1answer
253 views

Error pushing hex of tx, generated with bitcoinjs 1.0, on testnet

I'm new to bitcoin programming and decided to give it a try with the release of bitcoinjs-lib 1.0. Here is how I generate the hex for the transaction var bitcoin = require('bitcoinjs-lib'); var key =...
2
votes
1answer
277 views

Created an HTML5 Game, best way to integrate Bitcoin?

Okay so I just finished up a ping pong HTML5 game I've been working on as practice, and I was thinking of integrating Bitcoin into the game so when a user wins vs. the CPU, they get a small amount of ...
7
votes
1answer
586 views

How to use bitcoinjs with TestNet?

One of my colleagues is trying to use bitcoinjs with TestNet, but apparently it doesn't like TestNet headers, so it doesn't work. Is there any way to make to use bitcoinjs with TestNet? Is there some ...