Author

Topic: Why doesn't c-lightning connect you to a list of peers by default? (Read 189 times)

hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
If it's a normal thing then it's hard to see how LN anodes can protect themselves from "influence attacks" (or whatever they're called) where a few nodes with a completely different and wrong blockchain connect as the only peers to another node, tainting its knowledge of what is the correct tip.
It's actually not even that easy to run a Lightning node without having Bitcoin Core running. Maybe it got easier, but last time I tried it was pretty bad. Grin Ended up just getting a disk of the required size for that node.
It's definitely essential for an LN node to know the status of the blockchain with full confidence. So either a full node runs on the same machine or the task is delegated to another machine which you trust (best control) and takes over the 'controlling' task - a watchtower, as Rath_ already said.

Do you have practical experience with autopilot mode / plugins? Depending on implementation, it might drive centralization by going for the 'safe bet' (mostly going for channels towards large, well connected hubs).

I have only used LND's autopilot for a short moment back in 2019 and it always prioritized large nodes (especially ACINQ which always causes problems for me). I glanced over their GitHub and it looks like they have made quite a few improvements. I prefer to open my channels manually now.
That's good to know! It was kind of what I was expecting, since connecting to large hubs is the 'safe bet' strategy without too many what I call 'false positives' (opened channels that turn out useless).
Would be interesting to try if with all the code changes it got any better; I'm sure the developers of such plugins should be able to test their implementation through simulations (or better, the model based on which they write the logic code).
legendary
Activity: 1876
Merit: 3132
1) Getting a list of IPs through gossip protocol

...and DNS bootstrap.

Do you have practical experience with autopilot mode / plugins? Depending on implementation, it might drive centralization by going for the 'safe bet' (mostly going for channels towards large, well connected hubs).

I have only used LND's autopilot for a short moment back in 2019 and it always prioritized large nodes (especially ACINQ which always causes problems for me). I glanced over their GitHub and it looks like they have made quite a few improvements. I prefer to open my channels manually now.

Is that a network trend, or just an anomaly with your node that you're only connected to 1-2 peers?

I am connected to all of my channel peers (10 connections) and occasionally some random Lightning nodes connect to me (or vice-versa). My Bitcoin node has far many more connections.

If it's a normal thing then it's hard to see how LN anodes can protect themselves from "influence attacks" (or whatever they're called) where a few nodes with a completely different and wrong blockchain connect as the only peers to another node, tainting its knowledge of what is the correct tip. Since Lightning nodes are just thin wrappers around bitcoin nodes, it would be easier to carry out this kind of "mind control" of an unsuspecting LN node

Here's a paper describing such an attack. You should be fine if you run a watchtower at a different location. Most Lightning Network nodes are connected to full nodes which are less susceptible to this attack.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Usually, 1-2 random nodes are connected to me at a time. Such connections are used only to exchange gossip messages.

Is that a network trend, or just an anomaly with your node that you're only connected to 1-2 peers? If it's a normal thing then it's hard to see how LN anodes can protect themselves from "influence attacks" (or whatever they're called) where a few nodes with a completely different and wrong blockchain connect as the only peers to another node, tainting its knowledge of what is the correct tip. Since Lightning nodes are just thin wrappers around bitcoin nodes, it would be easier to carry out this kind of "mind control" of an unsuspecting LN node.
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
While a full node discovers peers and subsequently also automatically connects to them, a Lightning node doesn't.

Actually, they do. Connecting to someone is not the same as opening a channel to them. You can use lightning-cli connect with no consequences Wink Usually, 1-2 random nodes are connected to me at a time. Such connections are used only to exchange gossip messages.
That's true! I didn't want to overcomplicate. But then technically there's 3 types of 'connecting to peers by default' to consider in LN.
1) Getting a list of IPs through gossip protocol
2) Creating connections (free, mainly for gossip communication)
3) Creating channels (lock up funds)

But automatically connecting (creating channels) doesn't make sense - I hope it is easy to follow why, now.

Autopilot is a thing, but I have never seen one that closes channels immediately once the other peer goes offline Grin
Do you have practical experience with autopilot mode / plugins? Depending on implementation, it might drive centralization by going for the 'safe bet' (mostly going for channels towards large, well connected hubs).
legendary
Activity: 1876
Merit: 3132
While a full node discovers peers and subsequently also automatically connects to them, a Lightning node doesn't.

Actually, they do. Connecting to someone is not the same as opening a channel to them. You can use lightning-cli connect with no consequences Wink Usually, 1-2 random nodes are connected to me at a time. Such connections are used only to exchange gossip messages.

