<p>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. </p>

<p>There used to be a bug in bitcoin that coinbase transactions could have the same TXID sometimes. This was fixed by <a href="https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki" rel="nofollow">BIP34</a>.</p>

CC BY-SA 3.0
2015-04-01T10:12:24.973Z
Re BIP34 I never knew that! Fascinating. I believe OP is confusing assigned TxIDs with UTXO TxIDs
Wizard Of Ozzie
CC BY-SA 3.0
2015-03-30T18:53:49.003Z
2015-03-30T18:53:49.003Z
morsecoder
<p>My question is if I can set the TXID in a raw transaction and send it after it with 'sendrawtransaction' (from the qt console)?</p>

<p>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). </p>

CC BY-SA 3.0
2015-03-30T18:58:33.377Z
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
<transactions>
How to set TXID in rawtransaction?
Haddar Macdasi
# How to set TXID in rawtransaction?

(Asked by: username_0 on 2015-03-30)

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).

**Tags:** transactions

> **Comments:**
> **username_1**: 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.  

---

## 1 answers

### Answer by username_1 on 2015-03-30. Score: 0 | Accepted answer

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](https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki).

> **Comments:**
> **username_2**: Re BIP34 I never knew that! Fascinating. I believe OP is confusing assigned TxIDs with UTXO TxIDs  

---

