Skip to main content
£0.00 0

Basket

No products in the basket.

ASIC mining articles and advice

BIP 67 Sorted Multisig Keys Explained for Deterministic P2SH

BIP 67 Sorted Multisig Keys made simple. See what the proposal changes, its current status and what it means for Bitcoin users and operators.

BIP 67 Deterministic Pay-to-script-hash multi-signature addresses through public key sorting guide cover

BIP 67 Sorted Multisig Keys: This guide explains BIP 67 Deterministic Pay-to-script-hash multi-signature addresses through public key sorting 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 67 makes a legacy P2SH multisignature account deterministic by requiring compressed public keys to be sorted lexicographically by their binary encoding before the redeem script is built. Without a shared order, the same keys and threshold can produce many valid scripts and addresses.
  • Why it matters: BIP 67 removes key-order ambiguity from legacy P2SH multisig through one simple binary sort. That determinism is valuable only when compressed keys, threshold, origins and script wrapper are all preserved and independently verified.
  • Current position: The BIP is Complete as an application convention; Bitcoin consensus cannot infer or enforce the intended key order behind a script hash.

BIP 67 Sorted Multisig Keys in simple English

BIP 67 Sorted Multisig Keys: A multisig redeem script serialises M, each public key in sequence, N and CHECKMULTISIG. Reordering keys changes the script bytes, HASH160 commitment and P2SH address even though the same quorum could sign.

Simple example

A node operator is checking BIP 67 Sorted Multisig Keys. For N keys there can be many permutations, multiplied further when compressed and uncompressed encodings are mixed.

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 changes the address

A multisig redeem script serialises M, each public key in sequence, N and CHECKMULTISIG. Reordering keys changes the script bytes, HASH160 commitment and P2SH address even though the same quorum could sign. For N keys there can be many permutations, multiplied further when compressed and uncompressed encodings are mixed.

Compressed keys only

BIP 67 accepts the 33-byte compressed public-key representation beginning with 02 or 03. An uncompressed key signals incompatible software and must not be silently compressed because that transformation changes the agreed script input. Participants should exchange and validate canonical public-key bytes before funding.

Binary lexicographic sorting

Implementations compare full compressed byte arrays from the first byte onward and order them ascending. Sorting displayed hexadecimal text gives the same result only when it faithfully represents those fixed-length bytes with consistent case and no prefixes. Locale-aware or natural-number sorting is incorrect.

BIP 67 Deterministic Pay-to-script-hash multi-signature addresses through public key sorting technical diagram
Binary lexicographic sorting: the fields, validation boundary and operational evidence that implementations need to agree.

Building the redeem script

After sorting, software inserts the threshold and ordered keys into a standard multisig script, then applies BIP 16 script hashing and network encoding. Every cosigner should derive the exact script and address independently. A matching display address is useful; a matching script hash and redeem-script bytes are stronger evidence.

Application convention, not consensus

P2SH hides the redeem script until spending, so the network cannot know whether a wallet followed BIP 67 at funding time. Enforcing a particular order globally would change validity expectations. Compatibility depends on every wallet participant and recovery tool intentionally applying the same convention.

Recovery and service independence

Sorted keys let a user with the threshold and participant public data reconstruct addresses without a specific service provider. The benefit disappears if origins, derivation paths or wrapper are missing. Modern descriptors can state sortedmulti explicitly and should be checked against historical P2SH scripts before migration.

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 67 Sorted Multisig Keys?

BIP 67 Sorted Multisig Keys: A multisig redeem script serialises M, each public key in sequence, N and CHECKMULTISIG.

For BIP 67 Sorted Multisig Keys, why ordering changes the address?

A multisig redeem script serialises M, each public key in sequence, N and CHECKMULTISIG.

For BIP 67 Sorted Multisig Keys, what should a beginner know about compressed keys only?

BIP 67 accepts the 33-byte compressed public-key representation beginning with 02 or 03.

For BIP 67 Sorted Multisig Keys, what should a beginner know about binary lexicographic sorting?

Implementations compare full compressed byte arrays from the first byte onward and order them ascending.

Conclusion

BIP 67 removes key-order ambiguity from legacy P2SH multisig through one simple binary sort. That determinism is valuable only when compressed keys, threshold, origins and script wrapper are all preserved and independently verified.

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.

ASIC MINER PICKS

Recommended ASIC Mining Hardware

Compare three of our highest ranked ASIC miners currently available, with live product details and pricing.
Browse all ASIC miners
MORE MINING ADVICE

More ASIC Mining Articles

Read practical advice about choosing hardware, calculating electricity costs, setting up miners, hosting and maintenance.
MINER COMMUNITY

Join the ASIC Mining Discussion

Ask a question or share what has worked for you. Your experience may help another miner make a better decision.

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.

Log in to read comments Register to join the discussion

Membership helps us protect the discussion from spam and keep answers useful.

ASIC MINING SUPPORT

Need Help Choosing an ASIC Miner?

Tell us what you want to mine, your electricity cost and where the machine will run. We can help you compare hardware, power requirements, hosting and repairs.
Contact our mining team
Browse ASIC miners