<blockquote>
<p>What can be the contents of an P2TR output script? Is it always OP_1 0x20 &lt;32-bit public key&gt;?</p>
</blockquote>
<p>A Taproot output contains a 32 <strong>byte</strong> witness program (a tweaked internal key or an untweaked public key if eschewing the tweak) after <code>OP_1</code>. The <code>OP_1</code> (01) makes it clear that it is a SegWit v1 output rather than say a SegWit v0 output (00). Any scripts are included in the leaves of the Taproot tree and hashed up to a Merkle root (which tweaks the internal public key) so the witness program can commit to various leaf scripts.</p>
<blockquote>
<p>Can multisig script be there, and if yes - in what format?</p>
</blockquote>
<p>A multisig script can be in a leaf or multiple leaves of the Taproot tree. Note that a Taproot multisig script uses the opcode OP_CHECKSIGADD rather than OP_CHECKMULTISIG (outlined in <a href="https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki" rel="nofollow noreferrer">BIP 342</a>).</p>
<blockquote>
<p>How do I convert that script to an address?</p>
</blockquote>
<p>The leaf scripts are hashed within the Taproot (Merkle) tree. The Merkle root then tweaks the internal public key. A breakdown of bech32m (SegWit v1) addresses is <a href="https://bitcoin.stackexchange.com/questions/100508/can-you-break-down-what-data-is-encoded-into-a-bech32-address">here</a>. This tweaked internal public key (or witness program) is directly included within the address.</p>

CC BY-SA 4.0
2021-11-09T12:38:04.353Z
Thanks! Just to confirm - in any case, Taproot (Segwit v1) output is always 32-byte public key, which hides complexity of whatever script might be behind it. This public key is translated into address using bech32m, and that address represents the output.
DimaA6_ABC
CC BY-SA 4.0
2021-11-09T16:29:43.903Z
Yes, a transaction output is a taproot output if and only if it consists of OP_1 followed by a 32-byte push.
Pieter Wuille
CC BY-SA 4.0
2021-11-09T10:25:10.587Z
2022-08-04T12:10:34.063Z
2022-08-04T12:10:34.063Z
Michael Folkson
<p>What can be the contents of an P2TR output script? Is it always <code>OP_1 0x20 &lt;32-bit public key&gt;</code>? Can multisig script be there, and if yes - in what format, and more importantly - how do I convert that script to an address?</p>

<script><taproot><p2tr>
Recognizing Taproot outputs in raw transactions
DimaA6_ABC
# Recognizing Taproot outputs in raw transactions

(Asked by: username_0 on 2021-11-09)

What can be the contents of an P2TR output script? Is it always `OP_1 0x20 <32-bit public key>`? Can multisig script be there, and if yes - in what format, and more importantly - how do I convert that script to an address?

**Tags:** script, taproot, p2tr


---

## 1 answers

### Answer by username_1 on 2021-11-09. Score: 2 | Accepted answer

> What can be the contents of an P2TR output script? Is it always OP\_1 0x20 <32-bit public key>?

A Taproot output contains a 32 **byte** witness program (a tweaked internal key or an untweaked public key if eschewing the tweak) after `OP_1`. The `OP_1` (01) makes it clear that it is a SegWit v1 output rather than say a SegWit v0 output (00). Any scripts are included in the leaves of the Taproot tree and hashed up to a Merkle root (which tweaks the internal public key) so the witness program can commit to various leaf scripts.

> Can multisig script be there, and if yes - in what format?

A multisig script can be in a leaf or multiple leaves of the Taproot tree. Note that a Taproot multisig script uses the opcode OP\_CHECKSIGADD rather than OP\_CHECKMULTISIG (outlined in [BIP 342](https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki)).

> How do I convert that script to an address?

The leaf scripts are hashed within the Taproot (Merkle) tree. The Merkle root then tweaks the internal public key. A breakdown of bech32m (SegWit v1) addresses is [here](https://bitcoin.stackexchange.com/questions/100508/can-you-break-down-what-data-is-encoded-into-a-bech32-address). This tweaked internal public key (or witness program) is directly included within the address.

> **Comments:**
> **username_0**: Thanks! Just to confirm - in any case, Taproot (Segwit v1) output is always 32-byte public key, which hides complexity of whatever script might be behind it. This public key is translated into address using bech32m, and that address represents the output.  
> **username_2**: Yes, a transaction output is a taproot output if and only if it consists of OP_1 followed by a 32-byte push.  

---

