Questions tagged [bitcoinjs]

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

Filter by
Sorted by
Tagged with
3 votes
1 answer
2k 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: "...
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
1 answer
903 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. ...
user avatar
  • 246
0 votes
0 answers
125 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 ...
user avatar
0 votes
1 answer
256 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 - ...
user avatar
2 votes
2 answers
2k 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 ...
user avatar
0 votes
1 answer
153 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 ...
user avatar
  • 235
0 votes
3 answers
494 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> ...
user avatar
0 votes
1 answer
2k 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 ...
user avatar
  • 131
1 vote
1 answer
897 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 : ...
user avatar
1 vote
1 answer
1k 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'...
user avatar
  • 111
4 votes
1 answer
2k 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?
user avatar
1 vote
1 answer
440 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'...
user avatar
3 votes
1 answer
527 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-...
user avatar
5 votes
1 answer
2k 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. ...
user avatar
  • 572
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
2 votes
1 answer
466 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 ...
user avatar
1 vote
1 answer
340 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 ...
user avatar
  • 251
1 vote
1 answer
302 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 ...
user avatar
  • 93
7 votes
1 answer
765 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 ...
user avatar
  • 788
4 votes
2 answers
2k 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 ...
user avatar
4 votes
1 answer
241 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?
user avatar
  • 115
2 votes
1 answer
344 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 ...
user avatar
  • 89
2 votes
1 answer
317 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 ...
user avatar
  • 23
4 votes
4 answers
199 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 ...
user avatar
2 votes
3 answers
4k 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 ...
user avatar
  • 81
2 votes
1 answer
280 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 =...
user avatar
  • 21
2 votes
1 answer
287 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 ...
user avatar
7 votes
1 answer
688 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 ...
user avatar
  • 42.8k
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
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
1 vote
1 answer
535 views

Is BitcoinJS under active development?

I love the idea of a powerful alternative to bitcoind, and especially the ability to subscribe on blockchain events and easily process them on the server side. However, I see the last activity on ...
user avatar
  • 647
6 votes
1 answer
1k views

Is there a good tutorial on how to use bitcoinjs exit nodes?

The documentation that I found seems to contain info about specific API calls, but no top level explaination/example. Where can I find a practical concise example of using exit nodes? I'd like to ...
user avatar
  • 26.4k
5 votes
1 answer
315 views

Are there live BitcoinJS Exit Nodes?

Where can I find some live (trusted?) BitcoinJS Exit Nodes? I'm looking it it from the client perspective - I want to write a Java app that doesn't store a blockchain. I don't want to setup an exit ...
user avatar
  • 26.4k

1
2