<p>I think this is explained at <a href="https://docs.ordinals.com/inscriptions.html" rel="nofollow noreferrer">https://docs.ordinals.com/inscriptions.html</a></p>
<blockquote>
<p>Inscription content is serialized using data pushes within unexecuted conditionals, called &quot;envelopes&quot;. Envelopes consist of an OP_FALSE OP_IF … OP_ENDIF wrapping any number of data pushes. Because envelopes are effectively no-ops, they do not change the semantics of the script in which they are included, and can be combined with any other locking script.</p>
<p>A text inscription containing the string &quot;Hello, world!&quot; is serialized as follows:</p>
<pre><code>OP_FALSE
OP_IF
  OP_PUSH &quot;ord&quot;
  OP_1
  OP_PUSH &quot;text/plain;charset=utf-8&quot;
  OP_0
  OP_PUSH &quot;Hello, world!&quot;
OP_ENDIF
</code></pre>
</blockquote>
<p>From what I have seen, the inscribed data appears in the second witness component of three. The last does not start with 0x50 so is not an annex if my (pretty sketchy) understanding is correct.</p>

CC BY-SA 4.0
2023-05-09T08:20:19.673Z
2023-05-09T08:28:39.340Z
2023-05-09T08:28:39.340Z
RedGrittyBrick
<p>Is it stored in the witness program as</p>
<pre><code>OP_FALSE
OP_IF
&lt;data&gt;
OP_ENDIF
</code></pre>
<p>or is it stored in <strong>annex</strong> as described in <a href="https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki" rel="nofollow noreferrer">bip 341</a> or in some other form?</p>

CC BY-SA 4.0
2023-05-09T15:07:06.680Z
@VojtěchStrnad yes, it's illustrative, but it seems to be a normal SegWit transaction (OP_0), not taproot (OP_1). I was a bit confused by `annex` logic in `ord` wallet source code and thought they might use `annex` for data storage since it's simply ignored
DeLorean88
CC BY-SA 4.0
2023-05-09T15:12:30.537Z
The OP_0 is not in the output script but in the leaf script, to avoid executing the code branch that has the inscription data.
Vojtěch Strnad
<segregated-witness><p2wsh><ordinals>
Where exactly is the Inscription media stored in witness signature?
DeLorean88
# Where exactly is the Inscription media stored in witness signature?

(Asked by: username_0 on 2023-05-09)

Is it stored in the witness program as

```
OP_FALSE
OP_IF
<data>
OP_ENDIF

```

or is it stored in **annex** as described in [bip 341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki) or in some other form?

**Tags:** segregated-witness, p2wsh, ordinals

> **Comments:**
> **username_0**: @username_1 yes, it's illustrative, but it seems to be a normal SegWit transaction (OP_0), not taproot (OP_1). I was a bit confused by `annex` logic in `ord` wallet source code and thought they might use `annex` for data storage since it's simply ignored  
> **username_1**: The OP_0 is not in the output script but in the leaf script, to avoid executing the code branch that has the inscription data.  

---

## 1 answers

### Answer by username_2 on 2023-05-09. Score: 2

I think this is explained at <https://docs.ordinals.com/inscriptions.html>

> Inscription content is serialized using data pushes within unexecuted conditionals, called "envelopes". Envelopes consist of an OP\_FALSE OP\_IF … OP\_ENDIF wrapping any number of data pushes. Because envelopes are effectively no-ops, they do not change the semantics of the script in which they are included, and can be combined with any other locking script.
>
> A text inscription containing the string "Hello, world!" is serialized as follows:
>
> ```
> OP_FALSE
> OP_IF
>   OP_PUSH "ord"
>   OP_1
>   OP_PUSH "text/plain;charset=utf-8"
>   OP_0
>   OP_PUSH "Hello, world!"
> OP_ENDIF
>
> ```

From what I have seen, the inscribed data appears in the second witness component of three. The last does not start with 0x50 so is not an annex if my (pretty sketchy) understanding is correct.


---

