Tower payments pay endpoint: WIP#257
Tower payments pay endpoint: WIP#257orbitalturtle wants to merge 3 commits intotalaia-labs:masterfrom
Conversation
|
In the description laid out, an implicit assumption is made, which is that a user should have an existing channel with a route of payment to the said watch tower. Such assumptions might not be expected by all users, who may prefer to use normal bitcoin transfers. Such example would be in the case of private channels amongst known participants. |
|
I think using silent payments for payments is definitely a cool idea, though not totally relevant to this particular PR. Maybe it'd be worth posting a separate issue for the use of silent payments on rust-teos in case someone wants to look into it further? Personally I think payments to watchtowers will likely be pretty small, even when paying for thousands of slots at a time up front (see: https://gist.github.com/orbitalturtle/38ca2c6a76dd129fd1cf84b4cc3cb101). So I'm not sure small payments like that will be the best for on-chain payments with higher fees. |
This PR begins to add payment support to TEOS. I'm realizing I have a lot of thoughts and the project is a bit bigger than I expected. So figured I'd try to see if I can get a little feedback on the approach I'm taking before I get too far along. 🤞🏻
Approach so far:
I've started by creating a new "pay" endpoint. This will be used to grab an invoice to pay when a user needs to register or top up their account (maybe a more accurate name would just be "get_invoice" to then pay after).
The steps for a user to make a payment (for initial registration or for a top up) are:
On the tower side, once a user hits the pay endpoint for the first time, the tower associates the user's provided uuid with the invoice, and stores it in memory and in the db. IMO the advantages of "one-invoice-per-user" model are that:
Future stuff: This will come in future PRs
The above all takes the endpoint logic into account. After that, we'll need to build some other things: