Skip to content

Commit 95cf539

Browse files
committed
Improvements from PR review.
- Removed large example of taproot policy; replaced with the textual description - Added an example of a taproot wallet policy containing miniscript
1 parent 40c7760 commit 95cf539

File tree

1 file changed

+9
-47
lines changed

1 file changed

+9
-47
lines changed

bip-0388.mediawiki

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -93,54 +93,13 @@ Once the previously registered policy is correctly identified and approved by th
9393

9494
While reusing a pubkey in different branches of a miniscript is explicitly forbidden by miniscript (as it has certain negative security implications), it is still reasonable to reuse the same xpub in multiple places, albeit with different final steps of derivation (so that the actual pubkeys that are used in the script are indeed different).
9595

96-
For example, using Taproot, a 3-of-5 multisignature wallet could use:
96+
In fact, there are many reasonable spending policies with a quadratic size in the number of participants. For example, using Taproot, a 3-of-5 multisignature wallet could use:
9797
* a key path with a 5-of-5 MuSig2 aggregated key
9898
* a script tree with 11 leaves:
99-
** 10 different script using a 3-of-3 MuSig2 aggregated key, plus
100-
** a final leaf with a fallback 3-of-5 multisignature using <tt>OP_CHECKSIGADD</tt> (in case interactive signing is not available).
99+
** 10 different scripts using a 3-of-3 MuSig2 aggregated key, plus
100+
** a final leaf with a fallback 3-of-5 multisignature using <tt>multi_a</tt> (in case interactive signing is not available).
101101
102-
This could look similar to:
103-
104-
<pre>
105-
tr(musig(xpubA,xpubB,xpubC,xpubD,xpubE)/<0;1>/*), {
106-
{
107-
{
108-
pk(musig(xpubA,xpubB,xpubC)/<2;3>/*),
109-
{
110-
pk(musig(xpubA,xpubB,xpubD)/<4;5>/*)
111-
pk(musig(xpubA,xpubB,xpubE)/<6;7>/*),
112-
}
113-
},
114-
{
115-
pk(musig(xpubA,xpubC,xpubD)/<8;9>/*),
116-
{
117-
pk(musig(xpubA,xpubC,xpubE)/<10;11>/*),
118-
pk(musig(xpubA,xpubD,xpubE)/<12;13>/*)
119-
}
120-
}
121-
},
122-
{
123-
{
124-
pk(musig(xpubB,xpubC,xpubD)/<14;15>/*),
125-
pk(musig(xpubB,xpubC,xpubE)/<16;17>/*)
126-
},
127-
{
128-
pk(musig(xpubB,xpubD,xpubE)/<18;19>/*),
129-
{
130-
pk(musig(xpubC,xpubD,xpubE)/<20;21>/*),
131-
sortedmulti_a(3,
132-
xpubA/<22;23>/*,
133-
xpubB/<22;23>/*,
134-
xpubC/<22;23>/*,
135-
xpubD/<22;23>/*,
136-
xpubE/<22;23>/*)
137-
}
138-
}
139-
}
140-
})
141-
</pre>
142-
143-
Notice how each root xpub appears 8 times. With xpubs being up to 118 bytes long, the length of the full descriptor can get extremely long (the problem rapidly gets worse with larger multisignature schemes).
102+
With each xpub being 118 bytes long, the repetition of xpubs makes the descriptor become extremely large.
144103

145104
Replacing the common part of the key with a short key placeholder and moving the key expression separately helps to keep the size of the wallet policy small, which is crucial to allow human inspection during the registration flow.
146105

@@ -299,8 +258,11 @@ Miniscript: A singlesig wallet with automatic inheritance to a timelocked 2-of-3
299258
Keys info: ["[6738736c/48'/0'/0'/100']xpub6FC1fXFP1GXQpyRFfSE1vzzySqs3Vg63bzimYLeqtNUYbzA87kMNTcuy9ubr7MmavGRjW2FRYHP4WGKjwutbf1ghgkUW9H7e3ceaPLRcVwa", "[b2b1f0cf/44'/0'/0'/100']xpub6EYajCJHe2CK53RLVXrN14uWoEttZgrRSaRztujsXg7yRhGtHmLBt9ot9Pd5ugfwWEu6eWyJYKSshyvZFKDXiNbBcoK42KRZbxwjRQpm5Js", "[a666a867/44'/0'/0'/100']xpub6Dgsze3ujLi1EiHoCtHFMS9VLS1UheVqxrHGfP7sBJ2DBfChEUHV4MDwmxAXR2ayeytpwm3zJEU3H3pjCR6q6U5sP2p2qzAD71x9z5QShK2", "[bb641298/44'/0'/0'/100']xpub6Dz8PHFmXkYkykQ83ySkruky567XtJb9N69uXScJZqweYiQn6FyieajdiyjCvWzRZ2GoLHMRE1cwDfuJZ6461YvNRGVBJNnLA35cZrQKSRJ"]
300259
Descriptor:wsh(or_d(pk([6738736c/48'/0'/0'/100']xpub6FC1fXFP1GXQpyRFfSE1vzzySqs3Vg63bzimYLeqtNUYbzA87kMNTcuy9ubr7MmavGRjW2FRYHP4WGKjwutbf1ghgkUW9H7e3ceaPLRcVwa),and_v(v:multi(2,[b2b1f0cf/44'/0'/0'/100']xpub6EYajCJHe2CK53RLVXrN14uWoEttZgrRSaRztujsXg7yRhGtHmLBt9ot9Pd5ugfwWEu6eWyJYKSshyvZFKDXiNbBcoK42KRZbxwjRQpm5Js,[a666a867/44'/0'/0'/100']xpub6Dgsze3ujLi1EiHoCtHFMS9VLS1UheVqxrHGfP7sBJ2DBfChEUHV4MDwmxAXR2ayeytpwm3zJEU3H3pjCR6q6U5sP2p2qzAD71x9z5QShK2,[bb641298/44'/0'/0'/100']xpub6Dz8PHFmXkYkykQ83ySkruky567XtJb9N69uXScJZqweYiQn6FyieajdiyjCvWzRZ2GoLHMRE1cwDfuJZ6461YvNRGVBJNnLA35cZrQKSRJ),older(65535))))
301260
<br>
302-
303-
TBD: add examples with taproot scripts and miniscript.
261+
Taproot wallet policy with sortedmulti_a and a miniscript leaf
262+
Descriptor template: tr(@0/**,{sortedmulti_a(1,@0/<2;3>/*,@1/**),or_b(pk(@2/**),s:pk(@3/**))})
263+
Keys info: ["[6738736c/48'/0'/0'/100']xpub6FC1fXFP1GXQpyRFfSE1vzzySqs3Vg63bzimYLeqtNUYbzA87kMNTcuy9ubr7MmavGRjW2FRYHP4WGKjwutbf1ghgkUW9H7e3ceaPLRcVwa", "xpub6Fc2TRaCWNgfT49nRGG2G78d1dPnjhW66gEXi7oYZML7qEFN8e21b2DLDipTZZnfV6V7ivrMkvh4VbnHY2ChHTS9qM3XVLJiAgcfagYQk6K", "xpub6GxHB9kRdFfTqYka8tgtX9Gh3Td3A9XS8uakUGVcJ9NGZ1uLrGZrRVr67DjpMNCHprZmVmceFTY4X4wWfksy8nVwPiNvzJ5pjLxzPtpnfEM", "xpub6GjFUVVYewLj5no5uoNKCWuyWhQ1rKGvV8DgXBG9Uc6DvAKxt2dhrj1EZFrTNB5qxAoBkVW3wF8uCS3q1ri9fueAa6y7heFTcf27Q4gyeh6"]
264+
Descriptor:tr([6738736c/48'/0'/0'/100']xpub6FC1fXFP1GXQpyRFfSE1vzzySqs3Vg63bzimYLeqtNUYbzA87kMNTcuy9ubr7MmavGRjW2FRYHP4WGKjwutbf1ghgkUW9H7e3ceaPLRcVwa/<0;1>/*,{sortedmulti_a(1,xpub6FC1fXFP1GXQpyRFfSE1vzzySqs3Vg63bzimYLeqtNUYbzA87kMNTcuy9ubr7MmavGRjW2FRYHP4WGKjwutbf1ghgkUW9H7e3ceaPLRcVwa/<2;3>/*,xpub6Fc2TRaCWNgfT49nRGG2G78d1dPnjhW66gEXi7oYZML7qEFN8e21b2DLDipTZZnfV6V7ivrMkvh4VbnHY2ChHTS9qM3XVLJiAgcfagYQk6K/<0;1>/*),or_b(pk(xpub6GxHB9kRdFfTqYka8tgtX9Gh3Td3A9XS8uakUGVcJ9NGZ1uLrGZrRVr67DjpMNCHprZmVmceFTY4X4wWfksy8nVwPiNvzJ5pjLxzPtpnfEM/<0;1>/*),s:pk(xpub6GjFUVVYewLj5no5uoNKCWuyWhQ1rKGvV8DgXBG9Uc6DvAKxt2dhrj1EZFrTNB5qxAoBkVW3wF8uCS3q1ri9fueAa6y7heFTcf27Q4gyeh6/<0;1>/*))})
265+
<br>
304266

305267
=== Invalid policies ===
306268

0 commit comments

Comments
 (0)