Skip to content

Commit a067f9c

Browse files
Robert SpiglerRobert Spigler
authored andcommitted
Formatting
1 parent 675c3a8 commit a067f9c

File tree

1 file changed

+13
-28
lines changed

1 file changed

+13
-28
lines changed

Multisig Derivation Standard.mediawiki

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,60 +16,47 @@ This BIP is licensed under the 2-clause BSD license.
1616

1717
==Abstract==
1818

19-
This BIP defines a sane hierarchy for deterministic multisig wallets based on an algorithm described in BIP-0032 (BIP32 from now on), purpose scheme described in
20-
BIP-0043 (BIP43 from now on), and multi-account hierarchy described in BIP-0044 (BIP44 from now on).
19+
This BIP defines a sane hierarchy for deterministic multisig wallets based on an algorithm described in BIP-0032 (BIP32 from now on), purpose scheme described in BIP-0043 (BIP43 from now on), and multi-account hierarchy described in BIP-0044 (BIP44 from now on).
2120

2221
This BIP is a particular application of BIP43.
2322

2423
==Motivation==
2524

26-
With the increase of more user friendly (offline) multisignature wallets, and adoption of new technologies such as
27-
[https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md the descriptor language] and [https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki
28-
BIP-0174 (Partially Signed Bitcoin Transactions)] it is necessary to create a common derivation scheme that makes use of all new technologies.
25+
With the increase of more user friendly (offline) multisignature wallets, and adoption of new technologies such as [https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md the descriptor language] and [https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki BIP-0174 (Partially Signed Bitcoin Transactions)] it is necessary to create a common derivation scheme that makes use of all new technologies.
2926

3027
There are many issues with the current standards. As background, BIP 44/49/84 specifies:
3128

3229
<pre>
3330
m / purpose' / coin_type' / account' / change / address_index
3431
</pre>
3532

36-
where the BIP43 <code>purpose'</code> path is separate for each script (P2PKH, P2WPKH-in-P2SH, and P2WPKH respectively). However, these per-script derivations
37-
are made redundant with descriptors, which describe a collection of output scripts. Note also that these are single sig derivations (which souldn't be reused for
38-
multisig).
33+
where the BIP43 <code>purpose'</code> path is separate for each script (P2PKH, P2WPKH-in-P2SH, and P2WPKH respectively). However, these per-script derivations are made redundant with descriptors, which describe a collection of output scripts. Note also that these are single sig derivations (which shouldn't be reused for multisig).
3934

4035
Standardization is needed for multisig derivation paths. There are some in existence, but all have issues. For example, BIP45 specifies:
4136

4237
<pre>
4338
m / purpose' / cosigner_index / change / address_index
4439
</pre>
4540

