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.
2 Answers
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.
Txid can’t be missing since it’s just a hash of the transaction data
-
1Note 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. Jan 13, 2022 at 10:33