Author

Topic: How can I get previous hash to tx.addInput (BitcoinJS)? (Read 4546 times)

hero member
Activity: 521
Merit: 522
Developer - EthicHacker - BTC enthusiast
Hello everyone,

may I ask, how can I get this variable? Should I get it from spent tx or receive tx or unspent tx? Which hash of listed transaction should I use? I am new in this and I would like to know, how to create raw transaction.

Thanks a lot for all replies.

Hello,

you must create transaction which spends your declared inputs (this is object contains transaction outputs (unspent) so you can spend in this rawtx.  like: tx.addInput(unspent.txHash, unspent.index) and this you can get with for example from local
btc-node or also can get unspent outputs and transaction history from blockchain.info like i do always.

also here are some urls with usefull information on how to make raw tx in bitcoinjs:

https://gist.github.com/orweinberger/3bd7dfdc574be58539c5
https://medium.com/@orweinberger/how-to-create-a-raw-transaction-using-bitcoinjs-lib-1347a502a3a



hope this help.
thank you
DKH
newbie
Activity: 3
Merit: 0
Hello everyone,

may I ask, how can I get this variable? Should I get it from spent tx or receive tx or unspent tx? Which hash of listed transaction should I use? I am new in this and I would like to know, how to create raw transaction.

Thanks a lot for all replies.
Jump to: