Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

Battlement: A Quorum Based Design for Lightning Network Key Management

2 messages, Dec 16, 2020, to Jan 10, 2021. Started by Omer Shlomovits.

Omer Shlomovits, devrandom

Permalink First message in the Wayback Machine

Omer Shlomovits permalink original

Hi list,

Sharing here a project I started a while ago and recently managed to materialise in writing, In this work I decided to take the traditional cyber security approach, while assuming channels security is sound. The attacker model is intuitive: an attacker attacks a machine which happens to run a lightning node. The attacker is not part of the network. Usually the attacked machine/device will have security measures in place: write/read permissions for different users. Our assumption is that the attacker does not necessarily achieve full control over the node but only *some* elevated access: it may have only read or only write access for example which means it can steal some keys while not deleting them or delete some keys while not been able to steal them. We analyse the different scenarios and what an attacker can achieve - surprisingly it seems that due the the unique key structure and usage in lightning, it is not trivial how an attacker may profit from this situation (as opposed to bitcoin where any access to key material equal profit to an attacker).

In the second part of the work we offer a quorum based design that mitigates the attacks. We use threshold cryptography for this. I believe this is one viable solution but for sure not the only one and we discuss the tradeoffs. One nice thing about this approach is that it allows to somewhat re-use the existing watchtowers - we basically only require that watchtowers will become connected and run some new protocols.

In the last part we present a simple bribing attack on the current watchtower design, and hand wave on how game theory shows that a quorum structure like ours may provide a path to solving it.

Link to the writeup is here: https://static1.squarespace.com/static/5f3a45dc0638305e031b7419/t/5fd877e477d7f03dcdb5b3f9/1608022219533/Battlement.pdf <https://static1.squarespace.com/static/5f3a45dc0638305e031b7419/t/5fd877e477d7f03dcdb5b3f9/1608022219533/Battlement.pdf>

The paper is written at a high level only so we will be able to focus on the several new ideas I mentioned above. This work is thus far from complete: No formal security arguments are given and I avoid describing real world considerations like fee structure and parameters . I think however it is a good breaking point to share it and get some feedback.

All the best, Omer.

devrandom in reply to Omer Shlomovits permalink original

Hi Omer,

Thank you for raising the topic of quorum key management for Lightning. I believe this approach is an important direction for securing Lightning nodes. Please see comments below.

On Tue, Dec 15, 2020 at 11:26 PM Omer Shlomovits <omer.shlomovits at gmail.com> wrote:

Quoted text (4 lines)
> The attacker model is intuitive: an attacker attacks a machine which
> happens to run a lightning node. The attacker is *not* part of the
> network.
>

Well, that's an assumption. :) In general, an attacker may also control one or more peers, either because they compromised them or because they initiated a connection to the target node.

Quoted text (8 lines)
> Usually the attacked machine/device will have security measures in place:
> write/read permissions for different users. Our assumption is that the
> attacker does not necessarily
>
achieve full control over the node but only *some* elevated access: it may
> have only read or only  write access for example which means it can steal
> some keys while not
>

Also a significant assumption, since in many cases an attacker can completely compromise a system. It would be a much stronger security posture if we defended against this too. What is the motivation for these assumptions? Did you feel it's too difficult to defend against arbitrary compromise?

I also want to mention that there are many ways funds can be lost in Lightning once we assume that the node software can be fully compromised. I believe we can defend against all these, but it requires implementation of a relatively large set of controls in the key management layer. In the Lightning Signer project we attempt to enumerate these controls - see: https://gitlab.com/lightning-signer/docs/-/blob/master/policy-controls.md

For example - one of the more complex policy controls is "HTLC receive channel validity - the funding UTXO of the receive channel must be active on-chain with enough depth". i.e. we have to check that routed HTLCs are coming from a valid channel or we could have all funds siphoned off over time.

Looking forward to further work on this.