lightning-dev

Scaling Lightning With Simple Covenants

Scaling Lightning With Simple Covenants

Posted on: September 8, 2023 18:54 UTC

The email discusses the challenge of scaling Lightning in a trust-free manner and proposes solutions to overcome this challenge.

The key issue is the creation of Lightning channels for casual users. Signature-based factories have limitations, while simple covenants would allow a single UTXO to create channels for millions of casual users. The addition of CheckTemplateVerify (CTV) and/or AnyPrevOut (APO) to Bitcoin's consensus rules would greatly improve Lightning's scalability.The scalability problem lies in providing Lightning channels to casual users, who are expected to be more numerous than dedicated users. Existing protocols support casual users' needs, but creating Lightning channels for them is not scalable under the current Bitcoin consensus rules. The requirement for casual users to co-own an on-chain UTXO creates a coordination problem, as getting signatures from a large number of users is challenging. Therefore, it is unlikely that any protocol using the current Bitcoin consensus rules can fund a large number of Lightning channels from a single UTXO.To address this scalability bottleneck, the email suggests enabling simple covenants. With covenants, casual users can co-own off-chain Lightning channels without having to sign all the transactions. This approach allows for the creation of channels for millions of casual users without requiring complex coordination or signatures. Timeout-trees are proposed for long-term scaling, where non-leaf outputs can be spent without meeting covenant conditions after a deadline. By rolling over balances to new timeout-trees, casual users can continue using their Lightning channels without putting them on-chain.The email also discusses the problem of availability when draining funds from an old timeout-tree to a new one. A variation of the FFO-WF Lightning channel protocol can be used to facilitate the rollover of funds without input from casual users. HTLCs can also be handled to ensure smooth rollovers without actions from casual users.The Lightning Network allows for off-chain bitcoin transactions, but there is a delay in accessing funds on-chain, which can be problematic for paying transaction fees. Timeout-trees can be used to provide casual users with immediately-accessible off-chain bitcoin and rebalance funds between Lightning channels and immediately-accessible bitcoin.In summary, the email argues that enabling simple covenants and implementing timeout-trees can greatly improve the scalability of Lightning and make it more widely used for payments. The protocols mentioned in the email enable Lightning sends and receives completely off-chain, and certain assumptions allow for multiple Lightning channels per casual user. Usability is also addressed, with protocols allowing for watchtower-freedom, one-shot receives, asynchronous receives, and tunable penalties. However, there are limitations to consider, such as the cost of resolving HTLCs on-chain and reliable relay of transaction packages. Overall, the email hopes that mechanisms like CTV or APO will be added to Bitcoin's consensus rules to allow Lightning to become a widely-used means of payment.