Giter Club home page Giter Club logo

ln-fm-private's Introduction

Payout Race README

Docker

Our model can be checked with the provided Docker setup. First, build the docker image. From inside the directory, run

docker build -t payoutrace .

Then run the container with

docker run payoutrace <N>

where <N> is an integer 1-5 representing a property to verify. These correspond to the properties in the paper and are numbered as such. The argument <N> can also be left out to check the model for deadlocks and livelocks. If a property does not verify, an error will be thrown. Errors from Spin can be difficult to parse, look for the following messages near the top of the console output.

pan:1: event_trace error 

or

pan:1: assertion violated

If successful, the output will report all states as reached, and not report any deadlocks or livelocks. There should be errors for properties 3 and 4, but not for any others.

Non-Docker instructions

Note that a full implementation of lnd is included.

Running Model Checker

The SPIN model checker must be installed and available from the command line. Run ./lnverifier to test the model with SPIN. It should report all states as reached, and not report any deadlocks or livelocks.

Providing a numeric argument will verify the corresponding property in the paper, e.g., ./lnverifier -p 1 will verify property 1. Properties are numbered 1-5. If a property does not verify, an error will be thrown.

pan:1: event_trace error (no matching event) (at depth 68)
pan: wrote model.tmp.pml.trail

or

pan:1: assertion violated

Running Attack Reproduction PoC

Run the following to setup the lnd and btcd nodes, create a LN channel and prepare the nodes to make payments.

./reproctl setup

To execute the attack, run

./reproctl attack 1

If I want to step through each phase in the attack, comment out blocks in the attack() function to stop at the desired phase before running.

To view time-until-maturity, run

docker exec -it bob lncli --network=simnet pendingchannels

To view mempool

./reproctl btcctl getmempoolinfo
./reproctl btcctl getmempoolentry <txid>

ln-fm-private's People

Contributors

iowaguy avatar

Watchers

 avatar  avatar  avatar

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.