<p>Output script descriptors do not currently support any arbitrary script. However once extended by <a href="http://bitcoin.sipa.be/miniscript/" rel="nofollow noreferrer">Miniscript</a>, 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.</p>
<hr />
<p>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).</p>

CC BY-SA 4.0
2021-05-26T06:12:50.750Z
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.
CC BY-SA 4.0
2021-05-26T02:19:10.413Z
2023-10-19T16:27:29.067Z
2023-10-19T16:27:29.067Z
Ava Chow
<p>Can output descriptors be used to describe an arbitrary script?</p>
<p>Say I had a script something like the following:</p>
<pre><code>OP_IF
  1737417600 OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160 &lt;pubKeyHashD&gt; OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
  2 &lt;PubKeyA&gt; &lt;PubKeyB&gt; &lt;PubKeyC&gt; 3 OP_CHECKMULTISIG
OP_ENDIF
</code></pre>
<p>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?</p>
<p><code>wsh</code> seems focused on set types of scripts, while trying <code>raw</code> on a 32-bit hash of a script gives me <code>Descriptor does not have a corresponding address</code>.</p>

<multi-signature><output-script-descriptors>
Output Descriptor for an Arbitrary Script
Shannon A.
# Output Descriptor for an Arbitrary Script

(Asked by: username_0 on 2021-05-25)

Can output descriptors be used to describe an arbitrary script?
Say I had a script something like the following:
OP_IF
  1737417600 OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160  OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
  2    3 OP_CHECKMULTISIG
OP_ENDIF

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.

**Tags:** multi-signature, output-script-descriptors


---

## 1 answers

### Answer by username_1 on 2021-05-26. Score: 5 | Accepted answer

Output script descriptors do not currently support any arbitrary script. However once extended by [Miniscript](http://bitcoin.sipa.be/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).

> **Comments:**
> **username_0**: Thanks, Andrew! I'd seen that the functionality looked possible in miniscript, I appreciate the pointer that it's the way to go.  

---

