Does Lightning address have payment logic?
When I first conceptualized a marketplace for Pod Tags, I wanted to use Lightning address mostly because I didn't want to build out payment logic or think about how I could integrate a lightning payment processor into a mobile application. I'm not a dev and wouldn't even know where to start to investigate this.
What I did know is that Lighting address makes it really easy for someone to receive sats through a human-readable format that looks something like an email address: [email protected]. It also had the look and feel of an app username you could claim for venmo or cashapp so I felt like making the jump to connecting the two dots wouldn't too far fetched. Also due to the nature of lightning, payers could use ANY lightning wallet which I think is a super attractive proposition.
But I needed to answer a couple of questions:
-
Can I leverage the lightning address to generate a lightning invoice in the app?
-
Can the lightning address tell me when the invoice gets paid?
I ended up bugging a whole bunch of people and then Andre from Zebedee confirmed that I could in fact use the zebedee api to trigger an invoice and have it displayed in my app:
He then pointed me to their documentation: https://api-reference.zebedee.io/
That's when I decided to keep moving forward with using Lightning address with my project but I had forgotten one thing: how do I know if the invoice has been paid?!
From a tech perspective, it made sense to me that I could make a call to Zebedee's api to grab the invoice. But then I realized I wasn't plugged in directly to their node or payment logic, so I had no way of knowing if the invoice had been paid.
This time I went to Santos from Zebedee for help. I asked him if there was a way for Zebedee to tell me that an invoice has been updated, to which he said yes. Andre pointed out that this hasn't been standardized yet but:
There are 3 different ways that folks are discussing how to do this, mostly through HTTP or through WebSockets.
With getting notified about the payment, I could now create a trigger to "unlock" the pod tag for the purchaser! I could also keep track of payment history on my server to display to users if I ever wanted to. This was all I needed to keep moving forward with the market place for Pod Tags.
The next hurdle I see is trying to monetize the marketplace for revenue. Right now the marketplace would be free as 100% and the sats would go straight to the lister of the pod tag. Eventually I would want to monetize it by potentially taking a 10% fee of every sale. I'm not sure if Lightning address or the LN in general has the capability to do that if I'm NOT running a node.
One initial thought is to display 2 invoices: One for me and one for the pod tag lister. But making 2 payments isn't the best UX. This is something I have to investigate further.