Author: Peter Todd 2015-06-09 20:14:36
Published on: 2015-06-09T20:14:36+00:00
In an email exchange between Kristov Atlas and Peter Todd on June 8, 2015, they discussed the applicability of a BIP (Bitcoin Improvement Proposal) that covers all transactions where the order of inputs and outputs do not matter. They agreed to simplify the language in the proposal to state that such use cases are out of scope for the BIP since there are numerous possible scenarios that cannot be predicted. The BIP applies to transactions where SIGHASH_ALL is used, with the exact input and output order committed to by signatures. In the case of SIGHASH_ANYONECANPAY or SIGHASH_NONE, compliant software should still emit sorted inputs and outputs, although these may later be modified by others. If new signature hash types are introduced in the future, the lexicographic ordering principle should be applied analogously. Protocols requiring a specified input/output order should consider adapting the goals of this BIP to their specific needs.Regarding a patch implementing deterministic transaction ordering for Bitcoin Core, Todd offered to take care of it since he is a frequent code committer, but if no one else does, Atlas will do it. Todd also suggested changes to the actual ordering algorithm, recommending that txids be sorted as little-endian byte arrays instead of with the hex-based algorithm and that scriptPubkeys be used instead of locking scripts. Finally, they decided to sort amounts first since they contain fewer bytes of information compared to standard P2PKH locking scripts.
Updated on: 2023-06-09T22:14:44.755574+00:00