I've updated the draft BIP in two ways:
-Making it clear that sorting is algorithmically agnostic, but should conform to the output of the example algorithms written in python
-The BIP now handles schemes that create an input/output dependency, such as SIGHASH_SINGLE:
Handling Input/Output Dependencies
Some uncommon forms of transactions create an ordering dependency between inputs and outputs of a transaction. Wallets forming these transactions should first sort inputs according to the methodology outlined in section “Transaction Inputs” of this BIP. Then, they should fix the output indices that depend on the input order, and sort the remaining outputs around them. If there are no outputs that do not depend on input order, then all outputs will simply be ordered based on the expected scheme. The following are the known cases of input/output dependency that must be handled specially:
* SIGHASH_SINGLE hash type. [5] Clients seeking to verify LI01 compliance for a transaction must inspect the last byte of the scriptSig of each input to determine the signature hash type. In the case of SIGHASH_SINGLE (0x03) for input “n”, the verifier should expect that output “n” will be fixed when considering output ordering.
https://github.com/kristovatlas/rfc/blob/master/bips/bip-li01.mediawikiI'm satisfied with this adjustment, as it is unlikely that any software that wants to verify compliance with the BIP will not have access to the scriptSig of each input.