A Dive into Lightning Network (Part Three)

HTX Research
HTX Research
Published in
13 min readAug 14, 2020

Note:The Link of “A Dive into Lightning Network (Part One)”

Note:The Link of “A Dive into Lightning Network (Part Two)”

5. Extension techniques and services

Lightning network is beneficial to the development of Bitcoin technology and its ecosystem through the analysis above. However, it inevitably faces some challenges due to the low technical integrity. In response to these issues, developers together with the lightning community continue to research on various extension techniques. Among them, watchtower, submarine swaps and atomic multi-path payments are most typical. In this section, we will present an in-depth explannation.

5.1 Watchtower

Background

In order to eliminate the opponent risk in lightning network, RSMC has designed a penalty mechanism that not only help users withdraw their money but also confiscate all funds of deniers to compensate the victims. However, it requires users to check online regularly to confirm whether they have encountered denial from the counterparty. If users miss the window period during which punishment is imposed, the lost funds cannot be retrieved. It is not convenient for users as a payment technology. Without any exaggeration, lightning network has no advantage in market competition if this problem cannot be solved. Fortunately, the proposal of watchtower aims at solving it to protect funds from being stolen by counterparties while they are continuously offline.

Development

The prototype of watchtower is mentioned in the white paper of lightning network. The core idea is to appoint third-party agents to monitor opponents’ denials and issue breach remedy without revealing privacy. More detailed technical solutions together with lightning node incentive schemes have emerged from the whitepaper. For example, the Pisa protocol proposed by McCorry, distributed service protocol DCWC by Avarikioti and incentive compatible Cerberus channel. In addition to academic research, attempts to implement watchtower are in progress. Lightning Labs integrated watchtower into lightning network for the first time in June 2019. Thereafter, in July 2019, BitMEX upgraded its lightning node to a vision that includes watchtower.

Principle

Three roles involve in watchtower, the two sides of a transaction and watchtower. We take the payment channel between Alice and Bob as an example, suppose Alice uses watchtower.

Alice: Every time a transaction between two sides occurs, Alice will send a signatured message and hash information of the transaction to a watchtower so that the watchtower can excute the breach remedy for Alice when she is offline.

Bob: counterparty of Alice. A person who is likely to deny the current transaction by publishing historical transactions on chain after transafering funds to Alice.

Watchtower: Watchtower will compare the hash information provided by Alice with on-chain transactions and continuously monitor whether there is denial. Once historical transactions published by Bob are found, the signature message corresponding to the historical transaction sent by Alice will be decrypted. Moreover, it replaces Alice in issuing breach remedy and transfers all funds in the channel to Alice.

Figure 19 Schematic diagram of watchtower

Resource: Huobi Research

Watchtower is essential to improve the usability of lightning network. At the same time, various challenges follow, among which scalability, privacy and operating mode are the most concerned.

In order to monitor denials, watchtower needs to collect and store every real-time status changes of all payment channels in lightning network; meanwhile, compare them with the newly packaged transactions on chain, which means that both on-chain data and off-chain data are required. As a result, it is urgent for watchtower to improve the scalability.

At the same time, the cost of storage and calculation for each user will continue to rise. In the process, the less information users send to watchtower, the stronger privacy of user will be. Certainly, the higher the cost of watchtower. Privacy-oriented watchtower does not obtain every channel message and account information which means it hardly charges users with transaction fees in the account mode. Business-oriented watchtower can connect messages with accounts and formulate a resonable revenue model. However, it brings privacy protection challenges that expose users’ fund flow together with other private information. Even worse, watchtower may turn into a financial supervision center, losing the distributed characteristic of the public blockchain.

5.2 Submarine swaps

Background

The payment channel between two users can be imagined as an hourglass. Each end of the hourglass represents a user, and the sand in the hourglass represents the funds locked in the payment channel. In most cases, sand can be distributed freely on both sides of the hourglass. However, if we want to add sand or take them out, we have no choice but break the hourglass. This is another usability problem when using the payment channel. The fund capacity is determined at the beginning of the channel establishment. It is impossible to add funds or withdraw without closing the channel, not to mention mutual transfer, which greatly restricts the liquidity of user’s funds. In order to solve this problem, the rebalancing technology enables the same user to transfer funds across multiple channels, though it has not achieved the unified management of on-chain and off-chain balances. As a result, submarine swap enables users to not only exchange funds both on chain and off chain without closing the payment channel, but recharge the funds in channel as well. In the end, it greatly reduces the difficulty of unified management of funds between the same user on-chain, off-chain and off-chain channels.

