<p>Script (uppercase S, also Bitcoin Script) is the scripting language used in Bitcoin. Its programs are called &quot;scripts&quot; (lowercase s), often with an adjective based on the location of the script in a transaction (output script, input script, redeem script, witness script, leaf script).</p>
<p>Leaf script is a script revealed as part of a Taproot (SegWit v1) script path spend (see <a href="https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki" rel="nofollow noreferrer">BIP341</a>).</p>
<p>Tapscript is a variant of Script used in leaf scripts with a leaf version of <em>0xc0</em> (see <a href="https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki" rel="nofollow noreferrer">BIP342</a>). It makes some significant changes to previously used Script, such as switching from ECDSA to Schnorr signatures, replacing OP_CHECKMULTISIG(VERIFY) with OP_CHECKSIGADD and introducing OP_SUCCESS opcodes for better upgradeability. Tapscript scripts are often called &quot;tapscripts&quot;.</p>
<p><a href="https://bitcoin.sipa.be/miniscript" rel="nofollow noreferrer">Miniscript</a> is a language for writing scripts that enables composition, static analysis and more. It compiles directly to Script (or Tapscript).</p>
<p>Here is a diagram that relates all these terms together:</p>
<p><a href="https://i.sstatic.net/bmfuClSU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bmfuClSU.png" alt="relationship diagram" /></a></p>

CC BY-SA 4.0
2024-04-27T14:02:49.753Z
Great answer, might it also be worth mentioning [tag:miniscript]?
Lee
CC BY-SA 4.0
2024-04-27T14:12:11.783Z
@Lee Feel free to add it to your question.
Vojtěch Strnad
CC BY-SA 4.0
2024-04-27T18:45:14.533Z
@VojtěchStrnad Very nice diagram! One tiny nit: if tapscript is a subclass (indirectly) of script, then that implies a script can be written in Tapscript... so should there be a "written in" arrow from script to Tapscript?
Pieter Wuille
CC BY-SA 4.0
2024-04-27T18:57:53.553Z
@PieterWuille Hmm, not sure if I like that. You can already see from the graph that some scripts are written in Tapscript, a direct connection might imply that all are (as with Script).
Vojtěch Strnad
CC BY-SA 4.0
2024-04-27T19:10:18.297Z
Fair enough, I guess that would change the meaning to "may be written in".
Pieter Wuille
CC BY-SA 4.0
2024-04-27T10:11:08.163Z
2024-04-27T14:31:10.217Z
2024-04-27T14:31:10.217Z
Vojtěch Strnad
<p><strong>What is Tapscript?</strong></p>
<p>How is it different from <a href="/questions/tagged/script" class="post-tag" title="show questions tagged &#39;script&#39;" aria-label="show questions tagged &#39;script&#39;" rel="tag" aria-labelledby="tag-script-tooltip-container" data-tag-menu-origin="Unknown">script</a>? Is it the same thing as &quot;Leaf script&quot;?</p>
<p>How does it relate to Witness Script, miniscript and any other type of script used in Bitcoin transactions?</p>
<p>How and when was it implemented?</p>
<p>What can it be used for?</p>

<script><taproot><terminology><miniscript>
What is Tapscript?
Lee
# What is Tapscript?

(Asked by: username_0 on 2024-04-27)

**What is Tapscript?**

How is it different from [script](/questions/tagged/script "show questions tagged 'script'")? Is it the same thing as "Leaf script"?

How does it relate to Witness Script, miniscript and any other type of script used in Bitcoin transactions?

How and when was it implemented?

What can it be used for?

**Tags:** script, taproot, terminology, miniscript


---

## 1 answers

### Answer by username_1 on 2024-04-27. Score: 6 | Accepted answer

Script (uppercase S, also Bitcoin Script) is the scripting language used in Bitcoin. Its programs are called "scripts" (lowercase s), often with an adjective based on the location of the script in a transaction (output script, input script, redeem script, witness script, leaf script).

Leaf script is a script revealed as part of a Taproot (SegWit v1) script path spend (see [BIP341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki)).

Tapscript is a variant of Script used in leaf scripts with a leaf version of *0xc0* (see [BIP342](https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki)). It makes some significant changes to previously used Script, such as switching from ECDSA to Schnorr signatures, replacing OP\_CHECKMULTISIG(VERIFY) with OP\_CHECKSIGADD and introducing OP\_SUCCESS opcodes for better upgradeability. Tapscript scripts are often called "tapscripts".

[Miniscript](https://bitcoin.sipa.be/miniscript) is a language for writing scripts that enables composition, static analysis and more. It compiles directly to Script (or Tapscript).

Here is a diagram that relates all these terms together:

[![relationship diagram](https://i.sstatic.net/bmfuClSU.png)](https://i.sstatic.net/bmfuClSU.png)

> **Comments:**
> **username_0**: Great answer, might it also be worth mentioning [tag:miniscript]?  
> **username_1**: @username_0 Feel free to add it to your question.  
> **username_2**: @VojtěchStrnad Very nice diagram! One tiny nit: if tapscript is a subclass (indirectly) of script, then that implies a script can be written in Tapscript... so should there be a "written in" arrow from script to Tapscript?  
> **username_1**: @PieterWuille Hmm, not sure if I like that. You can already see from the graph that some scripts are written in Tapscript, a direct connection might imply that all are (as with Script).  
> **username_2**: Fair enough, I guess that would change the meaning to "may be written in".  

---

