BIPs 0067 · 0048
How do cosigners end up with the same multisig address?
A 2-of-3 script lists three keys in some order, and each order gives a different address. BIP 67 sorts the keys by their bytes first, so every cosigner builds the same script.
A multisignature script lists its public keys in an order, and the order is part of the script. Change the order and the script's hash changes, and with it the P2SH address. The redeem script requires no particular order or encoding. BIP 67's authors count as many as 2(n!) standard scripts for one set of keys and one threshold, each with its own address.1
BIP 67 removes the choice. Keys must arrive compressed, and they are sorted by their bytes before the script is built. Wallets that follow it get one script and one address from the same keys and threshold, without the cosigners ever agreeing on an order.234
Source details
This chapter is an independent explanation, not the proposal itself. Preamble fields are shown as the pinned files record them, without author e-mail addresses. Status is the proposal’s own field. It is not an endorsement or a sign of consensus.
BIP 67: Deterministic Pay-to-script-hash multi-signature addresses through public key sorting
- BIP
- 67
- Layer
- Applications
- Title
- Deterministic Pay-to-script-hash multi-signature addresses through public key sorting
- Authors
- Thomas Kerin
Jean-Pierre Rupp
Ruben de Vries - Status
- Complete
- Type
- Specification
- Assigned
- 2015-02-08
- License
- PD
BIP 48: Multi-Script Hierarchy for Multi-Sig Wallets
- BIP
- 48
- Layer
- Applications
- Title
- Multi-Script Hierarchy for Multi-Sig Wallets
- Authors
- Fontaine
- Status
- Deployed
- Type
- Specification
- Assigned
- 2020-12-16
- License
- MIT
Fig. A20.1 Six orders, one address once the keys are sorted
Static view: the keys as the vector lists them, sorted first. With JavaScript you can try all six orders, with and without sorting.
Received A, B, C and used as received: the script gives 3AdQeG1eNTKxT2VKeddnZxdQbU5PeCfuk6, not BIP 67's address. The six orders give 6 different addresses.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
5221022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e921021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1853ae- Address
3AdQeG1eNTKxT2VKeddnZxdQbU5PeCfuk6
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received A, B, C, sorted to C, A, B: the script gives 3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba, BIP 67's published address. All six orders give this one address.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
5221021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1821022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e953ae- Address
3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received A, C, B and used as received: the script gives 34TSib4s78EoH3s4qHcBZUEXtA7utsfwSf, not BIP 67's address. The six orders give 6 different addresses.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
5221022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da21021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc182103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e953ae- Address
34TSib4s78EoH3s4qHcBZUEXtA7utsfwSf
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received A, C, B, sorted to C, A, B: the script gives 3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba, BIP 67's published address. All six orders give this one address.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
5221021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1821022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e953ae- Address
3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received B, A, C and used as received: the script gives 3Abr6fSGPe2TDRuzxJj5QKxn6gBpYgcnVj, not BIP 67's address. The six orders give 6 different addresses.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
522103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e921022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da21021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1853ae- Address
3Abr6fSGPe2TDRuzxJj5QKxn6gBpYgcnVj
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received B, A, C, sorted to C, A, B: the script gives 3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba, BIP 67's published address. All six orders give this one address.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
5221021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1821022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e953ae- Address
3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received B, C, A and used as received: the script gives 3ErYtkQWMc5f85eJCGnuAzdHEm9zDhJFUv, not BIP 67's address. The six orders give 6 different addresses.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
522103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e921021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1821022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da53ae- Address
3ErYtkQWMc5f85eJCGnuAzdHEm9zDhJFUv
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received B, C, A, sorted to C, A, B: the script gives 3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba, BIP 67's published address. All six orders give this one address.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
5221021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1821022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e953ae- Address
3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received C, A, B and used as received: the script gives 3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba: this order is already sorted, so it gives BIP 67's address. The six orders give 6 different addresses.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
5221021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1821022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e953ae- Address
3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received C, A, B, sorted to C, A, B: the script gives 3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba, BIP 67's published address. All six orders give this one address.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
5221021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1821022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e953ae- Address
3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received C, B, A and used as received: the script gives 3PU4MAYoTDgNKAqMBZxps2uMJ3fwkZ2XDB, not BIP 67's address. The six orders give 6 different addresses.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
5221021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc182103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e921022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da53ae- Address
3PU4MAYoTDgNKAqMBZxps2uMJ3fwkZ2XDB
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Received C, B, A, sorted to C, A, B: the script gives 3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba, BIP 67's published address. All six orders give this one address.
Exact values
- Key A
022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da- Key B
03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9- Key C
021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18- Script (105 bytes)
5221021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1821022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e953ae- Address
3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba
BIP 67 line 105 (vector 4). Sorted keys, script and address equal the vector; unsorted orders are built by the same tested model. Public test keys: never send funds to these addresses.
Sorting by bytes
The sort is lexicographic on the keys' binary form: compare the first bytes, and only if they are equal compare the next ones. A compressed key starts with 02 or 03, so every key with the prefix 02 comes before every key with 03, whatever follows.47
BIP 67's third vector shows both cases: four keys that differ only in their prefix and in their last byte. In the sorted list, neighbouring keys first differ at byte 33, then at byte 1, then at byte 33 again.67
Fig. A20.2 The first different byte decides
Only compressed keys take part. An uncompressed key from a cosigner is a sign of an incompatible implementation, and a wallet should not compress it on its own.38
From keys to an address
The sorted keys go into the standard script: OP_2 for the threshold, one push per key, OP_3 for the number of keys, and OP_CHECKMULTISIG. For vector 4 that is 105 bytes. Hashing it as BIP 16 specifies gives the P2SH address 3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba.6910
Fig. A20.3 From sorted keys to an address
Sort the 3 keys by their bytes: C, A, B.
Build the script: OP_2, 3 pushes of 33 bytes, OP_3, OP_CHECKMULTISIG: 105 bytes.
HASH160 of the script gives 20 bytes: f574ac35…
Base58Check with version 05 gives the address 3Q4sF6tv9w…
Exact values
- Script (105 bytes)
5221021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1821022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e953ae- HASH160
f574ac35105dfc2f4228d6c3f0ec0f7b9cd04efb
The authors' aim is that compliant wallets always produce the same address for the same keys, which also makes the account's transactions easier to recognize. For an HD multisig wallet, they add, the cosigners then only need to share the threshold and their master public keys.11
Where the keys come from
BIP 48 names the paths multisig wallets derive those keys at: m / purpose' / coin_type' / account' / script_type' / change / address_index, with purpose 48'. The first four levels are hardened; change and index are not. A master public key cannot reach past hardened levels, so under BIP 48 each cosigner shares the extended public key at the script-type level instead. BIP 48 writes down a practice wallets already followed.12131415
As written, it covers two script types: P2WSH at script type 2', the recommended default, and P2SH-wrapped P2WSH at 1'. Each cosigner derives keys under this hierarchy from their own seed. For each address, BIP 48 wallets sort the cosigners' keys at that change and index as BIP 67 describes. A cosigner's place in the script can therefore differ from one address to the next.161718
Fig. A20.4 BIP 48's example paths
What sorting cannot do
A P2SH address shows only a hash, so nothing about the keys is visible when coins are paid to it. The authors conclude that BIP 67 cannot be a network rule. It works only when every cosigner's wallet follows it. A participant whose wallet does not may derive an address the others do not recognize as part of their account.2021
Sorting decides which of the possible scripts the keys produce. It does not change how many signatures a spend needs or whose keys can provide them.22
The authors expect the convention to help a user of a 2-of-3 wallet service recover the wallet without that service.23
Evidence
Each numbered marker in the text points here, and the ↩ links lead back to the text. Quotes are verbatim
from the BIP files at commit 3a10b5b, wiki markup
included. Links open the exact lines. Labels say what kind of statement each entry is: a rule, the
author’s rationale, history, a test vector, or our own inference.
-
↩ Author’s rationale BIP 67's authors note that the redeem script needs no particular key order or encoding, and count as many as 2(n!) standard redeem scripts for a key set and threshold, each with its own P2SH address.
Quoted source text (1)
The redeem script does not require a particular ordering or encoding for public keys. This means that for a given set of keys and number of required signatures, there are as many as 2(n!) possible standard redeem scripts, each with its separate P2SH address.
-
↩ Rule BIP 67 defines how the public keys are encoded and sorted, so that a given set of keys and required signatures always gives the same redeem script and P2SH address.
Quoted source text (1)
It focuses on defining how the public keys must be encoded and sorted so that the redeem script and corresponding P2SH address are always the same for a given set of keys and number of required signatures.
-
↩ a b Rule BIP 67 starts by making sure every key was received in compressed form.
Quoted source text (1)
For a set of public keys, ensure that they have been received in compressed form:
-
↩ a b c d Rule The keys are sorted lexicographically by their binary representation before the standard multisig redeem script is built.
Quoted source text (2)
Sort them lexicographically according to their binary representation:
..before using the resulting list of keys in a standard multisig redeem script:
-
↩ Test vector For vector 4's three keys, the six possible orders give six different scripts and addresses when used as received; sorted first, all six give the vector's address. The model computes the unsorted ones; BIP 67 publishes only the sorted result.
Quoted source text (2)
there are as many as 2(n!) possible standard redeem scripts, each with its separate P2SH address.
3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba
-
↩ a b c d e Test vector The model reproduces all four BIP 67 vectors, each 2-of-n: the sorted lists, the redeem scripts and the P2SH addresses.
BIP 67 L61 BIP 67 L105 BIP 67 L117
Quoted source text (3)
Two signatures are required in each of these test vectors.
Vector 4: (from bitcore)
3Q4sF6tv9wsdqu2NtARzNCpQgwifm2rAba
-
↩ a b c Test vector Sorting compares the keys' bytes from the left, and the first byte that differs decides: vector 3's sorted keys first differ at byte 33, then byte 1, then byte 33.
Quoted source text (2)
Sort them lexicographically according to their binary representation:
** 020000000000000000000000000000000000004141414141414141414141414140 ** 020000000000000000000000000000000000004141414141414141414141414141 ** 030000000000000000000000000000000000004141414141414141414141414140 ** 030000000000000000000000000000000000004141414141414141414141414141
-
↩ Rule Uncompressed keys are incompatible: an implementation should not compress them automatically, and an uncompressed key from a participant signals an incompatible implementation.
Quoted source text (1)
Uncompressed keys are incompatible with this specification. A compatible implementation should not automatically compress keys. Receiving an uncompressed key from a multisig participant should be interpreted as a sign that the user has an incompatible implementation.
-
↩ a b Test vector Vector 4's redeem script is OP_2, three 33-byte key pushes, OP_3 and OP_CHECKMULTISIG: 105 bytes.
Quoted source text (2)
OP_2 021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18 022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da 03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9 OP_3 OP_CHECKMULTISIG
5221021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1821022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e953ae
-
↩ a b Rule The redeem script is hashed as BIP 16 specifies to give the P2SH address.
Quoted source text (1)
Hash the redeem script according to BIP-0016 to get the P2SH address.
-
↩ Author’s rationale The authors' motivation: compliant wallets always produce the same address for the same keys and threshold, which makes the account's transactions easier to recognize; for HD multisig wallets only the threshold and the participants' master public keys need sharing.
Quoted source text (1)
compliant wallets will always produce the same P2SH address for the same given set of keys and required signature count, making it easier to recognize transactions involving that multi-signature account. This is particularly attractive for multisignature hierarchical-deterministic wallets, as less state is required to setup multi-signature accounts: only the number of required signatures and master public keys of participants need to be shared
-
↩ a b Rule BIP 48 paths are m / purpose' / coin_type' / account' / script_type' / change / address_index, with purpose 48' and coin type 0 for mainnet or 1 for testnet; an apostrophe marks hardened derivation.
BIP 48 L58 BIP 48 L61 BIP 48 L67 BIP 48 L79
Quoted source text (4)
m / purpose' / coin_type' / account' / script_type' / change / address_index
<code>h</code> or <code>'</code> in the path indicates that BIP32 hardened derivation is used.
Purpose is a constant set to 48' following the BIP43 recommendation.
Coin type <code>0</code> for mainnet and <code>1</code> for testnet.
-
↩ Rule The last two levels use public (normal) derivation: change is 0 for receiving addresses and 1 for change, and addresses are numbered from 0.
BIP 48 L116–117 BIP 48 L122 BIP 48 L126 BIP 48 L129
Quoted source text (4)
Constant 0 is used for external chain and constant 1 for internal chain (also known as change addresses).
Public derivation is used at this level.
Addresses are numbered from index 0 in sequentially increasing manner.
Public derivation is used at this level.
-
↩ Editorial inference BIP 48's first four levels are hardened, and BIP 32 defines public derivation only for non-hardened children, so a master public key cannot give a cosigner's keys at a BIP 48 path; what a cosigner can share is the extended public key at the script-type level, below which change and index use public derivation.
BIP 48 L58–61 BIP 48 L122 BIP 32 L87
Quoted source text (3)
m / purpose' / coin_type' / account' / script_type' / change / address_index </pre> <code>h</code> or <code>'</code> in the path indicates that BIP32 hardened derivation is used.
Public derivation is used at this level.
It is only defined for non-hardened child keys.
-
↩ Author’s rationale BIP 48 writes down the existing industry practice of m/48' paths for multisig wallets, and lets future script types be appended without a new BIP.
Quoted source text (1)
The motivation of this BIP is to define the existing industry wide practice of utilizing m/48' derivation paths in hierarchical deterministic multi-sig wallets so that other developers may benefit from a standard. This BIP allows for future script types to easily be appended to the specification so that a new BIP is not required for every future script type.
-
↩ a b Rule As written, BIP 48 covers two script types, native SegWit P2WSH at script type 2' and nested P2SH-P2WSH at 1', and it can be extended with more; P2WSH, m/48'/0'/0'/2', is the recommended default.
BIP 48 L103–104 BIP 48 L107 BIP 48 L110 BIP 48 L112 BIP 48 L29–30
Quoted source text (5)
Currently the only script types covered by this BIP are Native Segwit (p2wsh) and Nested Segwit (p2sh-p2wsh).
<code>1'</code>: Nested Segwit (p2sh-p2wsh)
<code>2'</code>: Native Segwit (p2wsh)
The recommended default for wallets is pay to witness script hash <code>m/48'/0'/0'/2'</code>.
This BIP allows for future script types to easily be appended to the specification so that a new BIP is not required for every future script type.
-
↩ a b Rule BIP 48 wallets inherently sort keys as BIP 67 describes, so every multisig address and script they make comes from sorted public keys.
Quoted source text (1)
Any wallet that supports BIP48 inherently supports deterministic key sorting as per BIP67 so that all possible multi-signature addresses/scripts are derived from deterministically sorted public keys.
-
↩ Editorial inference Each cosigner derives keys under BIP 48's hierarchy from their own seed; for each address the keys sorted are the cosigners' keys at that change and index, so one cosigner's place in the script can differ from one address to the next.
Quoted source text (2)
Any wallet that supports BIP48 inherently supports deterministic key sorting as per BIP67 so that all possible multi-signature addresses/scripts are derived from deterministically sorted public keys.
Addresses are numbered from index 0 in sequentially increasing manner. This number is used as child index in BIP32 derivation.
-
↩ Test vector The model reproduces every path in BIP 48's examples table from the table's other columns.
Quoted source text (2)
==Examples==
m / 48' / 0' / 0' / 2' / 0 / 0
-
↩ Author’s rationale The authors note that a P2SH address reveals nothing about the script receiving the funds, and conclude that BIP 67 cannot be enforced as a network rule; doing so would also be a hard fork.
Quoted source text (1)
P2SH addresses do not reveal information about the script that is receiving the funds. For this reason it is not technically possible to enforce this BIP as a rule on the network. Also, it would cause a hard fork.
-
↩ Author’s rationale The authors warn that if a group is not entirely compliant, a participant may derive an address the others do not recognize as part of their shared account.
Quoted source text (1)
If a group of users were not entirely compliant, there is the possibility that a participant will derive an address that the others will not recognize as part of the common multisig account.
-
↩ Editorial inference The key order inside the script decides which of the possible scripts a key set produces; it does not change the number of required signatures or the keys that can provide them. This follows from BIP 67 fixing only order and encoding; it does not say so in these words.
Quoted source text (2)
how the public keys must be encoded and sorted so that the redeem script and corresponding P2SH address are always the same for a given set of keys and number of required signatures.
The redeem script does not require a particular ordering or encoding for public keys.
-
↩ Author’s rationale The authors expect the convention to let someone other than a 2-of-3 wallet service recover the wallet without the service's help.
Quoted source text (1)
Many wallet as a service providers use a 2of3 multi-signature schema where the user stores 1 of the keys (offline) as backup while using the other key for daily use and letting the service cosign his transactions. This standard will help in enabling a party other than the service provider to recover the wallet without any help from the service provider.
-
↩ History BIP 67 (Kerin, Rupp, de Vries) was assigned in 2015 and is recorded as Complete; it is a Specification in the Applications layer.
Quoted source text (1)
Layer: Applications Title: Deterministic Pay-to-script-hash multi-signature addresses through public key sorting Authors: Thomas Kerin <me@thomaskerin.io> Jean-Pierre Rupp <root@haskoin.com> Ruben de Vries <ruben@rubensayshi.com> Status: Complete Type: Specification Assigned: 2015-02-08
-
↩ History BIP 48 (Fontaine) was assigned in 2020 and is recorded as Deployed.
Quoted source text (1)
Title: Multi-Script Hierarchy for Multi-Sig Wallets Authors: Fontaine <dentondevelopment@protonmail.com> Status: Deployed Type: Specification Assigned: 2020-12-16