Hi,

I just wrote a tweet thread about how onion routing works at a high level in the lightning network.

Would love to answer any follow up or deep-dive questions people might have about it in this thread.

119 sats \ 1 replies \ @kr 26 Jul

Can’t wait for more John Cantrell content on SN ⚡️

This read-only view of the Twitter thread may be easier to read:

https://nitter.it/JohnCantrell97/status/1552008378901209089

How does one use nitter? it's like a repository of twitter and more private?

Nitter is an alternative Twitter front-end. There are many instances of Nitter out there. nitter.it is one of them. Nitter.net is the "official" one, but it is used so heavily nitter.net can show that it has had too many requests.

So take any link for a Tweet and change from to Twitter.com to Nitter.it (or whatever Nitter instance you wish to access), and share that.

Then when the person you shared the link with opens that link, the Nitter instance goes to Twitter and pulls the Tweet and whatever else it needs from the Twitter thread (if it is a thread), and then renders it in a standalone web-page.

Nitter is open source, so anyone can run their own nitter instance.

Nitter https://github.com/zedeus/nitter

35 sats \ 0 replies \ @lrz 27 Jul

Nitter is more lightweight and more private than Twitter.

Tip: Use https://github.com/libredirect/libredirect to automatically redirect any twitter.com link and automatically load balance across Nitter instances

Great thread! Here's the Onion Routing section of the spec for anybody that wants to dive deeper: https://github.com/lightning/bolts/blob/master/04-onion-routing.md

One fun fact is that the routing schema is based on the Sphinx construction, which is where Sphinx.Chat got its name from.

Here is a little visual to go along with your thread

How TOR works - onion routing: https://youtu.be/QRYzre4bf7I
115 sats \ 3 replies \ @And1 27 Jul

If no one on the route knows the sender and the recipient. Wouldn't it be possible to create a payment with a fictitious recipient to spam the network?

Yes, this is possible. The last hop will fail the payment because it won't know who the next hop is supposed to go to.

What is more common is to have the payment hash be set to a random value so the sender knows for sure the payment will fail. This is called "probing" and people do it to figure out if a payment for a certain amount will work on a given path.

It's VERY spammy at the moment, something like 90+% of payments over lightning are currently probing attempts that fail (on purpose).

110 sats \ 1 replies \ @And1 27 Jul

Wow, more than 90% sounds sick. Are there any attempts to prevent this, or is it intentional?

Yeah it hasn't been too much of a problem so far. It might be more than 90% honestly. I've seen some reports of 99%.

I'm not actually too versed on potential solutions but I think it will need to be addressed at some point. I know there are a couple competing ideas people are arguing about trade-offs over but no obvious solution at this point.

That's a pretty good summary but worth noting that it describes specifically Sphinx onion routing (the onion routing in Tor is not the same). See the paper.

For people who want to understand it in a bit more detail, there is a great writeup with diagrams in Mastering the Lightning Network

Whoops, my bad. I just assumed it was basically the same. I guess it's still onion routed in the sense each layer is encrypted for the next hop? I'll have to look into how tor works at some point.