Development

Submarine swaps was first proposed by Alex Bosworth and Olaoluwa Osuntokun. It transfers on-chain assets to off-chain lightning network just like a submarine that transfers information from the surface to underwater. At present, submarine swaps have been gradually applied to existing lightning network, i.e., Loop developed by Lightning Labs supports the functions of loop in (from on-chain to off-chain) and loop out (from off-chain to on-chain), which can be used for both individual users and online merchants. In addition to Bitcoin and lightning network, since submarine swap requires one of the two parties online, it can be applied to cross-chain transaction. (e.g. REDSHIFT, which provides a visual service to transfer assets based on submarine swap)

Principle

In most cases, when we talk about submarine swaps, they usually cover submarine swap and reverse submarine swap. Submarine swap refers to the process in which users transfer funds on-chain to off-chain, while reverse submarine swap is the opposite. However, the implementation principles of the two swaps are basically the same, which is technically based on HTLC and is practically based on submarine swaps service providers.

Specifically, the principle of submarine swaps is basically the same as HTLC discussed above. The difference is that HTLC is only applied in off-chain scenarios while in submarine swaps, HTLC is used to realize the intercommunication between on-chain and off-chain.

Figure 20 explains the procedure of a submarine swap. If Alice wants to “recharge” her own on-chain funds into lightning network channel (Bob is a submarine swaps service provider in this case). 1. Alice prepares R and hashes it to obtain H; 2. Alice establishes an HTLC with Bob on chain and transfers 1 BTC to him. At the same time, Bob is required to provide R corresponding to H before the agreed time. Otherwise, the funds will be returned to Alice; 3. Bob also establishes an HTLC with Alice, in which Bob pays 1 BTC to Alice, and requires Alice to provide R before due time. 4. When Alice receives 1 BTC in lightning network, she reveals R to Bob. After that, Bob can use R to obtain 1 BTC transferred by Alice. To sum up, the procedure is completely consistent with HTLC transaction described in Chapter 2 apart from a commission for the on-chain transaction.

Figure 20 Procedure of submarine swap

The process of a reverse submarine swap is exactly the opposite of submarine swap, as shown in Figure 21. Particularly, we should mention that the on-chain transaction is initiated by Bob (Bob transfers money to Alice’s on-chain address), so that Bob needs to pay the transaction fee. In this case, Bob will ask Alice to prepay an on-chain transaction fee off-chain which is paid separately from Alice’s actual transfer. Even if the submarine swap of Alice fails or is cancelled, it is not technically possible to retrieve this advance payment.

Figure 21 Procedure of reverse submarine swap

Resource: Huobi Research

5.3 AMP

Background

The limitation of a payment channel is also troublesome. We know that undirectly connected users complete the payment through multiple nodes in the network. If the balance in any node on the path is less than the payment amount, the payment will fail. Atomic Multi-Path Payments is proposed to solve two problems. Specifically, the payment success rate will decline rapidly as the payment amount increases; funds in the same account may be scattered in different channels of multiple lightning nodes. Therefore, merged multi-channel payment cannot be achieved.

Development

Atomic Multi-Path Payments was first proposed by Olaoluwa Osuntokun, the engineering leader of Lightning Labs, in 2008. At the end of December 2019, Blockstream announced that the technology has passed interoperability tests, though it has not been officially online. In early May 2020, 0.10 version of LND was released, which supports Atomic Multi-Path Payments. We can draw the conclusion that this technology has gradually implemented in lightning network.

Principle

The priciple of AMP is simply that payment originally transmitted by one path is replaced by multiple paths. The core idea is how to achieve the goal that consists of atomicity, non-reusable payment hash, order invariance and non interactivity.

