Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating a non-mainstream client that processes and validates Bitcoin transactions and need to track transactions in my database.

  • How is the TxID generated and when does it change?

Specifically, since sequence is intended to update a transaction, and if the transactions hash were to change I would assume the txid hash would change s well.

When I look at this image of a Tx, it appears that the txid is marked as TxIn (VI)

  • Is it possible or useful for a script to verify the TxID and signature hash?
share|improve this question
up vote 5 down vote accepted

TxID is just a SHA256 hash of binary transation data, so it changes upon any modification of transaction. Therefore, one cannot include verification of TxID in the script in same transaction (if I correctly understood what you want to achieve).

share|improve this answer
Maybe I'm confused... Where is the TxID? – LamonteCristo Dec 20 '12 at 23:08
The transaction id is used to refer to a transaction; it is not part of it. – Pieter Wuille Dec 20 '12 at 23:20
@PieterWuille Is the TxID a simple Sha256 hash of the tx data in it's entirety? Does that mean the TxID changes if the sequence # changes? How should I track revisions (new sequences) of the same tx? – LamonteCristo Dec 21 '12 at 6:17
@makerofthings7 Yes, it is just hash of all data. If tx data changes then it is NOT the same tx. – aland Dec 21 '12 at 8:13
It is a double-SHA256 of the serialized transaction. So indeed, the sequence number is part of. Changing the sequence number means you get a new transaction, but there is some (currently disabled) code in the reference client which can detect one transaction as a 'new version' of another, and replace it. – Pieter Wuille Dec 21 '12 at 10:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.