Page MenuHomePhabricator

[OP_RETURN Prefix] Paywall payment prefix
ClosedPublic

Authored by emack on May 20 2024, 13:33.

Details

Reviewers
Mengerian
bytesofman
Group Reviewers
Restricted Project
Commits
rABCd953088e8a8e: [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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
paywallPrefix
Lint
Lint Skipped
Unit
No Test Coverage
Build Status
Buildable 29043
Build 57622: Build Diff
Build 57621: arc lint + arc unit

Event Timeline

emack requested review of this revision.May 20 2024, 13:33
This revision is now accepted and ready to land.May 20 2024, 22:49

I don't understand exactly the approach here and why it was selected over alternatives. In general, I dont' think lokad selection should require a major technical justification.

This revision was automatically updated to reflect the committed changes.