-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add lnurl #384
base: main
Are you sure you want to change the base?
add lnurl #384
Conversation
For reasons I've explained in detail elsewhere (see this twitter thread) LNURL is almost uniquely unsuited to this use unless you can demonstrate it's ability to cope with high volumes of small transactions. It would be far more preferable to show a proof of concept with a system for receiving funds and a working podcast player (or an adaption of one of the open source players) to demonstrate how you can make the complicated, slow, multi step LNURL system suitable for streaming payments. |
Nice! +1 from my side for LNURL support. Lightning addresses are all kinds of awesome, would be great to have support for them (and LNURL in general) in Podcasting 2.0. One of the main benefits would be more self-custody and more self-sovereign use, since way more people have a lightning address than a keysend-enabled full node. Since we are moving towards custodial hell anyway, with all the inevitable implications of state interference, this is very much needed. I don't think additional requests are that big of an issue. Some requests can be cached, payments can be batched. The value spec is very clear about this:
|
Thank you for considering this PR.
I see no reason why LNURL shouldn't be able to achieve the same throughput as keysend. It's important to realize that the LNURL-pay scheme adds two additional http-only requests per payment, there is no additional burden on the Lightning level. A payment consists of a single Lightning round trip, like with keysend. Running an http endpoint for this does not require any meaningful resources compared to running the Lightning backend. Furthermore, since this is a purely opt-in and open protocol upgrade, you don't need to support LNURL if you can't or don't want. On client-side optimization: In a private conversation, @kingonly from Breez explained to me how optimization is important for mobile devices since battery / cpu constraints can be very aggressive. I agree with his view. To optimize for this, in principle, the LNURL spec could be extended to indicate in the first request that the endpoint for reaching the second one is To summarize: LNURL adds only two (or potentially one) additional http-only requests per payment compared to keysend. These requests do not require any meaningful computation and are solely for the purpose of exchanging payment metadata. In my view, this additional burden will not affect performance and is quasi-negligible compared to what is required to initiate and settle a payment via Lightning. |
I'm a bit surprised at this statement from you Gigi. LN Addresses don't help with custody! Somewhere there is a server running which has to generate a lightning invoice. The Lightning goes to a Node. If the user doesn't have the keys and isn't running that node, it's not self-custody. |
Other than making the Value blocks look nicer (and they'd look WAY nicer if we used Hive which has user readable full self-custody payment addresses) what benefit does LNURL bring? If you don't have your own node, everything in Lightning is custodial. My Hive solution (because the conversion and pay out is near instant) is paradoxically the only self custody solution WITHOUT having your own Lightning Node. |
I don't know what Hive is and I'm not going to engage in a discussion about the general utility of LNURL. LNURL can be custodial and non-custodial, it doesn't matter for the spec. It has proven itself de facto, insofar that almost all wallets support it since it is undoubtedly the most-used static identifier in Lightning. If you have technical arguments against it, we can discuss them here. If you don't like it or don't want to support it, for example due to esthetical issues in the value block, feel free to just ignore it. |
How can LNURL and a Lightning Address be non-custodial (I hate this term I prefer the affirmative Self Custody) without your own Lightning Node. Please explain to me because I'm missing something. My technical argument is that I built and operate a Lighting Address Gateway for 10's of 1,000's of Hive account owners and quite a few of them are using it on a regular basis. This API call returns a QR code which will send me Hive: https://api.v4v.app/v1/lnurlp/qrcode/brianoflondon?cache_flush=false any Hive account @v4v.app is a valid Lightning Address because of my work. So I'm quite familiar with the resources needed to handle these calls and I know for a FACT that if we tried to use Lightning addresses instead of keysend to a node, my system would die. I dare say I could bring down ANY current Lightning Address implementation with 100 calls per minute to get invoices for 5 sats. |
In our private discussion I also said that even one additional http call can impact performance. For sats streaming, there's a one minute timeframe to complete all the payments and there are episodes with 10+ splits (i.e. more than 10 different destinations). So it's not one http call, it could be more than 10 calls in a low bandwidth environment (we serve clients all across the world). If there's a split limit - maybe. But an invoiceless solution is a better tool for this use case. |
Let's decouple Lightning address from lnurlp. The spec can easily support Lightning address if it's extended to support keysend. The v4v has custom key/value for these use cases, but it doesn't require custodian nodes to enable keysend support. It's true the 1min timeframe is a recommendation, but less batching the better because it ensures podcasters get paid even if the use stops listening. It's less streaming as the timeframe is longer. |
Because I'm not a bitcoin maxi and I am intellectually open to all things NOT bitcoin IF they're made by people smarter than me (usually the case) and not owned and operated by VC's and big Silicon Valley deuchebags, I can also spot the problems with Lighting. Here's a concrete example: This is my system receiving a keysend payment of 30 sats. Notice how I first get notified of an un-settled invoice at time 273.906826. My logs don't even have the resolution to spot when the notification of payment comes in at 273.907441 which is 0.000615s later which is under a milisecond. I have to say my opinion of keysend went up dramatically when I actually implemented both the receiving side (shown here) and the sending side (which nobody appears to have ever published a Python implementation of before and which I have made open source). Its only when you dig in to these protocols and actually use them that you fully understand them.
The song and dance involved for LNURL always takes 500ms or so and more usually a second. I don't have particularly great logs on the system generating the LNURL invoice callbacks to compare but the simple fact is Keysend is actually damn good. |
Assuming that's true (which I strongly doubt): That's not because of LNURL but because Lightning is an interactive payment protocol. If you can bring down an LNURL endpoint because of this, you'll be able to do the same thing with keysend. Obviously, were confusing two very different issues in this thread: Server-side optimization and client-side optimization. I think the former is negligible (as per my previous comments). The latter is an annoyance and I won't pretend that I know how mobile clients behave under these circumstances. I am almost certain though that the ability of LNURL handling 10x6 payments per minute can be demonstrated and I will prove it. LNURL isn't the bottleneck, Lightning is. |
It seems like it'll be difficult to reach a consensus on how many HTTP requests exactly are too many for a client in bad networking conditions to handle. As mentioned by others in this thread, while keysend certainly seems to be the more efficient option from this point of view, LNURL-p may make adoption easier on the receiver side. It certainly won't replace keysend, and it shouldn't. But it might still be worthwhile to consider it as an additional way to receive payments. If it can be implemented without a huge toll on performance on the sender side, that is. In cases where the additional HTTP requests of LNURL-p are too much of a burden for podcast clients, then this boils down to the question of whether it's feasible to batch payments together. As @dergigi mentioned, the spec does allow this:
The concern from @kingonly is valid, though:
Essentially it is now a question of how a client could handle this. If a receiver supports keysend, payments can be streamed in short intervals just as it is done currently. But if a receiver only supports LNURL-p, then a podcast client would need to be smart about it and, in cases where it's needed (bad network conditions, lots of value splits), resort to batching payments over longer time intervals, or even cache payments for a later time (e.g. for when the network comes back online). Batching payments is certainly not ideal, but maybe it's still worthwhile. Everything's always a tradeoff. If a receiver wants to receive via LNURL-p then they also need to accept that payments won't always be streamed in such regular intervals as they would be when using keysend. The question is if this tradeoff is worth it. I reckon it might be. Any thoughts? |
Alternatively, custodians can support keysend/AMP... I guess I don't fully understand
|
I think adding an extra layer of indirection (like LNURL) would be a good thing.
I also believe that the current focus on being able to do a constant stream of ultra small payments is misguided and clients should batch more aggresively. You can still market it as streaming value, nobody cares. The whole system is based on voluntary donations anyway. Calculate donations once every 10 to 30 minutes, every minute is overkill. |
You don't need to use the pubkey if we add keysend support to Lightning address. I wrote it several times in the thread. p.s. you can use routing hints with keysend or use AMP. |
For all the LNURL people here there is a need for one thing you could put in the spec and I see a necessity for it. I'm not sure how well we'd do at getting it adopted now that Keysend is baked in but problems this week with LNPay have show a need. We need a VERY SIMPLE spec that just says for a specific lightning address, in the current format which we're all using which unfortunately looks like an email address, to return the correct Keysend routing info. Example:
Returns just the json:
That would allow for some ability to dynamically move to a new node. Then in our XML we would have something like:
This adds one Get request but that can probably happen at the index side. You'd have to write the spec first and then we could see if there was a push to make this happen across the existing app landsacape. |
That's similar to the spec discussed in the lnurl mafia group. You're missing routing hints, but generally it's the same. |
As far as I know, nobody has added routing hints to any XML value block but I think they're allowed. I don't think anyone on the Podcasting 2.0 side will do any work on this until you've got a working LNURL spec and then LNURL proponents will need to push it. I'm just suggesting what it would take. |
LNURL ≠ Lightning Address |
I've implemented Lightning Addresses so I'm aware that there are a bunch of things lumped under LNURL. It's the only part I can see as having anything useful for us here. The other parts of generating invoices and passing them to podcast players would add so much more complexity. I was trying to make a constructive suggestion of an area the LNURL guys can work on if they want to help. |
+1 for an internet identifier / lightning address that returns keysend information. For LNURL in podcasting 2.0 we also need to think about boostagrams. Those are essential to the p2.0 ecosystem I think. |
Why do you need something in lnurl? Send the same TLV as part of the payment. |
I guess so. true ideally that is then still the same if possible. |
Both Fountain and Alby now have https://fountain.fm/.well-known/keysend/merryoscar Could we proceed by:
I think this is really important so we reduce user friction of adding new splits from:
to:
The value block is difficult to understand whereas people more intuitively understand lightning addresses. This also solves the issue of having pubkeys in the feeds. @daveajones @bumi @kiwiidb @callebtc @kingonly what do you think? I should also note that hosting providers RSS Blue and Sovereign Feeds are already using the above keysend lookups from Fountain and Alby to add splits into feeds. |
I support this format already. Any Hive account name will give a valid keysend return from v4v.app. |
@MerryOscar I think first step is to add get the extension PR approved in the lightning address spec (that the way to deal with step 1). Then, decide on migration path. Not sure having 2 apps support it is enough. I think we need to get most of the apps to support it and start documenting it in an table. Ideally it should also be optional tag in valueRecipient till most apps support it. Podcasters are not aware of partial compatibility. I think the best way to it is add it as an optional value, something like:
We don't need to change the value tag imo. |
If we add Perhaps we also need a spec number for Value Blocks? If we're on 1.0.0 now, will this be 1.1.0 or even 2.0.0 because this WILL break stuff if someone puts out an RSS feed with only an With a spec number, if a client sees no spec number in an RSS feed it knows what to do. If it sees 2.0.0 it will know to either make a call direct to resolve the For my part I can add All the apps which currently act on Value Block info. Obviously Dave can make the API work to return the correct values based ONLY on an But any app which looks at RSS feed is going to have to make that API call for the |
BTW I have this:
returning my custom key value data for all 3speak shows. {
"status": "OK",
"tag": "keysend",
"pubkey": "0266ad2656c7a19a219d37e82b280046660f4d7f3ae0c00b64a1629de4ea567668",
"customData": [
{
"customKey": 818818,
"customValue": "brianoflondon"
}
]
} |
I don't think versioning should be discussed as part of this PR, and generally think it's a overkill. I rather KISS. |
I'm sure the sleeping yanks will have something to say when they wake up but if we're going to break existing stuff we kind of do need a version system I think. Every single app currently processing V4V from an RSS feed alone (I don't think anybody does this now but this should be the goal when we can shuffle PI out of the shim position) will need to react differently if there is ONLY and lnaddress in an RSS feed. |
This spec isn't intended for humans - so a podcast hosting company (aka "Entity Writing The RSS") should be able to run the Perhaps advice for RSS generators might be: "If a user has only supplied their lnaddress address, we recommend periodically retrieving the pubkey and customdata from Alternatively, an optional lnaddress could be added to the spec, and our advice for apps could be "where a podcast publisher has specified an lnaddress within the podcast:value tag, you should retrieve the pubkey and customdata directly from their Keen to avoid potential breakage. |
My point was not to have the versioning discussion in this PR |
I was suggesting lnaddress an an optional parameter at first till we achieve implementation consensus |
I think we can do this properly one and done. |
@kingonly yep that makes sense
@kingonly @jamescridland ok yes this makes sense. So we add an optional @daveajones what do you think? |
Looking through this now. |
I agree on making the smallest change possible, so just adding an optional |
To me the current spec is very generic and universal. Very well designed. We have the universal The ln address would also only work if it supports the keysend option. If this validation does not happen on the hoster side listeners will be frustrated when it does not work. I like the recommendation to periodically refresh the pubkey and customdata from /.well-known and update it in the RSS feed. And developers should be aware that the data might need to be changed. The |
We need a migration path in any case. Since I don't control the hosters, I rather do something optional in the clients. Also the period refresh seems complicated and isn't robust. And a nit to the current spec: lnaddress isn't lnurl. |
is the goal of the migration to fully support LNURL-pay? or we want to get the keysend data out of the RSS feed and behind a HTTP request? |
The latter |
how do clients currently deal with multiple value blocks? I think this came up somewhere else, too. |
lnaddress isn't another form of payment in my mind. I think the whole idea here is to migrate from keysend to lnaddress, so I'm just offering a migration path. We can add another optional value block, but I don't see the point if we want to deprecate keysend. When bolt12 comes, we'll add another block? It's super complicated imo. It's better to standardize on one Lightning value block. |
This PR adds the LNURL protocol.