Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var bitcoin = require('bitcoinjs-lib');
- // define bitcoin addrewss we want to transfer coins from
- var key = bitcoin.ECPair.fromWIF("L1Kzcyy88LyckShYdvoLFg1FYpB5ce1JmTYtieHrhkN65GhVoq73");
- var txb = new bitcoin.TransactionBuilder();
- // (in)15000 - (out)12000 = (fee)3000, this is the miner fee
- // Alice's previous transaction output, has 15000 satoshis
- txb.addInput('61d520ccb74288c96bc1a2b20ea1c0d5a704776dd0164a396efec3ea7040349d', 0);
- txb.addOutput('1cMh228HTCiwS8ZsaakH8A8wze1JR5ZsP', 12000);
- txb.sign(0, key);
- var client = new bitcoin.Client({
- host: 'localhost',
- port: 8332,
- user: 'user',
- pass: 'pass'
- });
Add Comment
Please, Sign In to add comment