HomePhabricator

[OP_RETURN Prefix] Paywall payment prefix

Description

[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:

  1. Upon startup, calling Chronik to return all transactions matching the PAYW lokad ID
  2. Caching the JSON response from Chronik
  3. 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

Details

Provenance
emackAuthored on May 20 2024, 13:24
emackPushed on May 21 2024, 12:47
Reviewer
Restricted Project
Differential Revision
D16188: [OP_RETURN Prefix] Paywall payment prefix
Parents
rABC3db48ecde096: fix check-crates target
Branches
Unknown
Tags
Unknown