Flood & Loot: a Systemic Attack on the Lightning Network

Flood & Loot: a Systemic Attack on the Lightning Network

Flood & Loot: A Systemic Attack On The Lightning Network Jona Harris Aviv Zohar The Hebrew University of Jerusalem The Hebrew University of Jerusalem [email protected] [email protected] ABSTRACT and widely adopted consensus rule has been introduced in Seg- 1 The Lightning Network promises to alleviate Bitcoin’s known scal- Wit [17]). ability problems. The operation of such second layer approaches The Lightning Network, along with other payment channel net- relies on the ability of participants to turn to the blockchain to works, aims to move the majority of transactions off-chain, with claim funds at any time, which is assumed to happen rarely. the guarantee that the state of channels can be committed back to One of the risks that was identified early on is that of a wide the blockchain at any time, in a trustless fashion. It thus solves the systemic attack on the protocol, in which an attacker triggers the problem of a limited transaction rate by limiting the communica- closure of many Lightning channels at once. The resulting high tion on payments to a much smaller set of participants, and lowers volume of transactions in the blockchain will not allow for the the number of interactions with the blockchain. proper settlement of all debts, and attackers may get away with A major assumption that underlies the trustless operation of stealing some funds. the Lightning Network is that participants will be able to post This paper explores the details of such an attack and evaluates transactions to the blockchain if they are faced with malicious or its cost and overall impact on Bitcoin and the Lightning Network. non-responding peers. A concern that was raised long-ago is that Specifically, we show that an attacker is able to simultaneously under conditions of blockchain congestion, this may not be the case: cause victim nodes to overload the Bitcoin blockchain with requests many transactions that are meant to secure the funds of participants and to steal funds that were locked in channels. will not be admitted promptly to the blockchain, which will allow We go on to examine the interaction of Lightning nodes with attackers to steal money. the fee estimation mechanism and show that the attacker can con- In this paper we explore and analyze this attack scenario. We tinuously lower the fee of transactions that will later be used by lay concrete steps for executing a successful large-scale attack that the victim in its attempts to recover funds - eventually reaching both creates the congestion effect and exploits it to steal funds from a state in which only low fractions of the block are available for victims. The reason that the attacker is guaranteed to steal funds lightning transactions. Our attack is made easier even further as the with a large-scale attack is that victims have a limited amount of Lightning protocol allows the attacker to increase the fee offered time (measured in blocks) to execute channel closures successfully by his own transactions. before the attacker succeeds in claiming their money for himself. We continue to empirically show that the vast majority of nodes We show that the attack does not need to be as widespread agree to channel opening requests from unknown sources and are as it may initially appear. It can be executed on relatively few therefore susceptible to this attack. channels, without any significant costs to the attacker. Specifically, We highlight differences between various implementations of we show that even if the maximal number of victims’ transactions the Lightning Network protocol and review the susceptibility of get into blocks (up to the block’s limit), attacking only 85 channels each one to the attack. Finally, we propose mitigation strategies to simultaneously guarantees the attacker will be able to steal some lower the systemic attack risk of the network. funds, and that each additional attacked channel will have its funds stolen as well. In fact, it is rarely the case that Lightning participants pay suf- CCS CONCEPTS ficiently high fees to fill up entire blocks. We explore the feede- • Security and privacy ! Distributed systems security. termination mechanism and show that effectively a much smaller number of simultaneously attacked channels is required for the arXiv:2006.08513v4 [cs.CR] 27 Aug 2020 attacker to succeed. KEYWORDS Our attack technique leverages the way multi-hop payments are Bitcoin, Lightning Network, Payment channels, Second-layer, HTLC executed in the network to trigger several conditions that combine to assist the attacker: • We manage to greatly inflate the number of transactions needed to successfully close a channel by utilizing many 1 INTRODUCTION multi-hop payments through the channel. The Lightning Network [22] and other second layer solutions [7, 9, • Honest nodes need to claim funds within a limited number of 12, 16] have been suggested as a solution to Bitcoin’s long-known blocks, otherwise they become available to an attacker. The scalability issues [1, 5, 6, 27, 34]. The Lightning Network promises parameter ruling this is not set too high, otherwise funds are to increase both the number of transactions that can be processed, locked for long periods of time in other cases. The various and the latency per transaction. In contrast, Bitcoin’s transaction processing is bounded by its block creation rate, and its block size 1SegWit defines a new concept of block weight and redefines the network rule toa limit, which is currently 1MB (although a slightly more nuanced maximum block weight of 4M units Jona Harris and Aviv Zohar implementations use different parameters for this timeout. Victim For example, LND uses a value of 40 blocks. HTLC payment path • All implementations do not make use of the full amount of time available to them to deploy closure transactions, making the attack substantially easier. For example, LND initiates the closure of channels only 10 blocks before the expiration time. Victim • The timeout for retrieving funds is known in advance and Attacker’s target node thus attacks can be timed so all victims attempt to send Victim transactions to the blockchain at the same time. Attacker’s source node • Fees offered by these transactions are pre-set and the timing for the attack can be chosen by the attacker (who will choose to attack at times when the blockchain is congested and high fees are required for acceptance). • Unlike the victims, the attacker can increase the fee on his Figure 1: Attacker’s and victims’ nodes with payment routes transactions, and replace any remaining transactions made from the source node to the target by the victims to claim their funds (after the timeout). Figure 1 shows an example topology of Lightning channels. It emphasizes the paths of the HTLC payments and how victims are We now provide a brief description of the attack that we evalu- connected with the attacker. We note that whenever the attacker ated. A more detailed description appears in Section 3. has failed, the only cost that he suffers is that of the blockchain fees Outline of the attack: involved with opening and closing channels with his victims. The I. Setup and Wait The attacker creates channels from a node funds locked in the channels are retained and can be reused. we designate as his “source node” to many victim nodes, and Usually, attackers can reduce the minimal number of victims locks funds into these channels. This step is preferably done when required for executing a successful attack, by exploiting fluctuations blockchain fees are low, both to save costs and to set the channel’s in blockchain fees. We thus go on to explore the feerate estimation feerate to a low value. The attacker then prepares a node on the mechanism used by the different lightning implementations. Using Lightning Network that is able to receive funds (i.e., making sure real estimation results collected over a period of over two months, the other side of its channels has sufficient liquidity). We designate we show that the fee used for the commitment and HTLC-claiming this node as the “target node”. This can be achieved by opening transactions fluctuates greatly and has significant influence onthe channels with other nodes (not necessarily victims) and sending success of the attack. money out to purchase goods or to deposit at exchanges. The at- To demonstrate the steps of the attack outlined above, we re- tacker waits for an opportune moment to attack, predicting that port on our prototype implementation of an attacker node. Our blockchain congestion conditions will last for several dozens of prototype was evaluated on a locally established lightning network, blocks. running over a Bitcoin regnet, and demonstrates that we can exploit the actual clients running today’s Lightning Network. II. Initiating Payments The attack is then launched by sending A Lightning node can become a victim in the attack if it agrees to multiple lightning HTLC payments from the source node to the open a channel jointly with the attacker. We go on to check which target node using as much liquidity as possible and spreading it out nodes in the Lightning Network are susceptible to be attacked by over as many HTLC payments as it is allowed to use. agreeing to open channels with us. We report on an experiment that III. Accepting Payments Once all HTLCs have reached the target attempted to connect to nodes on the network and show that a large node, it accepts the payments and responds by sending back the majority (95%) of responding nodes agree to form such connections secrets required to guarantee receipt of the funds. As a result, the (other nodes refuse for often benign reasons, such as in-progress target node’s channel is left without open HTLCs.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    12 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us