[OP_RETURN Prefix] Paywall payment prefix
Summary:
With the recent introduction of lokad ID indexing in chronik, this diff proposes a paywall lokad ID prefix (70617977 / PAYW) to accompany paywall payment transactions.
A typical payload will consist of:
[OP_Return] [PAYW] [TXID of the paywalled article]
This simplified payload is on the basis that this paywall payment itself will contain the XEC payment amount, payer address, payee address and payment date/time, whilst the txid of the paywalled article can be used to derive (from onchain or offchain sources) the requisite attributes of the article such as article title, content, author, date/time and the designated paywall price.
From a web app POV, it would just be a matter of:
- Upon startup, calling Chronik to return all transactions matching the PAYW lokad ID
- Caching the JSON response from Chronik
- From the paywall checking callsite, check the recency of the cached paywall payments array before parsing to see whether a particular user address has successfully paid the correct amount to get past the paywall.
Test Plan: Plonk doc into https://jbt.github.io/markdown-editor/ and review
Reviewers: Mengerian, bytesofman, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D16188