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 or in some other form?
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 or in some other form?
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.
annex
logic inord
wallet source code and thought they might useannex
for data storage since it's simply ignored