consider an offline transaction that has not been posted yet, created through a method such as here:


a) how could I calculate the transaction ID from the raw transaction? b) how could I calculate the transaction ID from the JSON transaction?


Both the reference client (Bitcoin-QT) and a service like http://brainwallet.org/ show the transaction ID after signing but before the transaction is broadcast.

Take for example, this valid binary transaction:


In JSON it decodes to:

    "txid" : "46b690f548f6eb70dca7fb2020ff4be369c42f3ea2375fd3f6b34890b640f8e9",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        { [... snipped ...]}

With the transaction ID in the first key. If you were doing the signing yoruself, the TXID is literally a double SHA256 hash of the raw transaction. There's some more information about raw transactions on the wiki.


The answer is right, but you always have to think about Transaction Malleability, so that your transaction's ID could easily change during mining process when it will be in the network. So that, you can't trust offline calculated transaction ID, and have to wait until your transction will be confirmed by the network to depend something on its ID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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