Atomicity: It means that even if the payment is disassembled to multiple paths for delivery, in the end, the payment amount is an indivisible atom, which is either paid to the recipient or returned to the sender.

Non-reusable payment hash: After disassembled, the transaction will have its own hash value which is different from others and low correlated.

Order invariance: The order of each sub-transaction does not affect the legality of the transaction.

No interactivity: It means that the sender can initiate an AMP without additional interaction with the receiver, who does not perceive the payment.

Figure 22 Senarios of AMP

Resource: Lightning Labs engineering group announcement, Huobi Research

Figure 22 presents a few AMP use cases as follows: 1. Insufficient outflow liquidity. Payment node does not have enough funds in a single channel 2. Insufficient inflow liquidity. Opponent of receiving node does not have enouth funds. 3. Insufficient liquidity of intermediate nodes. Except for sender, recipient and directly connected counterparty node, the rest transmission nodes in the network are insufficient in funds.

5.4 Even more

Apart from the above three, many extension techniques and services aiming at solving various other problems in lightning network exist. For example, Autopilot provided by Lightning Labs that reduce the configuration difficulty of lightning network; Rebalancing which enables users to transfer funds between multiple channels; The Neutrino protocol that protects privacy while reduces bandwith and storage; Wumbo channel applied to c-lightning 0.8.2 that accommodate more funds; transferring technology Splicing that can be automatically opened and closed in a same transaction; lnurl technology that reduces the operating cost; lightning network service providers represented by LightningTo.Me, LNBIG.com and Bitrefill, etc. In conclusion, all innovations contribute to popularise the lightning network and Bitcoin.

6. Summary and prospects

6.1 Future development

Bitfinex announced that it provided services for the deposit and withdrawal business on lightning network on December 3rd, 2019. It is foreseeable that more mainstream exchanges and cryptocurrency wallets will devote into the industry to complete the business expansion. In future, users are possible to complete lightning network related transactions through exchanges and wallet apps, so as to configure personal cryptocurrency accounts more flexibly. A further promotion of lightning network will be popularized in this trend.

From the perspective of Bitcoin technology, lightning network promises that it has the ability to become one of the most important, but not the only one, basic services in the ecosystem recently. More likely, a situation where multiple extension plans coexist dynamically is formed. Lightning network, together with sharding and cross-chain technology, will not only improve the scalability but reduce transaction fees as well. Not only that, it will make great achievement in optimizing user’s payment experience. We believe that the limitations and challenges of Bitcoin will be perfectly solved with a highly complementary technology hierarchy.

On the other hand, the emergence of lightning network has provided a strong technical foundation for the upper-level financial applications and services of Layer-3. With the improvement of instant settlement, together with lower transaction fee, a decentralized financial market for Bitcoin ecosystem gets started, such as lending, mortgage, insurance, etc. It is foreseeable that the development of DeFi will rely heavily on lighting network which provides the underlying basic payment environment to improve the liquidity of Bitcoin.

6.2 Improvement

In order to achieve this goal, a lot of work have to be carried out for both developers and communities. Specifically, they focus on technology research and ecosystem operation.

1) Improve network safety and enhance user privacy

From the technical perspective, the future development will focus on the continious optimization of basic components such as payment network architecture, security, privacy and usability.

For the network architecture, developers will pay much attention on optimizing the limitations of current payment process, focusing on balancing the payment channel load, reducing centralization, improving liquidity and providing better transaction experience.

In terms of improving security, it is necessary to systematically study the lightning network attack surface, even model the potential security risks, so that practical threat assessments can be carried out objectively. Specifically, lightning network protocol is currently facing various types of attacks including liquidity attacks, malicious funding transaction attacks CVE-2019–12998、CVE-2019–12999、CVE-2019–13000), etc. In addition, related node software is vulnerable to potential code-level exploits and network hijacking. Therefore, relevant developers have to further adapt cutting-edge research results in lightning network to ensure immunity to known security attacks. At the same time, identifying and discovering the potential security vulnerabilities that have not been disclosed is another priority. In short, the security of lightning network is no less important than Bitcoin blockchain.

