Purchase Claims & Verification
Purchase claims and verification
When a user zaps paid content, pleb.school does not take custody of funds. Instead it verifies the zap receipts and records a purchase in the database.
Auto-claim behavior
- The UI streams zap receipts from relays
- When the verified total meets the price, the purchase is auto-claimed
- If receipts are delayed, users can click “Unlock with past zaps” to retry the claim
What is verified
- Receipt and request signatures
- Invoice hash and amount
- Recipient Lightning address match
- Correct event reference (e or a tag)
Price snapshots and access rules
- The database price is authoritative
- When a purchase is claimed, the current price is stored as a snapshot
- Access is granted when amountPaid meets the snapshot or current price (whichever is lower)
Admin visibility
- Purchases live in the database with full receipt JSON for audits
- Duplicate receipts are rejected
- Claims may fail if a receipt is only visible on relays outside your configured sets
This design keeps payments peer-to-peer while giving admins reliable entitlement records.
Write a comment