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-wallet-policies.mediawiki
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -201,6 +201,8 @@ Each element of the key origin information vector is a <tt>KEY</tt> expression.
201
201
202
202
The wallet policy is invalid if any placeholder expression with additional derivation steps is used when the corresponding key information is not an xpub.
203
203
204
+
A wallet policy must have at least one key placeholder and the corresponding key.
205
+
204
206
The key information vector should be ordered so that placeholder <tt>@i</tt> never appear for the first time before an occurrence of <tt>@j</tt> for some j < i</tt>; for example, the first placeholder is always <tt>@0</tt>, the next one is <tt>@1</tt>, etc.
205
207
206
208
=== Descriptor derivation ===
@@ -229,7 +231,7 @@ Avoiding key reuse among different wallet accounts is also extremely important,
229
231
230
232
== Examples ==
231
233
232
-
In the examples in this section, the vector of key information items is omitted. See the test vectors below for a complete
234
+
In the examples in this section, the vector of key information items is omitted. See the test vectors below for complete examples.
233
235
234
236
Common single-signature account patterns:
235
237
* <tt>pkh(@0/**)</tt> (legacy).
@@ -239,10 +241,10 @@ Common single-signature account patterns:
239
241
240
242
Common multisignature schemes:
241
243
* <tt>wsh(multi(2,@0,@1))</tt> - SegWit 2-of-2 multisignature, keys in order.
* <tt>wsh(and_v(v:pk(key_user),or_d(pk(key_service),older(12960))))</tt> - Trust-minimized second factor, degrading to a single signature after about 90 days.
247
+
* <tt>wsh(and_v(v:pk(@0),or_d(pk(@1),older(12960))))</tt> - Trust-minimized second factor, degrading to a single signature after about 90 days.
246
248
* <tt>wsh(thresh(3,pk(@0/**),s:pk(@1/**),s:pk(@2/**),sln:older(12960)))</tt> - A 3-of-3 wallet that becomes a 2-of-3 if coins are not spent for about 90 days.
* <tt>wsh(andor(pk(@0/**),or_i(and_v(v:pkh(@1/**),hash160(00112233445566778899aabbccddeeff00112233)),older(1008)),pk(@2/**)))</tt> - BOLT #3 received HTLC policy.
@@ -295,7 +297,7 @@ TBD: add examples with taproot scripts and miniscript.
295
297
296
298
== Backwards Compatibility ==
297
299
298
-
The <tt>@</tt> character used for key placeholders is not part of the syntax of output script descriptors, therefore any valid descriptor template is not a valid descriptor template. Vice versa, any descriptor template with at least one key placeholder is not a valid output script descriptor.
300
+
The <tt>@</tt> character used for key placeholders is not part of the syntax of output script descriptors, therefore any valid output descriptor with at least one `KEY` expression is not a valid descriptor template. Vice versa, any descriptor template with at least one key placeholder is not a valid output script descriptor.
299
301
300
302
Adoption of wallet policies in software and harder wallets is opt-in. Conversion from wallet policies to the corresponding descriptors is programmatically extremely easy, and conversion from descriptors to wallet policies (when respecting the required patterns) can be automated. See the reference implementation below for some examples of conversion.
0 commit comments