Nostr 'My Services' Event Kind (Draft/Experiment)
A way to support in-app management of services with subscriptions and credits where a payment is due (I guess it can be free too?).
A client app can query for these events and show a list of services that are active or have credit remaining. They can show a list of expired (or no credit left) services as well. Clicking a service can allow you to make a payment based on the payment options provided.
What to support
- Current balance (optional if expiry exists, else mandatory)
- Current expiry (optional for balance): Represents payment due by
- Get Usage data/Summary?
- Ability to pay renewal, or prepaid credits
- Ability to get a some kind of receipt (maybe this is just an updated balance/renewal event being received
- Request a new renewal (if old has expired)
Questions
- Can it support a coupon or special discount token?
- How to prevent flood abuse?
- How often should balances be pushed into the network (we likely don't need every second - and client apps can refresh when you try view the My Services view. Maybe it can trigger a refresh request directly.
Event Types
- Request Balance/Renewal refresh
- Receive Balance/Renewal
- Request Usage data
- Receive Usage data
Poor Mans Mocked API
Current
balance: 11111111 (unit name?)
Expiry: UNIX_TIME
Previous Payment (maybe last 3 or 10..?)
previous_payments {
payment_date: UNIX TIME
payment_details: {
{
type: credit/period
quantity: 10000 (units?)
amount: 10000
currency: btc-sat
}
payment_notes: Maybe a custom message or comment from the vendor
}
}
Payment Options (typically credits OR period)
credits [
{
quantity: 10000 (units?)
amount: 10000
currency: btc-sat
},
]
periods[
{
new_expiry: UNIX_TIME (1m)
amount: 10000
currency: btc-sat
invoice_data:
},
{
new_expiry: UNIX_TIME (3m)
amount: 25000
currency: btc-sat
invoice_data:
},
{
new_expiry: UNIX_TIME (6m)
amount: 47000
currency: btc-sat
invoice_data:
}
]
offer_expiry: UNIX TIME: Time at which payment is no longer possible at current prices
Other notes so far.
Units could be data storage so bytes (storage or available to upload)
Usage could be N bytes / M bytes
Google Mobile Data Sharing Plan
https://developers.google.com/mobile-data-plan/agent_api_specification
https://api-reference.checkout.com/#operation/requestAPaymentOrPayout