<p>A txid is calculated from the transaction data by hashing the transaction (excluding the witness). It's not part of the transaction, but rather derived from the transaction. You can rely on it being available for every transaction.</p>

CC BY-SA 4.0
2022-01-13T13:38:27.920Z
2022-01-13T13:38:27.920Z
Murch
<p>Txid can’t be missing since it’s just a hash of the transaction data</p>

CC BY-SA 4.0
2022-01-13T10:33:35.593Z
Note that it isn't a "field" on the transaction either, it isn't explicitly given. You have to hash the transaction yourself to get the ID.
meshcollider
CC BY-SA 4.0
2022-01-13T09:16:01.410Z
2022-01-13T09:16:01.410Z
Mike D
<p>I am writing a script that relies on <code>txid</code> to perform some tasks. I was wondering if it is possible for the <code>txid</code> to be missing from a transaction.</p>

<transactions><transaction-id>
Is txid a required field on all transactions?
Dr. Strangelove
# Is txid a required field on all transactions?

(Asked by: username_0 on 2022-01-13)

I am writing a script that relies on `txid` to perform some tasks. I was wondering if it is possible for the `txid` to be missing from a transaction.

**Tags:** transactions, transaction-id


---

## 2 answers

### Answer by username_1 on 2022-01-13. Score: 3 | Accepted answer

A txid is calculated from the transaction data by hashing the transaction (excluding the witness). It's not part of the transaction, but rather derived from the transaction. You can rely on it being available for every transaction.


---

### Answer by username_2 on 2022-01-13. Score: 6

Txid can’t be missing since it’s just a hash of the transaction data

> **Comments:**
> **username_3**: Note that it isn't a "field" on the transaction either, it isn't explicitly given. You have to hash the transaction yourself to get the ID.  

---

