Add output/op_return and inscription native endpoints#754
Open
eynhaender wants to merge 4 commits into
Open
Conversation
Member
|
Good info, but I don't see any need for the server to preprocess |
Member
|
As for the instruction extraction, the bulk of that code would go into system and/or database. System can just statically parse the tx/block/output as is done above. Database can provide an optimized query that does the same. This would be the ordinal path, assuming that's the only way they are to be identified (txout). or |
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.
Add OP_RETURN viewer and Ordinals inscription endpoints
Two new read-only endpoints added to the native REST interface, both following the existing
?format=data|text|jsonconvention.GET /v1/output/{txhash}/{vout}/op_returnReturns the payload bytes of an
OP_RETURNoutput. All OP_RETURN variants are supported: standardnull_data, Runes (OP_RETURN OP_13 <data>), and multi-chunk forms. The payload is the concatenation of all pushdata bytes followingOP_RETURN.JSON format additionally includes Base64 encoding, payload size, auto-detected overlay protocol (Runes, Omni Layer, Counterparty, Stamps, BIP-320), and UTF-8 decoding where valid.
GET /v1/inscription/{txhash}/{vin}Parses an Ordinals inscription envelope from the tapscript witness of a reveal transaction input. The
dataformat serves raw content bytes with the inscription's declared MIME type asContent-Type, so browsers render images and text directly. JSON format includescontent_type,content_base64,size, and optionalcontent_encoding.Tapscript extraction follows BIP-341 (second-to-last stack item, with annex detection via
chain::annex::is_annex_pattern()). The parser scans raw script bytes for the 6-byte Ordinals envelope marker00 63 03 6f 72 64and reads tag-value field pairs until the body separator, then collects body chunks untilOP_ENDIF.