Introduction

If you want to run your own Lightning node, there are currently three main implementations. In this slightly more technical post, we'll briefly introduce them and then we'll look at their market share, including how it can be obtained.

Overview of implementations

Lightning Network is a payment network that allows anyone to create their own node implementation. To be compatible with the rest of the network, you just need to follow the BOLT specification. However, this is very complex task and so the vast majority of users will use some already-made solution/implementation.
Today, we have three main implementations to choose from:
  • Lightning Network Daemon (LND) from Lightning Labs
  • Core Lightning (formerly c-lightning) from Blockstream
  • Eclair from ACINQ
LND is definitely the most widely used Lightning implementation, which stands out for its simplicity and friendly API. LND is also part of the vast majority of ready-made solutions such as Umbrel, myNode or Raspiblitz, where it is often the only (or at least the default) implementation. Because of this, it has a large number of additional tools/extensions made by community and is suitable for beginners. However, advanced users or large nodes operators can use it also for sure. Recently, however, this implementation contained two vulnerabilities that slightly damaged its reputation.
Core Lightning is an alternative implementation and a "number two on the market" that is known for its stability and modular architecture. This means that you can install a lot of extensions in the form of standalone plugins in addition to the basic features. This makes it more suitable for slightly more advanced users who can customize it as they want.
Eclair targets more corporate clients, i.e. giant nodes with a very high number of channels and transaction volume. This implementation allows the node to be spread across multiple servers that distribute individual tasks among them using loadbalancing methods. Compared to previous implementations, there is a minimum of any community extensions.

Cltv_delta parameter and gossip protocol

Within the lightning protocol itself, there is no "header" anywhere describing which specific implementation the node uses. Thus, it is unrealistic to find out the percentage distribution of node implementations exactly.
But we can make a relatively good guess. How? Each implementation has slightly different default values, and we take advantage of that. One of these values is cltv_delta. This is the number of blocks the node reserves for HTLC processing when forwarding a payment. In other words - it is the time difference between the outgoing and incoming HTLC.
The lower we set the cltv_delta value, the more risk we take, since after forwarding the payment towards the recipient (and getting payment_preimage) we have less time to contact the node towards the sender and get our funds. This may even end up in a force-close in the form of an on-chain transaction if this node is unavailable for long time, where this parameter then plays a crucial role.
On the other hand, a very high value means that the sender's resources may be locked for a longer period of time in case of problems, so this route is usually less preferred.
It should be clear from the text above that there is no one correct value (although the BOLT specification partially defines it) and so each implementation has chosen it in its own way:
  • LND has 40 blocks by default
  • Core Lightning 34 blocks
  • Eclair 144 blocks
The cltv_delta value is propagated through the network within the gossip protocol in the channel_update message along with information such as fees, minimum and maximum HTLC, etc.

Practical part and finding the share of implementations

We will need a network graph - a list of all nodes and channels. This graph is public information and is maintained by each node. Unfortunately, there is no one correct graph. In fact, due to the way it is propagated, each node may have a graph slightly different from the others. Therefore, for these calculations, I used graphs from multiple nodes and averaged the results. The individual differences were below 1% for all parameters.
Next, we take advantage of the fact that most node operators do not understand the cltv_delta parameter and so they leave it in its default state. Thus, if the values of cltv_delta are the same for all channels of a given node, and at the same time this value corresponds to one of the defaults, it can be assumed that this is a given implementation.
If, on the other hand, at least one value of cltv_delta is different from the others or is not one of the default values, the node operator obviously modifies these parameters and cannot be relied upon. We discard such nodes from our statistics. Fortunately, this is only less than 7%.
To maximize the accuracy of the results, I excluded those channels that have not sent channel_update within the last 14 days, so according to the specification they should be considered outdated. Now is the time to create a script that will process the relevant data.
So what is the result? Exactly as expected, the LND implementation dominates. In other words, 91% of Lightning nodes have the cltv_delta value set to 40 blocks for all their channels, so this is most likely LND.
By the way, these results are almost identical to the study from September 2020. Here, additional parameters were used, namely the minimum HTLC size and fees. The result was then calculated based on different weights for each parameter, with cltv_delta having the highest weight (75%). Since a lot of tools have recently been developed that automatically adjust these parameters, I did not include them in my calculations.
In addition, other interesting information can be retrieved from the graph, such as the average number of channels for a particular implementation or the average total capacity of a given node.
As can be seen above, the results support the description of the individual implementations from the beginning of this post. LND makes up the vast majority of the network due to the fact that it is part of most ready-made solutions, but these are primarily smaller nodes. In contrast, Eclair is on the other side of this ranking, as it powers, for example, the ACINQ node, which currently has nearly 3500 public channels and thousands more private ones. And somewhere in the middle stands Blockstream with its Core Lightning implementation.

Conclusion

Finally, it should be noted that the above figures are only an estimate, because:
  • Anyone can arbitrarily change the parameters and thus, purely theoretically, impersonate a different implementation, although there won't be many such cases.
  • This data has been created based on public channels and nodes only, so it does not contain e.g. information about mobile nodes/wallets.
  • There are other options for running nodes, such as building your own implementation using the Lightning Development Kit (LDK).
  • At the same time, I used current default values - for example, LND in the past (until April 2019) used a value of 144 for cltv_delta (as does Eclair today), which was subsequently changed to the value described above. Extremely old implementations may therefore slightly bias the results, but even here I don't expect this to be a large sample.
Cool post. I do like LND but it would be nice if other implementations had more of a market share! Better for the health of the network.
reply
Really interesting post. Is there a good way to estimate the number of people building their own LDK nodes?
reply
No, LDK is much more 'DIY' and doesnt include common default params
reply
LND users are disproportionately likely to use default cltv_delta
non-LND users are more likely to match LND defaults for opsec
reply
That is true, though they will also have to match them on feature flags so there's other fingerprints besides CLTV https://github.com/endothermicdev/impscan
reply
This is pretty wild... why would anyone actually use LND over CLN? Asking as a relatively noob node operator that went straight to CLN
reply
Fantastic post!
For the averages, it might be more useful to show median value instead because especially the small number of Eclair nodes can easily be just one extra large node, and thus median would be more useful statistic.
reply
and this is just for public nodes... not counting the private ones (as mobile nodes - Breez, Blixt, Phoenix, OBW, Electrum)
reply
So Rust lightning is practically non-existent? Why?
reply
Thanks for sharing
reply
Awesome! One of the best post to learn about Lightning network and how does it works
Thx
reply
нужно знать чьих рук дело. кто хочет именно этого.
reply
stackers have outlawed this. turn on wild west mode in your /settings to see outlawed content.