Despite of onion routing, it is still possible for attackers to effectively infer sensitive transaction information through big data analysis and machine learning due to the small scale of lightning network. In order to protect privacy, developers are required to consider a wider range of systematic technical means, including cryptographic methods and trusted hardware. Correspondingly, the privacy protection scheme of lightning network must be compatible with its inherent core advantages of fast transaction speed and low transaction fee.

Technological innovation striving forward often leaves usability behind which is a key part for the public. It is more important to provide users with direct interactions.

2) Create open community and enrich application ecosystem

On one hand, in order to further promote the development of lightning network in future, developers have to create a more active community which integrates with the traditional open source software community, thereby forming a more active development group, promoting the development of lightning network standards.

On the other hand, extension of application is urgently needed. Developers should actively explore practical applications in mainstream financial industries and enterprises. It can not only expand the influence of lightning network, but more importantly, it can continuously clarify the technical direction to form a virtuous circle in the entire technology ecosystem.

Open interactions with other mainstream cryptocurrency markets (e.g. Ethereum) also contributes to its future development, demonstrating the superiority in interoperability and cross-chain transaction exchange, thereby enhancing the vitality of cryptocurrency industry.

With the joint development of lightning network in the two dimensions of technology research and ecosystem operation, the future blockchain will have more fantastic scalability solutions for commercial applications. Of course, blockchain is currently facing a major mission toward mainstream applications, including how to solve the problem of landing in the social, economic and livelihood fields. For example, typical mainstream applications include global basic financial facilities, e-government, smart healthcare, digital identity, etc. To complete the overall rapid development of blockchain industry requires collaboration in multiple fields including technology, policy and law. With the increasing popularity of cryptocurrency, Lightning Network, as an important supplement to Bitcoin technology, may become an important payment tool for personal financial services and retail industries.

About Huobi Research

Huobi Research was established in April 2016, and has been committed to comprehensively expanding research and exploration in various fields of blockchain since March 2018.

Huobi Research takes the pan-regional blockchain field as main research object, aiming at accelerating the research and development of blockchain technology, as well as promoting the application of the blockchain industry and promoting the ecological optimization of the blockchain industry. It mainly studies industry trends, technology path, application innovation and model exploration in the blockchain field. Huobi Research will carry out extensive and in-depth cooperation with governments, enterprises, universities and other institutions through various forms to build a research platform covering the complete industrial chain of the blockchain in accordance with the principles of public welfare, rigorousness and innovation, to provide industry professionals with a solid theoretical basis and trend judgment to promote the healthy and sustainable development of the entire blockchain industry.

Contact Us:

Email:

huobiresearch@huobi.com

Official website:

https://research.huobi.cn

Public wechat account:

HuobiCN

简书:

火币区块链研究院

Weibo:

火币区块链研究院

Twitter:

@Huobi_Research

https://twitter.com/Huobi_Research

Medium:

Huobi Research

https://medium.com/@huobiresearch

Disclaimer

1. Huobi Research has no relationship with other third parties involved in this report that affects the objectivity, independence, and impartiality of the report.

2. The materials and data cited in this report are from compliance channels. The sources of the materials and data are considered reliable by the Huobi Research and the authenticity, accuracy and completeness of the materials have been verified as necessary, but Huobi Research does not make any guarantees regarding authenticity, accuracy or completeness.

3. The contents of the report are for reference only. The facts and opinions in the report do not constitute any business, investment suggestions. Huobi Research does not assume any responsibility for losses caused using the contents of this report, unless clearly stipulated by laws and regulations. Readers should not make business and investment decisions solely based on this report, nor should they lose the ability to make independent judgments based on this report.

4. The information, opinions and speculations contained in this report only reflect the judgment of the researchers on the day of finalization of this report. In the future, based on industry changes and data information updates, there is a possibility of updating opinions and judgments.

5. The copyright of this report is solely owned by Huobi Research. If you need to quote the content of this report, please indicate the source. If you need a large quote, please inform in advance and use it to the extent permitted. Under no circumstances should this report be quoted, abridged or modified against its original intention.

--

--

HTX Research
HTX Research

Blockchain industry top think tank, affiliated to Huobi Group.