Overview
Coupons any till can mint — advertised on Nostr, redeemed once.
This Coupon Manager Service (CMS) mints and redeems coupons on a merchant's behalf. The merchant authorizes it by signing a Nostr event that says where the service lives. Any POS that reads that event can mint and redeem without ever talking to us first.
Live implementation: merchant.lacrypta.ar
Who is who
| Role | Job | Key |
|---|---|---|
| Merchant | Creates definitions, authorizes minters, signs the announcement | Theirs (NIP-07 / NIP-46) |
| Minter | Mint coupons for a merchant who authorized them | npub whitelisted by merchant |
| Coupon Manager Service (CMS) | Create/Update/Delete/Burn coupons and sign vouchers | COUPON_MANAGER_NSEC |
| Bearer | Holds the coupon code (nonce) and redeems | None — the nonce is the credential |
One CMS deployment serves many merchants. Everything is scoped by the pubkey that signed the request.
Why a database
Relays are eventually consistent — perfect for a catalog, useless for "has this coupon been used?".
Postgres answers that once. Everything that needs discovery lives on Nostr. Everything that needs a single truth lives in the DB.