inscription-parser: recognise BIP-110 compatible envelopes#22
Open
hans-crypto wants to merge 1 commit into
Open
inscription-parser: recognise BIP-110 compatible envelopes#22hans-crypto wants to merge 1 commit into
hans-crypto wants to merge 1 commit into
Conversation
a8b9cfe to
2565e15
Compare
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.
2565e15 to
bb0767e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BIP-110 disables
OP_IFandOP_NOTIFin 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_DROPandOP_2DROP. Matches the envelope shape proposed in ordinals/ord#4545 so we parse the same inscriptions the ord indexer will.