<blockquote>
  <p>How is a TxID assigned to a Transaction?</p>
</blockquote>

<p>It's a hash of key transaction information -- inputs, outputs, scripts, signatures.</p>

<blockquote>
  <p>Are 2 identical Txs that: double spend, have identical k PRNG-signed (so not a RNG!) sigs, identical inputs/outputs (a lot of assumptions here) given identical hashes?</p>
</blockquote>

<p>This question is ill-formed. Unless there's some difference between them, they're not 2 transactions, they're one transaction. It's like talking about "two identical integers" -- that would just be one integer.</p>

CC BY-SA 3.0
2015-03-16T07:39:11.237Z
To clarify: a Tx formed from identical components except the signature will have different hashes, correct? How does one calculate the Tx hash from a raw Tx exactly? (ie is it a double SHA256 of the raw Tx with(out) appended SIGHASH?)
Wizard Of Ozzie
CC BY-SA 3.0
2015-03-16T09:24:16.540Z
Yes, different signatures means a different transaction. It's not quite as simple as hashing the raw transaction. See [this link](http://bitcoin.stackexchange.com/a/2233/85).
David Schwartz
CC BY-SA 3.0
2015-03-15T12:25:31.827Z
2015-03-15T12:25:31.827Z
David Schwartz
<p>A largely abstract question (set) I've tried to answer for awhile is the nature of a TxID (32 byte hex Transaction ID hash).</p>

<p>First and foremost, I certainly understand the main function if this value(?) is to <em>uniquely identify a Transaction</em> (primarily to tracks unspent outputs, AKA UTXOs).</p>

<p>But let's take a random TxID, say <a href="https://blockchain.info/tx/e151de4f5a339ed545e24ecfc8f811f9143fefc10574af40721a156ff2d3a389" rel="nofollow"><em>e151de4f5a339ed545e24ecfc8f811f9143fefc10574af40721a156ff2d3a389</em></a>. </p>

<ol>
<li>How is a TxID assigned to a Transaction?</li>
<li>Are 2 identical Txs that: double spend, have identical <em>k</em> PRNG-signed (so not a RNG!) sigs, identical inputs/outputs (a lot of assumptions here) given identical hashes?</li>
<li>Tangentially: are the Big/Little Endian expressions of TxIDs (by <a href="http://blockchain.info" rel="nofollow">BCI</a> and bitcoincore respectively) suggesting two different usages (ie TxIDs are values in one sense but akin to URIs in another: is this normal?)</li>
</ol>

<p>I know the questions seem somewhat disparate but I think the best summation is <strong>what <em>exactly</em> are TxIDs?</strong></p>

<transactions><protocol>
Meaning/Derivation of 32 byte TxID hash
Wizard Of Ozzie
# Meaning/Derivation of 32 byte TxID hash

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

A largely abstract question (set) I've tried to answer for awhile is the nature of a TxID (32 byte hex Transaction ID hash).

First and foremost, I certainly understand the main function if this value(?) is to *uniquely identify a Transaction* (primarily to tracks unspent outputs, AKA UTXOs).

But let's take a random TxID, say [*e151de4f5a339ed545e24ecfc8f811f9143fefc10574af40721a156ff2d3a389*](https://blockchain.info/tx/e151de4f5a339ed545e24ecfc8f811f9143fefc10574af40721a156ff2d3a389).

1. How is a TxID assigned to a Transaction?
2. Are 2 identical Txs that: double spend, have identical *k* PRNG-signed (so not a RNG!) sigs, identical inputs/outputs (a lot of assumptions here) given identical hashes?
3. Tangentially: are the Big/Little Endian expressions of TxIDs (by [BCI](http://blockchain.info) and bitcoincore respectively) suggesting two different usages (ie TxIDs are values in one sense but akin to URIs in another: is this normal?)

I know the questions seem somewhat disparate but I think the best summation is **what *exactly* are TxIDs?**

**Tags:** transactions, protocol


---

## 1 answers

### Answer by username_1 on 2015-03-15. Score: 3 | Accepted answer

> How is a TxID assigned to a Transaction?

It's a hash of key transaction information -- inputs, outputs, scripts, signatures.

> Are 2 identical Txs that: double spend, have identical k PRNG-signed (so not a RNG!) sigs, identical inputs/outputs (a lot of assumptions here) given identical hashes?

This question is ill-formed. Unless there's some difference between them, they're not 2 transactions, they're one transaction. It's like talking about "two identical integers" -- that would just be one integer.

> **Comments:**
> **username_0**: To clarify: a Tx formed from identical components except the signature will have different hashes, correct? How does one calculate the Tx hash from a raw Tx exactly? (ie is it a double SHA256 of the raw Tx with(out) appended SIGHASH?)  
> **username_1**: Yes, different signatures means a different transaction. It's not quite as simple as hashing the raw transaction. See [this link](http://bitcoin.stackexchange.com/a/2233/85).  

---

