What Is a TXID?
The definition of a Bitcoin Transaction ID (TXID), how it is generated, real-world examples, the malleability problem, and how SegWit solved it. Understanding TXIDs is the key to tracking Bitcoin transactions.
When you send or receive bitcoin, a single 64-character string is generated. This is the TXID (Transaction ID). The long hash value on an exchange withdrawal confirmation screen and the link in your wallet app’s transaction history both point to a TXID. The TXID is the essential tool that uniquely identifies every transaction on the Bitcoin network.
Definition of a TXID
A TXID is a 64-character hexadecimal hash value assigned to a Bitcoin transaction. Every transaction has a unique TXID. No two different transactions can share the same TXID.
Example TXID:
a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d
This 64-character string consists only of the digits 0—9 and the letters a—f. It is a 256-bit hash value expressed in hexadecimal. Anywhere on the Bitcoin blockchain, this single value can pinpoint a specific transaction.
How Is a TXID Generated?
A TXID is not assigned arbitrarily. It is mathematically derived from the transaction data itself.
Generation Process
- All of the transaction’s data (inputs, outputs, amounts, locking scripts, etc.) is serialized into a byte array.
- The SHA-256 hash function is applied twice to this byte array (double SHA-256).
- The byte order of the resulting hash is reversed.
Raw transaction data
-> Apply SHA-256
-> Apply SHA-256 again
-> Reverse byte order
-> TXID (64-character hexadecimal)
The reason for reversing the byte order is that Bitcoin internally uses little-endian format, but big-endian format is more natural for human reading.
This process has an important implication: if even a single bit of the transaction data changes, the TXID changes completely. This is thanks to the avalanche effect of hash functions. The TXID therefore acts as a digital fingerprint of the transaction’s contents.
TXIDs of Famous Transactions
Famous transactions in Bitcoin’s history can be looked up by their TXIDs.
Satoshi Nakamoto’s First Transfer (January 12, 2009)
The first peer-to-peer Bitcoin transaction, in which Satoshi Nakamoto sent 10 BTC to Hal Finney.
f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16
The Bitcoin Pizza Transaction (May 22, 2010)
The transaction in which Laszlo Hanyecz paid 10,000 BTC for two pizzas. It was the first purchase of a physical good with bitcoin, and the date is commemorated as “Bitcoin Pizza Day.”
a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d
You can paste these TXIDs into the search bar at txid.uk to view the full details of each transaction.
TXID vs Address vs Block Hash
Bitcoin has several types of long strings that look similar. Because they are easy to confuse, here is a summary of the differences.
| Item | TXID | Address | Block Hash |
|---|---|---|---|
| Identifies | An individual transaction | A Bitcoin receiving location | An individual block |
| Length | 64 characters (hex) | 25—62 characters (varies by encoding) | 64 characters (hex) |
| Starting characters | Irregular | 1, 3, bc1q, bc1p | Leading zeros |
| Uniqueness | One per transaction | Reusable but discouraged | One per block |
| Created when | Transaction is created | Pre-generated by wallet | Block is mined |
| Example | a1075db5...5d48d | 1A1zP1eP...ivfNa | 00000000...a3b1e |
TXIDs and block hashes are both 64-character hex strings, so they look similar. Block hashes are distinguished by having several leading zeros, a consequence of the difficulty requirement in Proof of Work.
TXID Malleability (Transaction Malleability)
The fact that a TXID is a hash of the transaction data introduced a problem: transaction malleability.
Cause of the Problem
In pre-SegWit Bitcoin, signature data was included in the scope of the TXID calculation. The problem was that, due to the nature of ECDSA signatures, it was possible to produce signatures that are mathematically valid for the same private key and message yet have different byte representations.
For example, if Alice created a transaction (TXID: abc123) sending 1 BTC to Bob, a third party could alter the signature portion to create a transaction with the same effect but a different TXID (TXID: def456). If the altered version was included in a block first, Alice’s software would fail to find the original TXID and might mistakenly conclude the transfer had failed.
This issue came up during the Mt. Gox exchange incident in 2014. Whether malleability was the direct cause of the fund losses is debated, but the consensus that it was a protocol-level weakness became widely shared.
SegWit’s Solution
The SegWit (Segregated Witness) upgrade, activated in 2017, segregated signature data from the main transaction structure and placed it in a separate area (the witness). Because signature data is excluded from the TXID calculation, altering the signature no longer changes the TXID.
Before SegWit:
TXID = hash(inputs + outputs + signatures) <- Signature alteration changes TXID
After SegWit:
TXID = hash(inputs + outputs) <- Independent of signatures
WTXID = hash(inputs + outputs + signatures) <- Version that includes signatures
After SegWit, the concept of a WTXID (Witness TXID) was introduced. The WTXID is a hash of the complete transaction including signature data. In everyday use the TXID is still what people reference, but the WTXID is used in internal processing such as transaction relay between nodes.
Hands-On: Looking Up a TXID on txid.uk
If you know a TXID, you can check all of the transaction’s information on a block explorer.
How to look it up:
- Go to txid.uk and paste the 64-character TXID into the search bar.
- On the transaction detail page, review the input/output structure, fee, confirmation count, and block height.
- On viz.txid.uk, visualize the transaction’s input/output relationships as a network graph — try entering the Bitcoin Pizza transaction TXID to trace the flow of 10,000 BTC yourself.
- On tx.txid.uk, decode the raw transaction hex to see the structure from which the TXID was derived.
TXIDs and Confirmations
A TXID is determined the moment a transaction is created. However, the existence of a TXID does not mean the transaction is complete.
Life Cycle of a Transaction
Transaction created (TXID determined)
-> Broadcast to the mempool (unconfirmed)
-> Miner includes it in a block (1 confirmation)
-> Subsequent blocks added (2, 3, ... confirmations)
| Status | Meaning | TXID exists? |
|---|---|---|
| Unconfirmed | Waiting in the mempool; not yet included in a block | Yes |
| 1 confirmation | Included in a block | Yes |
| 6 confirmations | Conventionally regarded as “final” | Yes |
What unconfirmed means: An unconfirmed transaction has not yet been recorded on the blockchain. In theory, a miner may choose not to include it in a block, or it could be replaced via RBF (Replace-By-Fee). For high-value transactions it is therefore safest to wait for at least 1 confirmation, and the common practice is to wait for 6.
You can search for a TXID on txid.uk to check its current confirmation count in real time. If it is unconfirmed, it will be displayed as “Unconfirmed.”
Practical Uses of TXIDs
- Transaction verification: After sending bitcoin, you can share the TXID with the recipient so they can check the transaction status on a block explorer.
- Exchange deposit/withdrawal tracking: Use the TXID issued when withdrawing from an exchange to investigate the cause of a deposit delay.
- Dispute resolution: A TXID recorded on the blockchain serves as unforgeable, objective evidence.
- UTXO reference: A transaction’s input specifies the UTXO to spend by combining the previous TXID with the output index (vout).
Input example:
Previous TXID: a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d
Output index (vout): 0
Summary
A TXID is the unique identifier of a Bitcoin transaction — a 64-character hexadecimal value generated by applying double SHA-256 hashing to the transaction data. Every Bitcoin transaction can be tracked by its TXID, and it is used to check input/output structure, fees, and confirmation status on block explorers. Before SegWit, the malleability problem existed, but SegWit resolved it by segregating signature data. The TXID is the most fundamental unit underpinning the transparency and verifiability of the Bitcoin network.
Related articles: