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: bip-xxxx.mediawiki
+50-13
Original file line number
Diff line number
Diff line change
@@ -28,21 +28,59 @@ This document introduces a mechanism to compute a NUMS (Nothing Up My Sleeve) po
28
28
29
29
==Specification==
30
30
31
-
A new key expression is defined: <tt>unspendable()</tt>.
31
+
A new key expression is defined: <tt>unspendable()/NUM/.../*</tt>.
32
32
33
-
===<tt>unspendable(KEY, KEY, ..., KEY)</tt>===
33
+
===<tt>unspendable()/NUM/.../*</tt>===
34
34
35
-
The vector of keys is processed in the following sequence: deduplication, compression, sorting, concatenation, and finally, SHA256 hashing to generate a chaincode <tt>r</tt>.
36
-
A new unspendable key is constructed by taking the NUMS point <tt>H</tt>, suggested in BIP-0341, and attaching the chaincode <tt>r</tt> we previously computed.
37
-
<tt>H + r*G</tt> where <tt>H = lift_x(0x50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0)</tt>
35
+
The <tt>unspendable</tt> expression can only be used as the first argument of a BIP386 <tt>tr(KEY, TREE)</tt> expression. All other <tt>KEY</tt> expressions in the descriptor must be <tt>xpub</tt> encoded extended public keys with exactly 2 unhardened derivation steps. The derivation steps may include <tt>/*</tt> or a BIP389 multipath expression, but still must have only unhardened steps. Additionally, BIP390 <tt>musig</tt> expressions are forbidden.
38
36
39
-
Q: should we add a prefix like the "BIPXXXX" before we SHA256 the keys to ensure the preimage was not previously leaked before this BIP?
40
-
Q: is it desireable to specify the keys in the expressions or to extract it from the script expression indirectly?
41
-
Q: compress first and then sort, or sort and then compress?
37
+
The <tt>unspendable</tt> expression resolves to an extended public key, which is then further derived. As there is no aggregate private key for an unspendable key, only unhardened derivation is allowed.
38
+
39
+
The extended public key is computed by first collecting the public key from all the extended public keys in all the <tt>KEY</tt> expressions. The collection of public keys then has all duplicates removed and the remaining public keys are sorted lexicographically.
40
+
The vector of keys is processed in the following sequence: deduplication, compression, sorting, concatenation, and finally, SHA256 hashing to generate a chaincode <tt>c</tt>.
41
+
The unspendable BIP32 extended key is constructed by using the NUMS point <tt>H</tt>, suggested in BIP341, as the public key, and the chaincode <tt>c</tt> is computed as follows:
42
+
* The public keys are collected from all extended public keys in all <tt>KEY</tt> expressions.
43
+
* All duplicate public keys are removed from the collection and the public keys are sorted lexicographically.
44
+
* Let ''P<sub>0</sub> ... P<sub>n</sub>'' be the sorted and deduplicated public keys. Using the notation from BIP340, ''c = hash<sub>BIP0???/chaincode</sub>(bytes(P<sub>0</sub>) || ... || bytes(P<sub>n</sub>))''.
42
45
43
46
==Test Vectors==
44
47
45
-
TBD Andew
48
+
Valid descriptors containing the <tt>unspendable</tt> expression followed by the chaincode of the unspendable extended public key they expand to and then the scripts they produce.
49
+
Todo: These will be filled in when the BIP number is assigned for the tagged hash.
50
+
51
+
The following produce identical extended public keys and scripts:
The following has two identical public keys which are deduplicated, and then the remaining two public keys are sorted:xpub68Gmy5EdvgibQVfPdqkBBCHxA5htiqg55crXYuXoQRKfDBFA1WEjWgP6LHhwBZeNK1VTsfTFUHCdrfp1bgwQ9xv5ski8PX9rL2dZXvgGDnw
* Verifiability of unspendable constructions by participants, without exposing this property to outside observers.
52
90
* Security and simplicity for signers with limited information (e.g., hardware wallets).
53
91
92
+
==Backwards Compatibility==
54
93
55
-
==Reference Implementation==
56
-
57
-
TBD
94
+
This is backwards compatible with BIP386 by computing the unspendable key as a BIP380 <tt>KEY</tt> expression and replacing the <tt>unspendable</tt> expression as the first argument of the <tt>tr()</tt> expression.
58
95
59
96
==Acknowledgements==
60
97
61
98
Thanks to Salvatore Ingala, Pieter Wuille, Antoine Poinsot, Andrew Kozlik and all others who
0 commit comments