BIP 69 Transaction Input and Output Sorting: This guide explains BIP 69 Lexicographical Indexing of Transaction Inputs and Outputs in plain English. It covers the problem behind the BIP, why it matters and whether the proposal is part of Bitcoin today.
TL;DR
- What it is: BIP 69 defines deterministic sorting for transaction inputs and outputs where order does not affect function. Inputs sort by reversed previous-transaction hash and output index; outputs sort by amount and then scriptPubKey bytes.
- Why it matters: BIP 69 provides reproducible input and output ordering and removes some wallet-specific side channels. It must be applied before signing, with exact byte order and only where transaction function is position-independent.
- Current position: The informational BIP is Complete, but it is an application convention rather than consensus, and uniform ordering can reduce wallet fingerprint differences without providing anonymity on its own.
BIP 69 Transaction Input and Output Sorting in simple English
BIP 69 Transaction Input and Output Sorting: The BIP applies when input and output order does not change transaction meaning, particularly conventional SIGHASH_ALL flows. Protocols using SIGHASH_SINGLE or positional contracts can require a specific output index.
Simple example
A node operator is checking BIP 69 Transaction Input and Output Sorting. Blind sorting after signatures are created invalidates signatures and may break the intended protocol.
Key terms in plain English
- BIP:
- Bitcoin Improvement Proposal: a document describing a proposed rule, standard or process. Its status must be checked separately.
- Consensus:
- The shared rules full nodes use to decide whether blocks and transactions are valid.
- Node:
- A computer running Bitcoin software that checks data and communicates with other peers.
Why ordering can leak information
Wallets that preserve collection order, put change last or apply a proprietary shuffle create recognisable patterns. Observers can use those quirks to fingerprint software or infer which output is change. A malicious implementation can also encode data deliberately through permutations. Deterministic sorting removes that ordering channel when all participants apply it.
Applicability boundary
The BIP applies when input and output order does not change transaction meaning, particularly conventional SIGHASH_ALL flows. Protocols using SIGHASH_SINGLE or positional contracts can require a specific output index. Blind sorting after signatures are created invalidates signatures and may break the intended protocol.
Input sorting
Inputs compare previous transaction hashes in reversed byte order as they appear for the algorithm, ascending lexicographically. Matching hashes compare their output indexes as unsigned integers ascending. Transaction hash and index together identify the outpoint; scripts and sequence numbers do not decide the sort order.
Output sorting
Outputs compare their 64-bit unsigned satoshi amounts ascending. When amounts match, implementations compare the raw scriptPubKey byte arrays lexicographically. Display addresses, script labels or hexadecimal locale rules are not suitable substitutes. Equal amount and identical script outputs are equivalent for sorting.
Byte order and implementation traps
Human-facing TXIDs are commonly displayed opposite the internal hash byte order used in serialisation. A test can appear sorted in one representation and fail in another. Libraries must state which bytes enter comparison and use fixed unsigned behaviour across languages. Stable handling of equal elements should not inject hidden metadata.
Privacy limits
BIP 69 can reduce one fingerprint class, but deterministic structure may itself identify compliant wallets and does not hide amounts, scripts, timing, input ownership or common-spend heuristics. Collaborative protocols often need their own ordering or randomisation design. Privacy analysis must consider the whole transaction and network path.
How specialists test it
Developers test the proposal with made-up data on an isolated test network. They check normal cases and deliberately invalid cases. Different implementations should reach the same result before anyone relies on the proposal.
Frequently asked questions
What is the main point of BIP 69 Transaction Input and Output Sorting?
BIP 69 Transaction Input and Output Sorting: The BIP applies when input and output order does not change transaction meaning, particularly conventional SIGHASH_ALL flows.
For BIP 69 Transaction Input and Output Sorting, why can ordering leak information?
Wallets that preserve collection order, put change last or apply a proprietary shuffle create recognisable patterns.
For BIP 69 Transaction Input and Output Sorting, what should a beginner know about applicability boundary?
The BIP applies when input and output order does not change transaction meaning, particularly conventional SIGHASH_ALL flows.
For BIP 69 Transaction Input and Output Sorting, what should a beginner know about input sorting?
Inputs compare previous transaction hashes in reversed byte order as they appear for the algorithm, ascending lexicographically.
Conclusion
BIP 69 provides reproducible input and output ordering and removes some wallet-specific side channels. It must be applied before signing, with exact byte order and only where transaction function is position-independent.
Primary sources
Check the current specification status and the documentation for the exact implementation you operate before moving production funds or changing a mining node.
Join the ASIC Mining Discussion
Members can read and join the discussion
Log in to read comments from other miners. Create a free account if you would like to ask a question or share your experience.
Membership helps us protect the discussion from spam and keep answers useful.