<p>The wtxid and txid are the same if and only if the transaction does not contain any segwit inputs. The wtxid is the hash of the entire transaction including all segwit data (i.e. the marker and flag bytes and the witness fields themselves). The txid is the hash of the non-segwit parts of the transaction. Because a transaction that does not have any segwit inputs does not have any segwit data at all, both the wtxid and txid hash the same data, so they are the same.</p>

CC BY-SA 4.0
2019-06-16T00:39:13.320Z
Thank you. By the way, do you know what RPC command I can use to get the inputs and outputs of transactions returned by getrawmempool?
Tzadiko
CC BY-SA 4.0
2019-06-16T01:50:58.910Z
`getrawtransaction` can give you the full details of a transaction.
Ava Chow
CC BY-SA 4.0
2019-06-14T03:33:26.707Z
2019-06-14T03:33:26.707Z
Ava Chow
<p>I'm having a tough time understanding what exactly WTXID is and what it means when WTXID and TXID are the same (and vica versa).</p>

<p>What I understand is that WTXID includes the witness data. Since non-segwit transactions do not have the witness segregated, their WTXID should be the same as the TXID. Is that correct?</p>

<bitcoin-core><bitcoind><client><segregated-witness>
What does it mean if TXID and WTXID are the same?
Tzadiko
# What does it mean if TXID and WTXID are the same?

(Asked by: username_0 on 2019-06-14)

I'm having a tough time understanding what exactly WTXID is and what it means when WTXID and TXID are the same (and vica versa).

What I understand is that WTXID includes the witness data. Since non-segwit transactions do not have the witness segregated, their WTXID should be the same as the TXID. Is that correct?

**Tags:** bitcoin-core, bitcoind, client, segregated-witness


---

## 1 answers

### Answer by username_1 on 2019-06-14. Score: 5

The wtxid and txid are the same if and only if the transaction does not contain any segwit inputs. The wtxid is the hash of the entire transaction including all segwit data (i.e. the marker and flag bytes and the witness fields themselves). The txid is the hash of the non-segwit parts of the transaction. Because a transaction that does not have any segwit inputs does not have any segwit data at all, both the wtxid and txid hash the same data, so they are the same.

> **Comments:**
> **username_0**: Thank you. By the way, do you know what RPC command I can use to get the inputs and outputs of transactions returned by getrawmempool?  
> **username_1**: `getrawtransaction` can give you the full details of a transaction.  

---

