The Lightning Network has added a new environment where bitcoin can be locked and used in ways that the base chain would not allow. Leveraging a growing network of interconnected payment channels, the Lightning Network can route payments between participants without establishing a direct payment route. The Network of Lightning Nodes would find the optimal path and charge you according to the hops.
Once you’re in the Lightning Network after establishing a channel, things can go relatively smoothly, but balancing your channel and adding or removing liquidity can be a massive pain.
We’ve options like dual-funded channels to try to alleviate some of the pain points, but this is only a medium-term solution, and if Lightning is going to scale to nation-state level and daily use, it requires a more robust solution.
One of those possible solutions could be channel factories.
From the mine and into the factory
In a regular payment channel, you always have a transaction signed by all participating parties ready to commit the current channel balances to the blockchain. For example, in a channel between Alice and Bob, this transaction might have two outputs, one paying Alice 0.25 BTC and one paying Bob 0.75 BTC.
If Alice and Bob wanted to close their channel, they would need to broadcast their current balance states back to the bitcoin blockchain. Then if Alice wants to keep using Lightning, she has to establish a new channel and broadcast a new transaction. If we have millions of people wanting to settle back to the base chain daily, it will cause block space issues and fees to use the network will rise, transactions will be slower and cause everyone a lot of frustration.
In a channel factory, it’s possible to format the ready-to-commit transaction as a transaction that not only closes the existing payment channel but which also opens a new payment channel.
Channel Factories are payment channels that can create more payment channels inside their closed liquidity environment. Think of a channel factory as a micro-third layer where Lightning channels can be established, rebalanced and closed inside this walled garden without communicating the updates to the base chain.
How do channel factories work?
Channel factories are multi-user contracts capable of opening payment channels for the Lightning Network without putting the channel-open transaction on the bitcoin blockchain. Having no base chain transaction to anchor your channel balance may sound strange if you’re used to the current method of establishing a Lightning Network channel.Â
However, channel factories leverage another participant’s liquidity; for example, three users create a channel factory by depositing some funds to an on-chain 3-of-3 multi-sig address. Using non-broadcast (off-chain) spending from that address, they open payment channels with each other (e.g. Alice↔Bob, Alice↔Charlie, and Bob↔Charlie).Â
They can then use those channels with the same security as if they had opened them on-chain because, if necessary, they can broadcast the channel-open transactions.
However, they don’t need to broadcast those transactions if both parties act cooperatively, allowing them to reduce the amount of blockchain data used.
Channel factories can reduce the on-chain size and fee cost of Lightning Network by 90% or more, providing even more efficiency when moving between layers. Chain factories are ideal for large numbers of users and situations where scaling becomes an issue or on-chain sat per byte fees are too expensive for smaller transactions.Â
Moving funds inside a channel factory
A channel factory can also be used to rebalance channels that have become one-sided. Channel factories can create a new allocation to replace every channel with new balances while keeping the total stake inside the factory the same for each party the same.
Channel factories also have the advantage of moving funds between channels, creating new channels or old ones removed. A channel factory can change the network’s liquidity balances without contacting the base blockchain to update states.
Settling balances in a channel factory
When parties involved in a channel factory cooperatively decide to close a channel factory, they can create and broadcast a settlement transaction. The new transaction will update the state of the channel as it reflects the base chain. At the same time, it pays out the current stake of each party directly from the shared account and without a timelock, replacing the allocation and removing the locked funds.
When will we see channel factories?
If we look at the cost of block space and the number of channels opens and closes. The need for factories doesn’t seem like a priority right now. A lot of optimisation can come with dual funded channels, liquidity ads, and options like Lightning Liquidity pools.
The Lightning Network is still in its early stages, and the concept is by no means the only proposal for scaling Lightning. However, it requires no changes to the network before being rolled out, making it one of the more popular scaling options.
There could also, in theory, be channel factories running off the Liquid Network-enabled Lightning Channels to reduce the need for base chain block space and further optimise the use of bitcoin.