descriptor: reject OP_IF/OP_NOTIF in Taproot miniscript under reduced-data#320
Open
kwsantiago wants to merge 2 commits into
Open
descriptor: reject OP_IF/OP_NOTIF in Taproot miniscript under reduced-data#320kwsantiago wants to merge 2 commits into
kwsantiago wants to merge 2 commits into
Conversation
|
ACK d97ca9d I reviewed the code with Code Rabbit, and it only had this nit in wallet_miniscript.py (lines 345-358): I tested using the following commands on Ubuntu 24.04 running on ARM: |
The guard test exercised or_c/or_d and or_i but not andor, j: (WRAP_J), or d: (WRAP_D). Pin each remaining fragment individually so dropping any single case from the parser switch cannot silently re-enable it.
|
ACK c8fae19 I reviewed the code with CodeRabbit and found no issues. I tested using the following commands on Ubuntu 24.04 running on ARMv8-A (64-bit): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reduced-data (RDTS) invalidates tapscripts that execute OP_IF/OP_NOTIF, so a Taproot output whose leaf uses them can't be spent. The wallet could still create such descriptors via miniscript (or_c, or_d, or_i, andor, and the d:/j:/l:/u: wrappers).
This rejects those fragments at descriptor parse time in Tapscript context, the same layer and style as the existing tr() nesting-depth cap. It applies to create, import and watch alike, matching how deep taptrees are already handled. P2WSH is unaffected (OP_IF is valid there); inference is unaffected.
Tests: adds a guard test to wallet_miniscript.py; updates two descriptor_tests.cpp vectors that used l:pk (an or_i) tapscript leaf, now invalid, to non-branching leaves with recomputed scriptPubKeys.