The question: is the following description of the behavior of these fragments correct?

The or_i fragment and d: wrappers all have an IF in their script that does not take the value from the argument(s), but from some external source. This external source cannot be the result of another miniscript fragment, because the fragments are composed as nested expression, not as a sequence of actions. This means that an input to IF in or_i, d: have to come from the witness that is specified at the spending time (that should be 1 or 0 due to MINIMALIF).

EDIT: removed j: wrapper from the question and the description because it does not take the value from external source, it just checks for the size of the data that X consumes

1 Answer 1


Correct. A Miniscript satisfier needs to provide the 0/1 in the witness for these fragments.

To give more than a one-word answer, we assume MINIMALIF in our analysis (for size/fee estimation). Our original design enforced it in script using the opcodes SIZE EQUALVERIFY, but we dropped it because our design assumes standardness everywhere. (If we did not assume standardness we'd have a lot of very expensive checks to add to avoid malleability ... e.g. to check that signatures are either valid or empty is pretty expensive to do in Script).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.