Giter Site home page Giter Site logo

attacking-lightning-s-anonymity's Introduction

Attacking Lightning's Anonymity

An attack that enables an intermediary to break the anonymity of the source and destination of a trannsaction in the Lightning network.

This includes a simulator to simulate transactions using LND(https://github.com/lightningnetwork/lnd/blob/master/routing/pathfind.go), c-Lightning(https://github.com/ElementsProject/lightning/blob/f3159ec4acd1013427c292038b88071b868ab1ff/common/route.c) and Eclair(https://github.com/ACINQ/eclair/blob/master/eclair-core/src/main/scala/fr/acinq/eclair/router/Router.scala).

All path finding algorithms are based on the Dijkstra's algorithm using a priority queue(https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm).

We modify Eclair to use a generalized version of Dijkstra's algorithm(https://en.wikipedia.org/wiki/K_shortest_path_routing) instead of using Yen's algorithm(https://en.wikipedia.org/wiki/Yen%27s_algorithm). We do not have code to simulate concurrent payments yet.

The experiment is run on a snapshot of the Lightning Network obtained from https://ln.bigsun.xyz. The set of adversaries is a mixture of nodes with high centrality, low centrality and random nodes. The snapshot as well as the centralities of all nodes are found in data/Snapshot and data/Centrality respectively.

Code Structure

populate_graph.py - Creates a payment graph from a snapshot of the Lightning Network.

pathFind.py - Implements Dijkstra and generalized Dijkstra(for 3 best paths) taking the cost function of either LND, c-Lightning or Eclair as argument.

attack_mixed.py - Implements an attack where an intermediary finds all potential sources and destinations of a transaction that it is a part of.

execute.py - Runs a sample experiment with a set of adversaries on transactions between random pairs of sources and destinations.

results.py - Generates statistics and plots from the anonymity sets.

Running an experiment

  • Choose the set of adversaries using the centrality data from data/Centrality as your guide.
  • Specify the number of transactions you want to simulate in a run.
  • Specify the mechanism for choosing source destination pairs for each transaction.
  • The details of the transactions and the results of each attack instance is copied to results.json

Results

The following results can be obtained from results.py:

  • A figure plotting the sizes of each source and destination anonymity set.
  • Number of transactions for which either source or the destination anonymity set was a singular set or both.
  • The number of transactions attacked by each adversary.
  • Correlation of the number of hops from the adversary to source/destination to the size of source/destination anonymity set.

attacking-lightning-s-anonymity's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.