How to Scale the Lightning Network and Protect Against Highly Connected Nodes Through Autopilot, Onion Routing, and Neutrino. The Lightning Network is set to change the world of Bitcoin with instant settlements and off-chain transactions, but have you ever wondered what it might look like? Well the good news is that we don’t have to speculate because Jack Mallers recently tweeted out an exciting snapshot of what the testnet for the Lightning Network (LN) currently looks like:
As you can see, there seems to be quite an equitable distribution of channels to nodes throughout the network. Without centralized nodes, coins are transferred through a technique called “multiple hops.” This allows your coin to be sent by hopping node to node to reach its target destination.
But How Does It Scale?
People could continue to build on top of this network by randomly attaching to nodes they choose. The advantage of this type of network is that it would truly be both a politically and architecturally decentralized system. However, one significant downside is that it risks a single point of failure which could put hundreds of nodes in the dark. This is not ideal. Therefore, an alternative structure to consider for the LN is the Scale Free Topology.
What’s a Scale Free Topology?
A Scale Free Topology increases the efficiency in communication between nodes, reduces the risk of a single point of failure, and maintains a relatively decentralized network. It is a minimum spanning tree with no loops that connect back to nodes.
This type of topology has a degree distribution of nodes which follows a power law. This means that a specific ratio within the hierarchy of connected nodes must always be maintained. As newer nodes are connected to more connected nodes, some will also be distributed throughout the network to maintain the power law ratio. By having various sized nodes throughout the network(e.g. 1000:250:62.5), the LN can prioritize efficiency as well as maintain the structural integrity by preventing a single point of failure. Here’s a visualization of what this might look like:
As you can see, there will be a quite a few highly connected nodes. Now there may be some hesitancy towards this type of structure as there is some degree of centralization required for the sake of efficiency. The two most common concerns regarding highly connected nodes are:
-
How powerful will these highly connected nodes be in the network? Will they act like banks?
-
What about privacy? Will our data be stored or recorded?
These issues can be addressed when we consider the structure and privacy of the Lightning Network.
The Structure of the Lightning Network
Equating highly connected nodes to banks is a false equivalency because they are limited in several capacities:
-
They have essentially no power of censorship because they will be unable to see addresses or transactions through Onion Routing and types of transactions due to MAST. This means anyone can connect to any node with near-zero cost to switch layers.
-
There is a huge disincentive for supernodes to form because they become central points of failure for the LN.
-
They have no anti-competitive/monopolistic powers. In fact competitiveness between highly connect nodes will likely decrease LN fees that they may charge.
-
Highly connected nodes can’t take users’ money with them if they fail or are attacked with a DDOS through Hash Time Lock Contracts.
-
The structure of the Lightning Network can be developed through Autopilot should nodes opt-into this protocol. This program will “automatically manage channels according to a set of heuristics defined within the main configuration for the autopilot.Agent instance.” It will also factor in “min and max channel sizes, a limit on the number of channels, and the percentage of wallet funds to allocate to channels to drive the global graph towards a scale free topology.” In other words, autopilot will open and close channels for nodes based on the needs of the network, which can also be used to push the LN towards a Scale Free Topology.
-
This means that the hierarchy of nodes won’t necessarily be determined by companies, banks, or even exchanges. Rather, it is organically grown through a process that focuses on efficiency and structural integrity. This removes the risk of political incentives advantageously formatting the Lightning Network toward a particular party.
-
Also, Autopilot is opt-in and therefore isn’t mandatory. This means that channels will still have the freedom to attach to any node they want.
-
Finally, using the Lightning Network doesn’t mean you have to access the whole system thereby avoiding these highly connected nodes. For example, I may have a smaller node within the LN dedicated to my housemates to reimburse the person who pays the bills. Our transactions would remain within our node only. Here’s what that might look like:
Privacy Within the Lightning Network
The Lightning Network Development team is also developing 2 key pieces of technology to facilitate privacy within the Lightning Network:
-
The Lightning-Onion Protocol: The Lightning Network uses onion routing to securely and privately send transactions. This means addresses and transaction paths (# of hops) will be hidden from all LN nodes while still being able to push transactions through.
-
Neutrino, a light wallet Roasbeef designed with the LN in mind, also adds privacy by loading only the needed blocks of the blockchain but not saving them.
Conclusion
In this article, we considered 2 ways the LN can scale: 1) random networking 2) a Scale Free Network. Should it scale through the latter option, users of the LN will be protected against highly connected nodes through Autopilot, Onion-routing, and Neutrino. Autopilot prevents the growth of the LN from being politically motivated and facilitates a Scale Free Topology. Onion-routing hides addresses and transaction paths from nodes while pushing transactions through. Finally, highly connected nodes won’t be able to save blocks if they utilize the Neutrino light wallet. In light of all of these technologies, LN users can rest assured that efficiency, structural integrity, and privacy will be maintained.
*Special thanks to Jack Mallers and Clark Moody from the LND slack channel for all their insight. If you’d like to get involved with Lightning Network Development team, you can access their github here: https://github.com/lightningnetwork/lnd/. Or you check out this website to learn more.
Don’t forget to follow, give me a couple claps on the left, and share with your friends on your way out. 😁 Until next time, onwards and upwards!
L.S.C. Donation Addresses:
LTC: LgGHRsbYHs93gKttBMehLzth3xDAU3tCSZ
BTC: 3HFCMjr6xQKSfmU7wCPzrZJVvgwrdf7Qzd (Segwit address. Legacy and Segwit chains accepted)
Sources
https://github.com/lightningnetwork/lnd/releases
https://github.com/lightningnetwork/lnd/commit/306c4aef8e3af44fb3f2d8f52fc887f2c48e9c04
https://github.com/lightninglabs/neutrino
https://en.wikipedia.org/wiki/Scale-free_network
https://en.wikipedia.org/wiki/Barab%C3%A1si%E2%80%93Albert_model
https://en.wikipedia.org/wiki/Power_law