TeachMeBitcoin

wTXID Overview

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

wTXID (Witness Transaction ID)

In a SegWit-enabled world, every Bitcoin transaction actually has two different identities. The first is the standard TXID, and the second is the wTXID (Witness Transaction ID). Understanding the difference between them is key to understanding how SegWit fixed transaction malleability.

1. The Need for a Second ID

Before SegWit, if you changed a single byte in a transaction's signature (which is easy to do without invalidating it), the TXID would change. This "Malleability" made it difficult to build complex protocols like Lightning.

2. What is a wTXID?

The wTXID is the double-SHA256 hash of the entire transaction serialization, including:

3. The Identity Split

4. wTXID for Legacy Transactions

For older, non-SegWit transactions, the wTXID is defined to be identical to the TXID. This ensures that the block-building logic remains consistent regardless of which transaction types are included.

Feature TXID wTXID
Includes Signatures? No Yes
Changes if Sig changes? No (Safe) Yes (Malleable)
Primary Use UTXO Referencing Block Commitment
Serialization Base Data Only Full SegWit Data

In the next section, we will compare the Calculations of TXID vs. wTXID.

☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!