<p>Both the reference client (Bitcoin-QT) and a service like <a href="http://brainwallet.org/" rel="nofollow">http://brainwallet.org/</a> show the transaction ID after signing but before the transaction is broadcast. </p>

<p>Take for example, this valid binary transaction:</p>

<pre><code>01000000017a06ea98cd40ba2e3288262b28638cec5337c1456aaf5eedc8e9e5a20f062bdf000000008b48304502200addea57dd4c2871357165ed6d2bc94b117e322918073ac4c66d535637e74600022100dfaa0dce9e2e61aa2867c87fadca4e0fa3c70e9852a4689b3ef24b3f94809b4a014104e0ba531dc5d2ad13e2178196ade1a23989088cfbeddc7886528412087f4bff2ebc19ce739f25a63056b6026a269987fcf5383131440501b583bab70a7254b09effffffff01b02e052a010000001976a9142dbde30815faee5bf221d6688ebad7e12f7b2b1a88ac00000000
</code></pre>

<p>In JSON it decodes to:</p>

<pre><code>{
    "txid" : "46b690f548f6eb70dca7fb2020ff4be369c42f3ea2375fd3f6b34890b640f8e9",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        { [... snipped ...]}
        }
    ]
}
</code></pre>

<p>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 <a href="https://en.bitcoin.it/wiki/Raw_Transactions" rel="nofollow">on the wiki</a>. </p>

CC BY-SA 3.0
2013-12-10T13:56:32.980Z
2014-11-07T22:01:38.717Z
2014-11-07T22:01:38.717Z
Anonymous
<p>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.</p>

CC BY-SA 3.0
2015-11-11T10:36:33.097Z
2015-11-11T10:36:33.097Z
Andrey Andreev
<p>consider an offline transaction that has not been posted yet, created through a method such as here:</p>

<p><a href="http://brainwallet.org/#tx" rel="nofollow">http://brainwallet.org/#tx</a></p>

<p>a) how could I calculate the transaction ID from the raw transaction?
b) how could I calculate the transaction ID from the JSON transaction?</p>

<transactions><raw>
calculate transaction ID TXID from JSON or raw transaction
user10557
# calculate transaction ID TXID from JSON or raw transaction

(Asked by: username_0 on 2013-12-10)

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

<http://brainwallet.org/#tx>

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

**Tags:** transactions, raw


---

## 2 answers

### Answer by username_1 on 2013-12-10. Score: 2

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:

```
01000000017a06ea98cd40ba2e3288262b28638cec5337c1456aaf5eedc8e9e5a20f062bdf000000008b48304502200addea57dd4c2871357165ed6d2bc94b117e322918073ac4c66d535637e74600022100dfaa0dce9e2e61aa2867c87fadca4e0fa3c70e9852a4689b3ef24b3f94809b4a014104e0ba531dc5d2ad13e2178196ade1a23989088cfbeddc7886528412087f4bff2ebc19ce739f25a63056b6026a269987fcf5383131440501b583bab70a7254b09effffffff01b02e052a010000001976a9142dbde30815faee5bf221d6688ebad7e12f7b2b1a88ac00000000

```

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](https://en.bitcoin.it/wiki/Raw_Transactions).


---

### Answer by username_2 on 2015-11-11. Score: 1

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.


---

