You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Multisig Derivation Standard.mediawiki
+13-28Lines changed: 13 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,60 +16,47 @@ This BIP is licensed under the 2-clause BSD license.
16
16
17
17
==Abstract==
18
18
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).
21
20
22
21
This BIP is a particular application of BIP43.
23
22
24
23
==Motivation==
25
24
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.
29
26
30
27
There are many issues with the current standards. As background, BIP 44/49/84 specifies:
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).
39
34
40
35
Standardization is needed for multisig derivation paths. There are some in existence, but all have issues. For example, BIP45 specifies:
41
36
42
37
<pre>
43
38
m / purpose' / cosigner_index / change / address_index
44
39
</pre>
45
40
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.
51
42
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:
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.
61
50
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.
64
52
65
53
Any script that is supported by descriptors (and the specific wallet implementation) is compatible with this BIP.
66
54
67
55
This paper was inspired from BIP44.
68
56
69
57
==Key sorting==
70
58
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.
73
60
74
61
==Path levels==
75
62
@@ -95,7 +82,7 @@ Hardened derivation is used at this level.
95
82
One master node (seed) can be used for multiple Bitcoin networks.
96
83
Sharing the same space for various networks has some disadvantages.
97
84
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.
99
86
100
87
Coin type <code>0</code> for mainnet and <code>1</code> for testnet.
101
88
@@ -105,8 +92,7 @@ Hardened derivation is used at this level.
105
92
106
93
This level splits the key space into independent user identities, following the BIP44 pattern, so the wallet never mixes the coins across different accounts.
107
94
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.
110
96
111
97
Accounts are numbered from index 0 in sequentially increasing manner.
112
98
This number is used as child index in BIP32 derivation.
@@ -115,9 +101,7 @@ Hardened derivation is used at this level.
115
101
116
102
===Change===
117
103
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.
121
105
122
106
Public derivation is used at this level.
123
107
@@ -232,6 +216,7 @@ Original mailing list thread: TBD
0 commit comments