Lightning This Week | 616,864

Lightning Labs raises $10M, LND circular payment attacks, C-Lightning custom messages, and BTC in private LN channels

André Neves
ZEBEDEE Engineering
6 min readFeb 11, 2020

--

Hi! Lightning Network updates please — thanks.

Public vs Private LN Channels

The BitMEX Research team has updated their latest post about recent data analysis of private vs public Lightning Network channels, providing more interesting insights into their dataset.

https://blog.bitmex.com/lightning-network-part-7-proportion-of-public-vs-private-channels/

Whereas previously the team had disclosed their findings regarding number of public and private channels, this week they added a breakdown of the BTC value within those same public/private channels. As you can see from the chart above, the findings suggest that private channels account for over 25% of all channels, but only represent about 12% of the total BTC value within the network.

Based on the output value of the 60,000 non-cooperative channel closure transactions, the transactions spent a total of 1,070 bitcoin, of which 939 bitcoin related to public channels and 131 bitcoin related to private channels.

Assuming that the data gathered is somewhat representative of all Lightning Network channels, the conclusions indicate that public LN channels tend to be much larger than private LN channels.

Link: https://blog.bitmex.com/lightning-network-part-7-proportion-of-public-vs-private-channels/

Circular Payments Changes

Prior to LND’s KeySend functionality, if node A wanted to make a payment to node B for 50 satoshis without an invoice, the approach taken was to route a payment from ABA, such that it pays B a forwarding fee amount of 50 satoshis. This is known as a drive-by payment where nodes are sort of dropping fees to the respective nodes on the path as the payment is routed. With KeySend a node does not need to perform these circular route payments because one can just send a zero amount payment directly to another node’s pubkey and pay fees to route it.

PR 3915 introduces additional protection against circular liquidity attacks and disallows these drive-by payments from being routed. Specifically it disallows circular payments to be routed through the same channel (incoming and outgoing), thus disallowing drive-by’s from being forwarded over the same channels (should use KeySend instead).

NOTE: If you are running a v0.9.0 LND node and using circular payments to rebalance channels, you will still be able to do so, since a circular rebalance must leave your node on one channel and arrive on another.

That being said if your case is specifically reliant on circular payments on the same channel, make sure to add --allow-circular-route to your LND configuration to bypass these changes.

PR: https://github.com/lightningnetwork/lnd/pull/3915

Lightning Labs raises $10M in Series A

Earlier this week Lightning Labs, the team behind the LND implementation announced a fundraising Series A round of $10M, topping the charts for Lightning Network startups.

We’ve seen over 30 companies integrate LND thus far, with many more in progress, and we’ve had more than 4000 developers and testers contribute to our community.

This is a significant milestone for the vibrant Lightning industry. LND plays a vital role in the software infrastructure for ZEBEDEE, and we are so thrilled to see Lightning Labs achieve this milestone and are excited for the really bright future Lightning Network has ahead.

Congratulations to the Lightning Labs team!

Operational Safety Guidelines

Also from the Lightning Labs team, PR 3963 introduces a great new document called Operational Safety Guidelines — essentially expanding the information for the use/management/recovery/best practices for running and operating an LND node. It goes into detail about the differences between aezeed and BIP39 seeds, which files are essential for backup (SCB), and the expectations that node operators keep their nodes running latest up-to-date software. I encourage all LND users to read it.

PR: https://github.com/lightningnetwork/lnd/pull/3963

More experimental protocol extensions in C-Lightning

C-Lightning PR 3315 adds a new dev-sendcustommsg RPC method, as well as a new custommsg plugin hook to allow developers and operators to send custom arbitrary messages over the Lightning Network messages protocol to any of its peers. This means a C-Lightning node can send any custom message to any of its peers, as long as it follows a set of criteria/limitations:

  • Custom messages are not allowed to have the same type as an internally
    handled message type — this is necessary to ensure that the custom messages injected at one end do not throw off the internal state handling code at the other end.
  • Custom message types are limited to odd-numbered types. This is necessary since even-typed messages are required to drop the connection if they are unknown.
  • Custom messages can only be sent if a peer is currently connected to a node without a channel, or is connected to a node with an-already established channel. Custom messages are not handled while channels are opening or closing.

TLDR: This PR allows C-Lightning to send any custom message (on top of the established specification messages) that follows the it’s ok to be odd rule, to any peer it is connected to, with or without an established channel.

NOTE: As explained in Bitcoin Optech #83, this feature should not be confused with applications like WhatSat that send chat messages across a network route inside onion-encrypted payments; this merged PR only allows sending protocol messages to a node’s direct peers.

PR: https://github.com/ElementsProject/lightning/pull/3315

Chantools

When running an LND node, there’s always the unfortunate scenario where you need to perform key-recovery due to some unforeseen loss of keys/access. chantools is a new project by Oliver Gugger from the Lightning Labs team that helps introspect LND wallets for key-recovery scenarios. I haven’t given it a deep look/test myself but below are some of the tasks it aims to help with:

  • Inspect the decoded contents of a static channel backup file.
  • Force-close channels directly with the channel’s details, without needing a running LND instance.
  • Attempt to recover funds from force-closed LND channels when a peer is not cooperative (SCB recovery currently requires the peer to be online and reactive to provide data needed, and to force-close the channel).
  • Export the wallet’s root key in order to detect onchain transactions from the LND wallet.

Link: https://github.com/guggero/chantools

P.S.: Thank you to Carla Kirk-Cohen for providing comments and updates to the Circular Channels PR changes above — in her own words: I don’t want people to worry that we are going to break their rebalancing scheme, because we thought about it very carefully!

That is all for Lightning This Week. If I’ve missed something important please let me know through the comments or on Twitter.

ZEBEDEE’s mission is to develop software and infrastructure to introduce first-class Bitcoin and Lightning support into digital experiences and gaming environments. This allows players, developers, streamers, and watchers to interact and instantly exchange value in a frictionless manner.

To learn more, visit our website and follow us on Twitter.

--

--