1

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.

  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 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?

Wizard Of Ozzie
  • 5,298
  • 4
  • 31
  • 63

1 Answers1

3

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.

David Schwartz
  • 51,554
  • 6
  • 106
  • 178
  • 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 Mar 16 '15 at 07:39
  • 1
    Yes, different signatures means a different transaction. It's not quite as simple as hashing the raw transaction. See this link. – David Schwartz Mar 16 '15 at 09:24