But automatically connecting (creating channels) doesn't make sense - I hope it is easy to follow why, now.

Autopilot is a thing, but I have never seen one that closes channels immediately once the other peer goes offline Grin
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
I think the question was answered well already, but I want to make it clear that in LN, peer discovery (getting IP addresses of other nodes) and 'connections' are less tied together than for the underlying Bitcoin node network.
While a full node discovers peers and subsequently also automatically connects to them, a Lightning node doesn't. The reason is that a connection (channel) in Lightning requires you to commit funds so you're more 'locked' to that peer than in the Bitcoin network. A Bitcoin node can connect to any random peers because if they prove unreliable / as soon as they go offline, they just create a new connection to another peer.
However, opening and closing LN channels automatically as peers go offline and online, would quickly get expensive.

So I think it is easy to understand that LN node operators prefer to choose themselves with whom they commit to a Lightning channel and if they don't know anyone, it's also really easy to find IDs of large hubs that allow you to easily reach most other nodes in the network. It is less desired for decentralization though, so different users want different channels.

Automatically getting a list of node IPs does happen though; as was explained before. This allows me to create a channel with someone by just entering their node ID instead of having to specify the IP and port as well.
But automatically connecting (creating channels) doesn't make sense - I hope it is easy to follow why, now. Smiley
full member
Activity: 206
Merit: 447
In Bitcoin Core, there is a DNS seeds feature which makes outgoing connections from your node to a list of vouched bitcoin nodes.

But as far as I know, in C-Lightning, there is no such feature and you are completely isolated from the network at startup.

Does c-lightning not have a discovery feature where you can query peers for other peers? I have Tor enabled.

As far as I know all lightning implementations have DNS bootstrap. It is specified in BOLT 10.

Looking at C-Lightning source code, there are references to DNS usage. There is also config flag disable-dns. Look it up yourself here.

legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Another issue I've noticed is that the list of IP addresses in the contrib/bootstrap-nodes.sh file are mostly offline. Out of the 10 nodes, only 2 of them connect successfully. It is difficult to find other people's nodes on internet pages.
Doesn't the same apply on Bitcoin Core's seeds if most go offline? Wouldn't you start searching for nodes on the internet? Not that they are offline, though.

Yeah by the thing is though that that Core devs would notice that and discuss the issue on Github and the mailing lists and then promote a node or two to the DNS seeds.

But the bootstrap-nodes script looks pretty much abandoned.

Also, on L1 there are websites such as addrnodes (or whatever that node explorer site was called) that shows you all the online Bitcoin nodes in a particular region, but as far as I know, LN just has a bunch of block explorers with Lightning addresses on them, but that doesn't guarantee any of them are online at the moment, and so adding peers on L2 is more of a trial-and-error process.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Another issue I've noticed is that the list of IP addresses in the contrib/bootstrap-nodes.sh file are mostly offline. Out of the 10 nodes, only 2 of them connect successfully. It is difficult to find other people's nodes on internet pages.
Doesn't the same apply on Bitcoin Core's seeds if most go offline? Wouldn't you start searching for nodes on the internet? Not that they are offline, though.
legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC
Here are some nodes to start with: https://bitcointalksearch.org/topic/m.54940969

It might be a good idear to add your node to the list to, that way others can open channels to you aswell (if they want to)
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
According to BOLT 7, Lightning doesn't rely on third parties to disseminate the peer list. So, it either contains IP addresses of several nodes, which doesn't seem to be the case, or you don't know any node on startup, but get the IP addresses the moment it connects to one node. (That'll then send their peer list etc.)

Another issue I've noticed is that the list of IP addresses in the contrib/bootstrap-nodes.sh file are mostly offline. Out of the 10 nodes, only 2 of them connect successfully. It is difficult to find other people's nodes on internet pages.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
According to BOLT 7, Lightning doesn't rely on third parties to disseminate the peer list. So, it either contains IP addresses of several nodes, which doesn't seem to be the case, or you don't know any node on startup, but get the IP addresses the moment it connects to one node. (That'll then send their peer list etc.)
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
In Bitcoin Core, there is a DNS seeds feature which makes outgoing connections from your node to a list of vouched bitcoin nodes.

But as far as I know, in C-Lightning, there is no such feature and you are completely isolated from the network at startup.

Does c-lightning not have a discovery feature where you can query peers for other peers? I have Tor enabled.
Jump to: