python-teos
python-teos copied to clipboard
Paid subscriptions and topups
Currently the tower service is offered for free. However, the goal is integrate BOLT11 invoices in the response of the register message as a payment wall if subscriptions are being offered for a fee.
The current approach allows the user to hit the /register
endpoint for free, adding DEFAULT_SLOTS
to the current user's available_slots
and reseting the subscription expiry to current_block_height + DEFAULT_SUBSCRIPTION_DURATION
.
However, with the introduction of paid subscriptions storage over time has to be priced. The user should be able to add more slots to the current subscriptions (add slots), extend the subscription time period (add time) or do both at the same time (add slots + time).
Subscription top-ups should no leak information about the current state of the subscription to prevent probing. This may require splitting the top-up endpoint from the register one, and require a signature from the user in order to top-up. Furthermore, the behaviour over several requests to /register
over an already registered id should be also defaulted (to add extra slots for example).