Bitcoin: Attaining Full Lightning Network Scalability With Channel Factories
The Bitcoin Lightning Network is a peer to peer off-chain payment solution that allows for near cost-free and instant transactions. The purpose of Lightning is to reduce the number of transactions on the bitcoin blockchain while ensuring that security is not compromised.
As Lightning adoption increases, so too will more micropayment channels be added to the network. It is expected that at the peak of Lightning adoption, there shall be millions of on-chain transactions resulting from the opening and closing of channels which will eventually lead to congestion on the bitcoin blockchain. This will render the Lightning Network almost useless as people will have to wait for unnecessarily long periods before they can successfully open and close a channel.
Another issue with Lightning is the locking in of funds by the two parties who want to cooperate in a channel. This easily becomes inconvenient when both parties intent to transact more often as they will have to deal will rebalancing and refilling of channels on a regular basis.
In anticipation of these issues, Lightning developers: Conrad Burchert, Christian Decker, and Roger Wattenhofer proposed a solution titled “Scalable Funding of Bitcoin Micropayment Channel Networks”. The concept today is commonly referred to as channel factories.
What are channel factories?
Channel factories are a new layer that will be placed between the bitcoin blockchain and the lightning network. The protocol will then serve as an optimization feature to Lightning and enable the billions of people in the world to transact seamlessly via payment channels. The purpose of channel factories is simple: enable the creation of payment channels without recording transactions on the bitcoin blockchain.
Each channel factory consists of a network of individuals who can initiate a single transaction on the bitcoin blockchain and have the funds committed to the whole network. The funds deposited and shared among this group of individuals is known as a hooked transaction.
Opening a channel factory is the same as opening payment channels in the lightning network. Once the factory is open, it can be used as a base from which many more channels are created. In other words, channel factories are basically payment channels that can be used to create more payment channels.
Benefits of channel factories
One-sided channels can be rebalanced with a channel factory without transacting on the blockchain. For example, funds can be allocated such that each channel is replaced with a new balance while keeping the original stakes of each individual the same. At the same time, the new allocation can also enable the creation of new channels, thus paving a way for the movement of funds between these channels.
Broadcasting settlement transactions
Whenever a group of users wants to close a channel factory, they need to create and broadcast a settlement transaction. And since all group members already maintain a shared account, an individual’s stake will be paid directly from the shared account. This ensures that only two transactions appear on the bitcoin blockchain, thus saving space and hiding redundant information from the public.
In a situation where a single node opts to close the channel factory, it announces the decision to the remaining nodes. This signal ensures that the nodes stop updating sub channels and immediately broadcast their respective balances (stakes).
Cold wallet integration
Another benefit of channel factories is the integration of cold wallets in the event of creating a channel. The cold wallet is included such that it can be kept safely offline whenever the need arises. Wallet owners can bring their wallets online when they want to move funds into a channel. However, the wallet is not a requirement for updating sub-channels.
Removing a node
It’s obvious that the number of nodes in a given group will not always be the same. Sometimes a node might want to leave the group while the other nodes want to remain. In this case, multiple transactions are not necessary to close the channel factory before opening another one. Both actions can simply be merged into a single transaction.
Signature aggregation allows for the combination of multiple public keys into a single public key and also the merging of many signatures into one. This would be a huge benefit for channel factories because of the numerous public keys used therein.
Connecting channel factories
Since there are going to be many channel factories within the payment network linking structures need to be established to connect the factories together. For a new channel factory to connect to an existing one, the new factory will have to select a few new nodes of the channel factory they are connecting to and link to those.
Joint participation to create new allocations
When creating a new allocation, all parties involved in a channel factory need to join forces to create the said allocation. This means they have to coordinate the creation of new transactions in order to create new sub-channels for the allocation in question. This process does not necessarily overhaul daily operations of the channel, so normal channel activities can move on uninterrupted.
Note: An allocation occurs when many multi-party channels are funded with locked funds from a single multi-party channel.
Channel factories are not problem-free
Despite all the potential benefits that come along with channel factories, there is an inherent risk with the rising number of persons joining a channel factory. For example, some parties may stop cooperating and eventually close a channel. However, this is less likely to happen as there is no personal gain in closing a channel without the consent of others.
On the whole, channel factories will be an indispensable optimization feature for the lightning network once the number of Lightning users starts approaching a billion. In fact, according to the write-up presented by the Lightning developers, the estimated capacity of Lightning is about 800 million users. This figure is far less than the current number of internet users which is over 4.3 billion, and also a clear indication that the lightning network in itself is not a complete scaling solution.