utilities and instructions to run a lightning jamming attackathon
Go to file
Carla Kirk-Cohen a3b0da7c43
data: updated graphs for ln_10 (manually fixed cltv_delta = 10)
LND requires a minimum cltv delta of 18, but one of the nodes that
we've scraped has a delta of 10 - update our graph manually to just
use 18 to keep things simple.
2024-04-10 15:26:25 -04:00
data data: updated graphs for ln_10 (manually fixed cltv_delta = 10) 2024-04-10 15:26:25 -04:00
scripts scripts: add node credentials to start attacker script 2024-04-09 14:33:06 -04:00
setup setup: update aliases for lnd1/2 2024-04-10 12:06:17 -04:00
.gitignore gitignore: specifically ignore data file that's going to change a lot 2024-03-28 16:34:48 -04:00
README.md readme: simplify writeup 2024-04-09 14:43:05 -04:00
hackerman.jpg readme: aesthetic fixes 2024-03-28 13:09:17 -04:00

README.md

Attackathon

image info

Task

In this attackathon, your task will be to write a program that performs a channel jamming attack against a test lightning network. Your goal is to completely jam a routing node for an hour.

Your program should:

  • Accept the public key of the node being attacked as a parameter.
  • Write an attack against the hybrid approach to jamming mitigations which is deployed on the network.
  • Open any channels required to perform the attack, and close them when the attack has competed.

The final deliverable for the attackathon is a run script that downloads, installs and runs your attack in a kubernetes cluster.

Jamming Definition

The conventional definition of a jamming attack classifies a node as jammed if for all of its channels:

All of its local(/outbound) HTLC slots are occupied.
OR 
All of its local(/outbound) liquidity is occupied.

Given that we are operating within the context of a reputation system, we extend our definition of a node being "jammed" to consider the possibility that the attack may try to use the reputation system itself to disrupt quality of service.

We therefore expand our definition of a jamming attack to account for this:

All of its general bucket's local(/outbound) liquidity is occupied
AND 
All of its peers have low reputation

This expanded definition accounts for the case where an attacker has successfully sabotaged the reputation of all of a node's peers, so they no longer have access to the protected bucket which reserves resources for high reputation peers during an attack.

Network

The attack you develop will be tested against a warnet running a network of LND nodes that have the jamming attack mitigation implemented* (via an external tool called circuitbreaker).

Some relevant characteristics of the network:

  • The reputation system has been primed with historical forwarding data, so nodes in the network have already had a chance to build up reputation before the attack begins.
  • Each node in the network:
    • Allows 483 HTLCs in flight per channel.
    • Allows 45% of its channel's capacity in flight.
    • Allocates 50% of these resources to "general" traffic, and 50% to protected traffic.
  • The graph was obtained by reducing the mainnet graph using a random walk around our target node, and real-world routing policies are used.
  • When you run the attack, the non-malicious nodes in the network will be executing randomly generated payments to mimic an active network.

Some APIS to note:

* Note that endorsement signaling and reputation tracking are fully deployed on the test network, but unconditional fees are not. You should assume that they will be 1% of your success-case fees, and we will account for them during attack analysis.

Local Development

To assist with local development, we've provided a test network that can be used to run your attacks against. Prerequisites to set up this network are:

  • Python3
  • Docker
  • Kubernetes
  • Just

Clone the attackathon repo: git clone https://github.com/carlaKC/attackathon

Do not change directory.

The scripts will pull the relevant repositories to your current working directory and set up your network. They expect the attackathon repository to be in the current directory.

Assessment

Attacks will be assessed using the following measures:

  • Did the attack achieve a jamming attack as described above?
  • What was the total cost of the attack, considering:
    • On-chain fees: for channel opens and closes, sending funds between nodes on-chain will node be included for simplicity's sake.
    • Off-chain fees: the sum of fees paid for successful off-chain payments plus 1% of the success-case fees for all payments that are sent to represent unconditional fees.
    • Opportunity cost of capital: for each channel that is opened, 5% p.a. charged on the total capital deployed in the channels, assuming 10 minute blocks.
  • When compared to the operation of the network without a jamming attack, how many honest htlcs were dropped as a result of the attack?

HackNicePlz

We're trying to break channel jamming mitigations, not our setup itself so please be a good sport and let us know if there's anything buggy! Real attackers won't be able to take advantage of our test setup, so neither should we.

Network Creation

Participants do not need to read the following section, it contains instructions on how to setup a warnet network to run the attackathon on.

Setup Instructions

To get started, you will need to clone the following repos in the same working directory:

  1. This repo
  2. Warnet
  3. SimLN
  4. Circuitbreaker

You will need to provide:

  1. A json file with the same format as LND's describegraph output which describes the graph that you'd like to simulate.
  2. The duration of time, expressed in seconds, that you'd like the setup script to generate fake historical forwards for all the nodes in the network for.

The setup script provided will generate all required files and docker images for you: ./attackathon/setup/create_network.sh {path to json file} {duration in seconds}

Note that you must run this from your directory containing warnet, simln and circuitbreaker because it moves between directories to achieve various tasks! The name that you give the json file is considered to be your network_name.

Once the script has completed, check in any files that it generated and provide your students with the following:

  1. The network_name for your attackathon.
  2. The attackathon repo (/branch) with all files checked in.

The script currently hardcodes the docker hub account for images to carlakirkcohen and tries to push to it, so you'll need to search and replace if you want to test the full flow.