Skip to content

inscription-parser: recognise BIP-110 compatible envelopes#22

Open
hans-crypto wants to merge 1 commit into
mainfrom
bip110-envelope
Open

inscription-parser: recognise BIP-110 compatible envelopes#22
hans-crypto wants to merge 1 commit into
mainfrom
bip110-envelope

Conversation

@hans-crypto

Copy link
Copy Markdown
Collaborator

BIP-110 disables OP_IF and OP_NOTIF in tapscript and limits data pushes to 256 bytes.

This PR adds an alternative inscription envelope parser: a bare protocol push followed by a series of data pushes balanced by OP_DROP and OP_2DROP. Matches the envelope shape proposed in ordinals/ord#4545 so we parse the same inscriptions the ord indexer will.

@hans-crypto hans-crypto force-pushed the bip110-envelope branch 2 times, most recently from a8b9cfe to 2565e15 Compare July 4, 2026 15:47
BIP-110 disables OP_IF and OP_NOTIF in tapscript and limits data
pushes to 256 bytes.

Adds an alternative inscription envelope parser: a bare protocol
push followed by a series of data pushes balanced by OP_DROP and
OP_2DROP. Matches the envelope shape proposed in ordinals/ord#4545
so we parse the same inscriptions the ord indexer will.

Both envelope shapes share the same "ord" push (four bytes);
a classic envelope is any occurrence preceded by OP_FALSE OP_IF,
anything else is BIP-110. One marker, one scanner, one extractor
handles both -- the terminator switches to OP_DROP / OP_2DROP for
BIP-110 and the envelope-size math is a single subtraction, no
fudge factors.

Testing: no BIP-110 shape inscription exists on chain yet, so the
spec uses a hand-crafted synthetic transaction (txid = "deadbeef"
x 8). The GOLDEN RULE (every test uses real blockchain data) is
waived here on purpose: this test pins the wire-format parsing so
it works on day one when a real BIP-110 envelope lands. Add a
real-tx spec when one exists on mainnet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant