Can output descriptors be used to describe an arbitrary script?

Say I had a script something like the following:

  2 <PubKeyA> <PubKeyB> <PubKeyC> 3 OP_CHECKMULTISIG

That's a two-branch script that either allows a 2-of-3 multisig or a single-address retrieval after a set amount of time. Is there a way to convert that into descriptor that I could then use to derive addresses?

wsh seems focused on set types of scripts, while trying raw on a 32-bit hash of a script gives me Descriptor does not have a corresponding address.

1 Answer 1


Output script descriptors do not currently support any arbitrary script. However once extended by Miniscript, descriptors will be able to support any script logically. Minscript is an extension of descriptors which allows for arbitrary scripts, within certain parameters. While you cannot specify any arbitrary script, you can use Minscript to create an arbitrary script that does what you want. This will not necessarily be the same as an arbitrary script that you come up with, but it will be logically identical.

As of October 2023, Miniscript is becoming more widely used. Under P2WSH, you can import Miniscript descriptors in watchonly mode on Bitcoin Core since version 24.0.1 and sign for them since version 25. The upcoming version 26 will support Miniscript under Tapscript (ie within Taproot descriptors).

  • Thanks, Andrew! I'd seen that the functionality looked possible in miniscript, I appreciate the pointer that it's the way to go.
    – Shannon A.
    May 26, 2021 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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