Commit d705b70
committed
descriptor-policy: add a flag for enforcing unique keypaths in policies
Also fix and test a few edge cases in ensuring substitution invariants.
The relevant BIP makes this mandatory, however given it is somewhat
expensive to verify, and the security concerns mentioned seem to only
relate to miniscript malleation via old tx signatures, make it opt-in.
It would be nice to support ensuring this for non-policy miniscript
descriptors. But, given the combination of possible descriptor key types
and path expressions I do not believe it is feasible for any implementation
to do this correctly without exactly the other limits that policies
enforce. A general solution would have to solve all possible paths and derive
all combinations of allowed keys which is not trivial to prove correct and
extremely compute intensive and thus not feasible on HWW.1 parent 1e3eac7 commit d705b70
File tree
5 files changed
+109
-23
lines changed- include
- src
- ctest
- test
- wasm_package/src
5 files changed
+109
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1008 | 1008 | | |
1009 | 1009 | | |
1010 | 1010 | | |
1011 | | - | |
| 1011 | + | |
1012 | 1012 | | |
1013 | | - | |
1014 | | - | |
| 1013 | + | |
| 1014 | + | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
| |||
1937 | 1937 | | |
1938 | 1938 | | |
1939 | 1939 | | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
1940 | 1947 | | |
1941 | 1948 | | |
1942 | 1949 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
| 208 | + | |
| 209 | + | |
207 | 210 | | |
208 | 211 | | |
209 | 212 | | |
| |||
381 | 384 | | |
382 | 385 | | |
383 | 386 | | |
384 | | - | |
| 387 | + | |
385 | 388 | | |
386 | 389 | | |
387 | 390 | | |
| |||
427 | 430 | | |
428 | 431 | | |
429 | 432 | | |
430 | | - | |
431 | 433 | | |
432 | 434 | | |
433 | 435 | | |
| |||
453 | 455 | | |
454 | 456 | | |
455 | 457 | | |
456 | | - | |
457 | | - | |
458 | 458 | | |
459 | 459 | | |
| 460 | + | |
| 461 | + | |
460 | 462 | | |
461 | 463 | | |
462 | 464 | | |
| |||
2633 | 2635 | | |
2634 | 2636 | | |
2635 | 2637 | | |
2636 | | - | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
2637 | 2641 | | |
2638 | 2642 | | |
| 2643 | + | |
| 2644 | + | |
2639 | 2645 | | |
2640 | 2646 | | |
2641 | 2647 | | |
| |||
2973 | 2979 | | |
2974 | 2980 | | |
2975 | 2981 | | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
| 295 | + | |
294 | 296 | | |
295 | 297 | | |
296 | | - | |
| 298 | + | |
297 | 299 | | |
298 | | - | |
| 300 | + | |
299 | 301 | | |
300 | | - | |
| 302 | + | |
301 | 303 | | |
302 | | - | |
| 304 | + | |
303 | 305 | | |
304 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
305 | 309 | | |
306 | | - | |
307 | | - | |
308 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
309 | 319 | | |
310 | 320 | | |
311 | | - | |
| 321 | + | |
312 | 322 | | |
313 | | - | |
| 323 | + | |
314 | 324 | | |
315 | 325 | | |
316 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
0 commit comments