Just pushed a PR for lnproxy that enables support for a service provider to add a fee to an atomic invoice where both the service provider and a content creator can get paid upon successful payment/settlement.
Effectively this is like a split payment, where the service provider can add a dynamic fee on top of a seller price, that can cover hosting, or whatever costs the service provider has.
https://github.com/lnproxy/lnproxy/pull/24
Thread
Login to reply
Replies (2)
This is very cool and I can already think of a bunch of use cases but I'm confused where the service fee invoice would come from and how it could be ensured to be paid.
The idea was basically that lnproxy is run internally (not a public api) to wrap an invoice on behalf of a seller. It asks the seller for an invoice (lots of ways, but I have LND with Invoice Macaroon working, but could even be a Lightning Address). It then wraps the seller invoice with a new invoice for the seller sell price, plus a maximum routing fee for your wrapping invoice, plus a service provider fee (fixed, %, variable, etc) you decide.
Then you use hold invoices to do two things, ensure routing is possible to pay the seller, and things like your server doesnβt crash or items are in stock. You present the buyer your provider invoice which includes your provider fees to pay, and if all goes well, when you release the hold, both your invoice and the sellers invoice clear.
Maybe Iβm missing something, however it seems to all hold together. I have it working locally - just need to make sure there are no attack vectors Iβm missing.
I wrote about it more in the PR.
https://github.com/lnproxy/lnproxy/pull/24#issuecomment-1537341469