<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/index.php?action=history&amp;feed=atom&amp;title=Miniscript</id>
	<title>Miniscript - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/index.php?action=history&amp;feed=atom&amp;title=Miniscript"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Miniscript&amp;action=history"/>
	<updated>2026-09-12T17:31:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Miniscript&amp;diff=71276&amp;oldid=prev</id>
		<title>NotATether: Create Miniscript stub (structured Script / descriptors)</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Miniscript&amp;diff=71276&amp;oldid=prev"/>
		<updated>2026-09-12T04:50:31Z</updated>

		<summary type="html">&lt;p&gt;Create Miniscript stub (structured Script / descriptors)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Miniscript&amp;#039;&amp;#039;&amp;#039; is a language for writing a structured subset of Bitcoin [[Script]]. A Miniscript expression compiles to Script, can be analyzed for correctness, size, and satisfaction, and can be composed from smaller expressions. It is used with output descriptors, typically inside &amp;lt;code&amp;gt;wsh()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;tr()&amp;lt;/code&amp;gt;, so wallets can import a spending policy rather than a raw script hex blob.&lt;br /&gt;
&lt;br /&gt;
Arbitrary Script is hard to analyze: it is not obvious whether a script is spendable, whether two scripts encode the same policy, what witness is required, or whether a proposed satisfaction is minimal. Wallets that implement multisignature or timelocked recovery therefore tend to hard-code a few templates. Pieter Wuille, Andrew Poelstra, and Sanket Kanjalkar designed Miniscript as a composition-friendly representation of the Script subset used for spending policies. A higher-level &amp;#039;&amp;#039;policy&amp;#039;&amp;#039; language describes thresholds, keys, hashes, and timelocks; Miniscript itself is closer to Script and carries type information for correct compilation.&lt;br /&gt;
&lt;br /&gt;
A policy such as “two of these three keys, or one key after a relative delay” is written in a functional notation and compiled to Miniscript, then to Script. Fragments include &amp;lt;code&amp;gt;pk_k&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pk_h&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;older&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;after&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hash256&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;and_v&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;or_b&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thresh&amp;lt;/code&amp;gt;, and others. Each fragment has a type and properties that describe malleability, whether it can be satisfied without a signature, and how large the script and witness will be. Type checking rejects compositions that leave the stack wrong or that are malleable under standard rules. Given available secrets, a satisfier can construct a witness. These properties let a wallet predict fees, detect incomplete [[PSBT]]s, and refuse a satisfaction another party could later mutate.&lt;br /&gt;
&lt;br /&gt;
Miniscript does not cover every Script opcode. It targets standard P2WSH and Tapscript spending under [[Segregated Witness]] and [[Taproot]]. Some valid scripts have no Miniscript form. Compilers try to choose a small, non-malleable representation. In descriptors, Miniscript appears as the argument to &amp;lt;code&amp;gt;wsh()&amp;lt;/code&amp;gt; or as leaves of &amp;lt;code&amp;gt;tr()&amp;lt;/code&amp;gt;, with key expressions following BIP380 (including origin fingerprints and BIP32 paths). A descriptor checksum covers the whole string so a policy can be backed up as text.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Script]]&lt;br /&gt;
* [[Taproot]]&lt;br /&gt;
* [[Segregated Witness]]&lt;br /&gt;
* [[PSBT]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [https://bitcoin.sipa.be/miniscript/ Miniscript reference]&lt;br /&gt;
* [https://bitcoinops.org/en/topics/miniscript/ Bitcoin Optech: Miniscript]&lt;br /&gt;
* [https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki BIP380: Output Script Descriptors General Operation]&lt;br /&gt;
* [https://github.com/rust-bitcoin/rust-miniscript rust-miniscript]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;/div&gt;</summary>
		<author><name>NotATether</name></author>
	</entry>
</feed>