HomePhabricator

[Chronik] Add `parse_tx_lokad_ids` to parse LOKAD IDs

Description

[Chronik] Add parse_tx_lokad_ids to parse LOKAD IDs

Summary:
Allows detecting and grouping txs that have some protocol that follows the extended LOKAD ID spec.

We allow the following patterns for a LOKAD ID:

  • OP_RETURN <LOKAD ID> ... (first output), where the LOKAD ID is a 4-byte pushdata op. This is the only allowed variant in the original spec, and still kind-of the standard.
  • OP_RETURN OP_RESERVED "<LOKAD ID>..." "<LOKAD_ID>..." ... (first output), where the OP_RETURN is encoded as eMPP and every pushop is considered prefixed by a 4-byte LOKAD ID. This is new after the introduction of eMPP.
  • <LOKAD ID> ... (every input), where any input starting with a 4-byte pushop is interpreted as a LOKAD ID. This allows covenants to easily enforce a LOKAD ID by simply doing <LOKAD ID> OP_EQUAL at the end of all the ops.

Test Plan: cargo test -p bitcoinsuite-slp --lib

Reviewers: Fabien, #bitcoin_abc, bytesofman

Reviewed By: #bitcoin_abc, bytesofman

Subscribers: bytesofman

Differential Revision: https://reviews.bitcoinabc.org/D15913

Details

Provenance
tobias_ruckAuthored on Sat, Apr 6, 04:33
tobias_ruckPushed on Tue, Apr 9, 23:57
Reviewer
Restricted Project
Differential Revision
D15913: [Chronik] Add `parse_tx_lokad_ids` to parse LOKAD IDs
Parents
rABCb132af74fbce: tests: remove flaky mocktime test
Branches
Unknown
Tags
Unknown