46-
Like BIP44/49/84, BIP45 unecessarily demands a single script type (here, P2SH). In addition, BIP45 sets <code>cosigner_index</code> in order to sort the
47-
<code>purpose'</code> public keys of each cosigner. This too is redundant, as descriptors can set the order of the public keys with <code>multi</code> or have
48-
them sorted lexicographically (as described in [https://github.com/bitcoin/bips/blob/master/bip-0067.mediawiki BIP67) with <code>sortedmulti</code>. Sorting
49-
public keys between cosigners in order to create the full derivation path, prior to sending the key record to the coordinator to create the descriptor, merely adds
50-
additional unnecessary communication rounds.
41+
Like BIP44/49/84, BIP45 unecessarily demands a single script type (here, P2SH). In addition, BIP45 sets <code>cosigner_index</code> in order to sort the <code>purpose'</code> public keys of each cosigner. This too is redundant, as descriptors can set the order of the public keys with <code>multi</code> or have them sorted lexicographically (as described in [https://github.com/bitcoin/bips/blob/master/bip-0067.mediawiki BIP67]) with <code>sortedmulti</code>. Sorting public keys between cosigners in order to create the full derivation path, prior to sending the key record to the coordinator to create the descriptor, merely adds additional unnecessary communication rounds.
5142

52-
There is an additional multisig derivation path in use "BIP"48 (there is no real standard), which specifies:
43+
The second multisignature "standard" in use is m/48', which specifies:
5344

5445
<pre>
5546
m / purpose' / coin_type' / account' / script_type' / change / address_index
5647
</pre>
5748

58-
Rather than having a separate BIP per script type after P2SH (BIP45), vendors decided to insert <code>script_type'</code> into the derivation path (where
59-
P2SH-P2WSH=1, P2WSH=2, Future_Script=3, etc). As described previously, this is unnecessary, as the descriptor sets the script. While it attempts to reduce
60-
maintainence work by getting rid of new BIPs-per-script, it still requires maintaining an updated, redundant, script_type list.
49+
Rather than having a separate BIP per script after P2SH (BIP45), vendors decided to insert <code>script_type'</code> into the derivation path (where P2SH-P2WSH=1, P2WSH=2, Future_Script=3, etc). As described previously, this is unnecessary, as the descriptor sets the script. While it attempts to reduce maintainence work by getting rid of new BIPs-per-script, it still requires maintaining an updated, redundant, <code>script_type</code> list.
6150

62-
The hierarchy proposed in this paper is quite comprehensive. It allows the handling of multiple accounts, external and internal chains per account, and millions
63-
of addresses per chain.
51+
The hierarchy proposed later in this paper solves these issues and is quite comprehensive. It allows the handling of multiple accounts, external and internal chains per account, and millions of addresses per chain.
6452

6553
Any script that is supported by descriptors (and the specific wallet implementation) is compatible with this BIP.
6654

6755
This paper was inspired from BIP44.
6856

6957
==Key sorting==
7058

71-
Any wallet that supports descriptors inherently supports deterministic key sorting as per BIP67 (through the <code>sortedmulti</code> function) so that all
72-
possible multisignature addresses/scripts are derived from deterministically sorted public keys.
59+
Any wallet that supports descriptors inherently supports deterministic key sorting as per BIP67 (through the <code>sortedmulti</code> function) so that all possible multisignature addresses/scripts are derived from deterministically sorted public keys.
7360

7461
==Path levels==
7562

@@ -95,7 +82,7 @@ Hardened derivation is used at this level.
9582
One master node (seed) can be used for multiple Bitcoin networks.
9683
Sharing the same space for various networks has some disadvantages.
9784

98-
Avoiding reusing addresses across networks and improving privacy issues.
85+
This level creates a separate subtree for every network, avoiding reusing addresses across networks and improving privacy issues.
9986

10087
Coin type <code>0</code> for mainnet and <code>1</code> for testnet.
10188

@@ -105,8 +92,7 @@ Hardened derivation is used at this level.
10592

10693
This level splits the key space into independent user identities, following the BIP44 pattern, so the wallet never mixes the coins across different accounts.
10794

108-
Users can use these accounts to organize the funds in the same fashion as bank accounts; for donation purposes (where all addresses are considered public), for
109-
saving purposes, for common expenses, etc.
95+
Users can use these accounts to organize the funds in the same fashion as bank accounts; for donation purposes (where all addresses are considered public), for saving purposes, for common expenses, etc.
11096

11197
Accounts are numbered from index 0 in sequentially increasing manner.
11298
This number is used as child index in BIP32 derivation.
@@ -115,9 +101,7 @@ Hardened derivation is used at this level.
115101

116102
===Change===
117103

118-
Constant 0 is used for external chain and constant 1 for internal chain (also known as change addresses). External chain is used for addresses that are meant to be
119-
visible outside of the wallet (e.g. for receiving payments). Internal chain is used for addresses which are not meant to be visible outside of the wallet and is
120-
used for return transaction change.
104+
Constant 0 is used for external chain and constant 1 for internal chain (also known as change addresses). External chain is used for addresses that are meant to be visible outside of the wallet (e.g. for receiving payments). Internal chain is used for addresses which are not meant to be visible outside of the wallet and is used for return transaction change.
121105

122106
Public derivation is used at this level.
123107

@@ -232,6 +216,7 @@ Original mailing list thread: TBD
232216
* [[bip-0032.mediawiki|BIP32 - Hierarchical Deterministic Wallets]]
233217
* [[bip-0043.mediawiki|BIP43 - Purpose Field for Deterministic Wallets]]
234218
* [[bip-0044.mediawiki|BIP44 - Multi-Account Hierarchy for Deterministic Wallets]]
235-
* [[https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md - Output Descriptors]]
219+
* [https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md Output Descriptors]
236220
* [[bip-0174.mediawiki|BIP174 - Partially Signed Bitcoin Transaction Format]]
237221
* [[bip-0067.mediawiki|BIP67 - Deterministic Pay-to-script-hash multi-signature addresses through public key sorting]]
222+

0 commit comments

Comments
 (0)