Avatar
Matt Corallo
3d2e51508699f98f0f2bdbe7a45b673c687fe6420f466dc296d90b908d51d594
10th known contributor to Bitcoin Core. Now Full-Time Open-Source Bitcoin+Lightning Projects at Spiral (Part of Block).

It’s kinda funny that there’s now legal betting on US election outcomes on CFTC-regulated markets through brokerage accounts but you can’t place the same bets at a casino.

Yea, you can do multisig channels (indeed nested musig) for lightning (well, 66%+1, not 50%+1, sadly), but you’re still doing the “I communicate with some third party over your internet before I pay you for it”.

But, yeah just giving people a tiny bit of internet works fine mostly. Even airplane WiFi with credit cards lets you access DNS before you buy…

It’s just a head-of-line-blocking question, though…I imagine mostly you’re not downloading lots of CSS/JS/images, which is the big head-of-line issue HTTP clients have - they can render the page partially in response to each new item they get off the wire.

I assume you don’t, really, though? You presumably get events back from the server in time-order and populate the page down in time-order, so mostly one event stalling the next won’t make all that much difference in UX?

I mean if you drop the TFO requirement it’s easy - just open many connections. But just fetching many resources isn’t sufficient to want QUIC - you have to be doing so immediately after opening the connection(s), the resources have to be non-trivial in size (think 10s of packets, so the text of a note generally doesn’t qualify) and have a need for not blocking one on another, which is generally not the case on a mobile app - server can send the first three things you need to paint the full window first and then more later.

Replying to Avatar waxwing

The first point is that when I said "technically you don't" I meant that even if it seems crazy, there is no rule that says you *couldn't* implement systems where say you had a LN channel from earlier setup and you logged in with credentials that convert to a signing key.

Consider credit cards; the earliest security model which still exists, is magstripe and it's 100% insecure in the sense that you must trust the vendor's terminal not to skim your private data. The most recent version of this tech signs from a chip as well as using a PIN. While we have nothing like this for LN usage, I'd have to ask: is there a reason it couldn't work? I mentioned bolt cards, that's a step in that direction.

One reason that the credit card (old, insecure) model is more uncomfortable here is because LN is a self-custodial and privacy focused tech, i.e. more cash and not account/custodial; that's more autonomy but harder for resource-limited users, right.

The nicer thing about ecash based systems is the interop with LN so that you can have money passed between mints but that could end up quite complex/fragile (and arguably worse trust model than single mint!), while the more easily imagined case: merchant and customer use the same mint, means that you're back to the limitations that you'd have if some channel or channel topology had to be pre-existent beforehand (possible of course, but more limited than we'd like to imagine). With both a trust requirement, *and* "topology"/"coordination" requirement, I believe an awful lot of very clever setups could be made to work. Though I suspect an ecash mint would beat them all in terms of privacy model, that's where it shines. Doubt that the targeted users would prioritize that, though.

At least directly with lightning, it’s not immediately obvious how you could reveal a key that only allowed you to spend up to some limit. The normal setup in lightning is your key can sign for the whole 2-of-2 channel balance. With pre-setup you could have some extra output on the commitment transaction and a new sub-channel that you could give the recipient control over, but you’d need to have that set up in advance for the exact amount you want to send (and it’d be a fairly complicated protocol extension for everyone to support). Probably just use ecash for the initial minute and then pay with lightning for further minutes after you’re online.

I think the difference is that with ecash the buyer choose who to trust and only trusts them. With your setup the buyer needs to trust the seller to some extent to use their infra to log into a custodial wallet. I’m not sure that’s a great idea.

Note that QUIC is useful on the web for helping to and the multi-connection/head-of-line blocking problem. But if you aren’t fetching a bunch of resources from the same server across different streams where you can use each resource individually on its own this doesn’t apply (and it requires integration work to make it apply).

TLS’ only issues aren’t just CAs being a mess, it’s also an anachronistic protocol that just isn’t how you’d design something today. 1.3 is better, sure, but it carries tons of legacy garbage and most clients still have fallbacks and logic for it.

I also dislike QUIC for being a lazy, poor version of TCP. Middleboxes suck sometimes but sometimes do useful things (eg on a plane TCP is terminated before it goes to the sat, improving latency and throughput compared to UDP things with retransmissions, middleboxes can use MSS clamping to avoid fragmentation, etc). QUIC largely failed to consider these things and just said “screw all middleboxes” (compare to eg tcpinc which got similar encryption properties without being lazy). QUIC exists to rebuild TCP in user-space cause kernels sometimes suck, but for those of us with an operating system newer than five years old that’s not a problem we have. Worse, sometimes your OS has specific useful features (eg MP-TCP) that you don’t want twenty apps to have to rewrite. FFS this is literally the point of having an OS! The only promise QUIC made that isn’t as trivial in TCP is FEC, but they gave up on it cause…I dunno why.

Mmm, right, so doesn’t work noncustodially :/. Also sketchy security :(

That doesn’t allow a payer’s lightning wallet to access the internet, though?

Admittedly I wasn’t really thinking about web apps in the above design though. Nothing specific shouldn’t work except that the spec explicitly says wallets can’t open a callback URI that has a scheme of http(s). I was worried about it being a way for a payee to discover the payers IP, but I think maybe it doesn’t matter.

The web client shouldn’t be fetching the invoice, it just passes the whole offer on to the wallet and asks it to pay. When the wallet completes it does a callback to the initiating app.

I think it’s required. If we’re flipping it to have the nostr zapper broadcast the zap (which we should) you need to cryptographically tie the nostr zapper to the payment proof somehow.

I can see the argument for returning the key explicitly (it’s simple, the initiating app is the payer, kinda), but it feels pretty gross (two copies of a key always bad if you can only have one). Seems cleaner to just pass the message in the original URI?

No no, for offers. Imagine Nostr app wants to zap using BOLT 12. It does a system open for bitcoin:?lno=lnoffer&pop=proofcallback, but it ultimately needs the proof to include “Bob zapped with emoji🫠”. So either the proofcallback has to include the private key or that original URI has to include the string to sign.