Two Bitcoin screens can show different identifiers for the same transaction. Before assuming that one is wrong, read the field names. txid and wtxid hash different serializations: txid excludes witness data; wtxid includes it when present. A transaction without witness data has the same value for both.
For someone comparing a wallet record, explorer page or node response, that distinction helps explain what was identified. It does not establish that the transaction is confirmed or that a recipient has been paid twice.
This explainer follows BIP141 and BIP144, captured from a pinned Bitcoin BIPs repository revision, and Bitcoin Core v32.1 source checked November 1, 2026. The diagrams and byte counts are teaching examples. No transaction hashes were invented or calculated, and no node, wallet or RPC was tested.
txid and wtxid use different byte records
BIP141 keeps txid as the double SHA-256 hash of the traditional transaction serialization. That record contains the version, input list, output list and locktime. Counts and variable-length fields are part of the serialization too.
The witness-inclusive form adds a marker, flag and the input witnesses in the order defined by BIP144. A witness supplies data used to satisfy an input's spending conditions. For a native P2WPKH input, it includes a signature and public key.
These are two ways to serialize the transaction for identification, not two payments. The extra letter does not mean another recipient or another balance.
| Serialized field | txid hash input | wtxid hash input with witness |
|---|---|---|
| Version | Included | Included |
| Input count and inputs, including scriptSig and sequence | Included | Included |
| Output count and outputs | Included | Included |
| Marker and flag | Excluded | Included |
| Input witness stacks | Excluded | Included |
| Locktime | Included | Included |
Read the scriptSig row carefully. txid does not discard every possible signature-related byte. An input's scriptSig remains in the base record; witness data is the part excluded from the txid calculation. A claim about a witness-only change must not quietly change scriptSig, an output or another base field as well.
A byte-count worksheet makes the boundary visible
Consider one fictional, non-coinbase transaction with two native P2WPKH inputs and one P2WPKH output. Both input scriptSig fields are empty. Each witness has two items: a hypothetical 72-byte signature item, including its sighash-type byte, and a 33-byte compressed public key. The output script is 22 bytes.
Assume four-byte version and locktime fields. All counts and lengths in this small example fit in one CompactSize byte. Input outpoints, sequences, output value and script are fixed but not supplied as real transaction data. Bitcoin Core's v32.1 serializer defines the field ordering; this is arithmetic over that structure, not a signed transaction.
| Component | Declared calculation | Bytes |
|---|---|---|
| Version, counts and locktime | 4 + 1 + 1 + 4 | 10 |
| Two base inputs | 2 × (36 + 1 + 4) | 82 |
| One output | 8 + 1 + 22 | 31 |
| Base record hashed for txid | 10 + 82 + 31 | 123 |
| Witnesses for both inputs | 2 × (1 + 1 + 72 + 1 + 33) | 216 |
| Marker and flag | 1 + 1 | 2 |
| Complete record hashed for wtxid | 123 + 216 + 2 | 341 |
The two hash calculations consume 123 bytes and 341 bytes, respectively. Neither number is a hash value. Knowing only those lengths is insufficient to calculate an identifier; the actual bytes matter.
As a separate alternative, change only the first witness's signature-item length from 72 to 71 bytes, with every base byte unchanged. The witness section becomes 215 bytes and the full record 340 bytes. The txid hash input remains the same 123 bytes; the wtxid hash input changes.
This comparison does not establish that either invented witness satisfies the spending script, or that both could be accepted. It only isolates which data each identifier commits to. For weight, virtual size and fees, use the separate Bitcoin transaction-size explainer, rather than treating these byte counts as a fee quote.
With no witness data, the identifiers are equal
BIP144 requires the traditional format when the witness is empty. Core's v32.1 hash implementation makes the same boundary explicit: ComputeHash uses serialization without witness, while ComputeWitnessHash returns the txid's value when HasWitness is false.
When witness data exists, the witness hash uses the witness-inclusive serialization. This is why adding a marker, flag and an empty witness section is not a harmless universal way to produce a second identifier. The serializer and parser have rules for that representation.
The identity calculation also differs from verifying a signature. A hash identifies serialized data; it does not prove that the scripts, input availability or other consensus conditions pass.
Output references use txid and an output index
An ordinary Bitcoin input points to a previous output through an outpoint. In Core's transaction definitions, that combines a Txid with an output index. BIP144 likewise specifies the non-witness hash for input outpoints and the transaction Merkle tree.
The distinction matters when reading which output was spent. Replacing a previous transaction's txid with its wtxid is not an interchangeable spelling of the same reference. Keep the identifier type and the output index together. The UTXO explainer follows that inventory in detail.
Witness data still has a block commitment. BIP141 defines a witness Merkle root and a commitment carried by a coinbase output. In that particular witness-tree calculation, the coinbase leaf is treated as all zero bytes. That convention is not a claim that every displayed coinbase transaction identifier is zero, or that witness data sits outside block validation.
Read Core's txid and hash fields by their definitions
In Core v32.1's transaction JSON formatter, txid comes from GetHash, while the field called hash comes from GetWitnessHash. For a transaction carrying witness data, those fields can differ without identifying two separate payments.
The getrawtransaction implementation takes a parameter named txid. Its lookup also depends on the node's mempool, transaction index or supplied block context. An identifier type and a node's ability to retrieve a record are separate questions.
This describes checked source code, not an RPC we ran. Other applications can choose different labels or support different search inputs. Do not assume that every box labelled "hash" accepts both types. Match the interface's documented field, the complete identifier and the intended Bitcoin network.
If a record is missing, first establish which identifier the sending record supplied and which one the lookup expects. A failed search alone does not show that a transaction failed or justify sending again. The existence of either identifier also says nothing by itself about active-chain inclusion. Bitcoin confirmations and exchange credit covers those later observations.
Keep the identifier type with the record
When comparing records, retain the network, the exact field name, the full identifier, any output index and the source of the observation. Compare the transaction's base fields and witness context before interpreting a mismatch. Treat confirmation and receiving-service credit as separate evidence.
txid and wtxid describe what bytes were hashed. They are useful precisely when their meanings stay attached to the strings, rather than becoming two unlabeled "transaction hashes" in a screenshot.
Sources
Primary specifications and implementation source checked November 1, 2026. BIPs are pinned to repository revision 5aadddb511a5dcfe4599531bd8ae5e5b96d0f793; Core implementation claims are scoped to v32.1, the latest stable release at preparation. Historical deployment notes and future-extension sections in the BIPs are not presented as new events or current wallet instructions.
All byte counts are calculated from declared fictional structures. No actual transaction bytes, txid, wtxid, signature, address, node lookup, RPC, broadcast or exchange-account test is supplied. The illustration depicts hash-input views, not a method for removing required witness data from a valid spend. This is protocol education, not financial advice.
- BIP141: transaction identifiers and witness commitment.
- BIP144: serialization and identifier uses.
- Bitcoin Core v32.1: transaction serialization and outpoints.
- Bitcoin Core v32.1: txid and witness-hash computation.
- Bitcoin Core v32.1: getrawtransaction lookup.
- Bitcoin Core v32.1: transaction JSON fields.
See something wrong? Brokzi logs material changes. Prepare a correction note.




