Bitcoinjs-lib: How to decode rawtransaction?

Created on 7 Mar 2017  路  1Comment  路  Source: bitcoinjs/bitcoinjs-lib

I often use bitcoind command "decoderawtransaction".
I want to decode TX hex code on web browser standalone.
How to do?
I edit PaperWallet https://walletgenerator.net/

how to / question / docs

Most helpful comment

create a transaction object from a hex string

var bitcoin = require('bitcoinjs-lib');
var tx = bitcoin.Transaction.fromHex(rawtx);
var txid = tx.getId();
console.log(txid);

I have sample code to show details.
There may be easier ways, but I do not know

https://github.com/you21979/node-multisig-wallet/blob/master/lib/txdecoder.js

>All comments

create a transaction object from a hex string

var bitcoin = require('bitcoinjs-lib');
var tx = bitcoin.Transaction.fromHex(rawtx);
var txid = tx.getId();
console.log(txid);

I have sample code to show details.
There may be easier ways, but I do not know

https://github.com/you21979/node-multisig-wallet/blob/master/lib/txdecoder.js

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

dcousens picture dcousens  路  3Comments

Mr-Mondragon picture Mr-Mondragon  路  3Comments

askucher picture askucher  路  3Comments

panpan2 picture panpan2  路  3Comments