Why it exists
BIP 67 solves a coordination problem in multisig: identical participant keys can produce different scripts if wallets put the keys in a different order. It specifies compressed public keys and a deterministic sorting rule so participants can reconstruct the same script.
How it works
Each participant public key must use its compressed encoding. The wallet sorts those byte strings lexicographically before placing them into the multisig script. Given the same keys and threshold, compliant implementations obtain the same ordering.
This rule concerns the public keys used in the particular output. In a ranged deterministic wallet, child keys must be derived before sorting. Sorting account xpub strings once is not equivalent: the order of the derived child public keys can change at each address index.
A practical example
Alice lists the three cosigners as A, B, C while Bob imports C, A, B. For a 2-of-3 wallet, sorting the same derived compressed keys gives both participants the same redeem script and, with the same wrapper, the same address.
What to keep in mind
Sorting does not authenticate participants or approve the threshold. It cannot repair a wrong key, wrong derivation path or missing cosigner record. A wallet created with deliberate unsorted key order must retain that order rather than silently applying BIP 67 during recovery.
Status & implementation
The BIP is Complete. BIP 48 explicitly requires its sorting rule, and BIP 383 expresses that behavior through sortedmulti(). The convention operates in wallet construction; it is not a network rule requiring all multisig scripts to sort keys.
Specification status: Complete · Sources checked 13 November 2026
