Blockchain concepts explained with care and context.

BIP 67 sorts public keys before a multisignature script is built

Hardware wallet and three small unbranded signing devices on a desk beside a notebook.
AI-generated photographic illustration; not documentary photography.

Suppose three participants agree on a two-of-three Bitcoin multisignature arrangement. They share the same public keys and threshold, but construct the script with the keys in different orders. The resulting scripts, and therefore their P2SH addresses, can differ.

Give the keys a common order

BIP 67 addresses this by specifying compressed public keys sorted lexicographically by their binary representation before constructing the standard multisignature redeem script. With the same keys and required signature count, compliant implementations can derive the same script and address.

The sorting is about the encoded key bytes. It is not alphabetical ordering of participants’ names, the order in which they joined or a ranking of who should sign first.

The threshold does not change

A two-of-three arrangement still requires two valid signatures under its script. Sorting keys does not turn it into a different threshold, add another participant or improve the secrecy of a private key. Its contribution is deterministic construction and interoperability.

The specification also treats uncompressed keys as incompatible input rather than instructing an implementation to silently compress them. That detail helps expose a mismatch between participants’ implementations instead of hiding it.

Use public test vectors for learning

A useful educational test is to take one of the BIP’s published vectors, permute the input key order and confirm that a compliant implementation reproduces the specified script and address. Perform this with the supplied public test data in a development environment, never by entering a real wallet’s seed into an online converter.

Then test an intentionally incompatible input and confirm it is handled explicitly. Reproducing only a successful example does not show that the implementation rejects the cases the specification excludes.

Recovery still needs the wallet’s full design

BIP 67 concerns a particular script-construction convention. It is not a complete backup or recovery format for every multisignature wallet, nor a network-wide rule forcing all scripts to use sorted keys.

For an actual wallet, retain the recovery information required by that wallet’s documented policy, including the relevant script or descriptor information and key derivation details. A remembered phrase such as “two of three, sorted keys” is not a substitute for a verified recovery plan.