How to send Bitcoins with node js

0 votes

I am trying to make a web app where if I push on a button, it will send some bitcoins from my bitcoin wallet (A) to another peer's bitcoin wallet (B). I've figured out how to make a raw bitcoin transaction like this:

var bitcoin = require('bitcoinjs-lib');

var keyPair = bitcoin.ECPair.fromWIF('****************************');
var tx = new bitcoin.TransactionBuilder();

tx.addInput('****************************', 0);
tx.addOutput('****************************', 546);
tx.sign(0, keyPair);

generatedhash =;

If I take the generatedhash to a website like , will it succesfully do the bitcoin transaction? If so, I'd like to know if its possible to automate pushing the raw transaction using js as well? 

Jul 20, 2018 in Blockchain by sabby
• 4,370 points

1 answer to this question.

0 votes

This website will successfully do the bitcoin transaction.

You can do a post request with axios to push it through: once you've generated the raw transaction.

answered Jul 20, 2018 by Christine
• 15,830 points

Related Questions In Blockchain

+3 votes
2 answers

How to run ethereumjs using Node.JS

You need to install testrpc globally on ...READ MORE

answered Mar 27, 2018 in Blockchain by ned_crew
• 1,610 points
0 votes
1 answer

How to create tokens in smart contracts from node.js?

Any modification to the Ethereum Blockchain will ...READ MORE

answered Jun 27, 2018 in Blockchain by Shashank
• 10,400 points
0 votes
1 answer

How to send bitcoins to multiple recipients at once?

To send bitcoins to multiple recipients, you ...READ MORE

answered Aug 1, 2018 in Blockchain by slayer
• 29,310 points
0 votes
1 answer

How to add https security for Node js?

You need to add the key and cert to the createServer function. const options ...READ MORE

answered Aug 10, 2018 in Blockchain by digger
• 26,720 points
0 votes
1 answer api_code is missing

Check the blockchain api. it should be $Blockchain ...READ MORE

answered Aug 22, 2018 in Blockchain by slayer
• 29,310 points
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How can I send data to docker?

Whenever i invoke chaincode from the cli ...READ MORE

answered Nov 17, 2018 in Blockchain by Christine
• 15,830 points