How to set TXID in rawtransaction?

0

My question is if I can set the TXID in a raw transaction and send it after it with 'sendrawtransaction' (from the qt console)?

If not, is there a way to do it? And if there is a way, does it means I can send to the bitcoin network the same transaction id over and over again even if the transaction itself is different each time (different inputs or outputs).

Haddar Macdasi

Posted 2015-03-30T18:48:06.933

Reputation: 845

I first thought I understood what you are asking, but upon reading this again, I think it would be helpful if you gave us more detail on what you are trying to accomplish.morsecoder 2015-03-30T18:58:33.377

Answers

0

You cannot choose the TXID of your transaction, really. It is calculated by SHA256d hashing the serialized transaction bytes. If you did happen to get miraculously lucky enough to get a transaction with the same hash as a different transaction, then it would be refused by the network for attempting to overwrite a transaction.

There used to be a bug in bitcoin that coinbase transactions could have the same TXID sometimes. This was fixed by BIP34.

morsecoder

Posted 2015-03-30T18:48:06.933

Reputation: 12 624

Re BIP34 I never knew that! Fascinating. I believe OP is confusing assigned TxIDs with UTXO TxIDsWizard Of Ozzie 2015-04-01T10:12:24.973