olaviolacerda / node-lightning

Lighting Network implemented in Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node Lightning logo

Node-Lightning (formerly LNTools)

Node.js CI codecov

About the Project

Node-Lightning is an implementation of the Bitcoin Lightning Network in the Node.js runtime. The goal of this project is to implement the BOLT specifications to enable testing, research, and education. This project is not intended to replace or compete with the major implementations, though our hope is that the implementation will be fully functional.

This library contains the core packages and several examples. There is currently no runtime for this project.

The architecture philosophies for packages is:

  1. Minimize external dependencies - the Node.js ecosystem is rife with excess dependency usage. This project attempts to minimize the usage of external depedencies as much as possible (there are very few external modules in use at this point).
  2. Reduce complexity using semi-formalized state machines - the Lightning Network is a complex beast. It is very difficult to reason about code that has high cyclomatic complexity. To reduce cognitive load, allow for isolated testing, and enable composibility and extensibility, code is frequently broken into state machines and combined with concepts from state charts. This library is not using metaprogramming techniques, though we are using many of the concepts. This enables the last point.
  3. Engineer for modular composibility - The goal is to enable composibility of various state machines which enables swapping out implementations or direct extensibility of complex processes.

The goal of this project is ambitious and there is a still a long road ahead. Refer to issues and the wiki for more information on how this project is structured and how you can contribute.

Structure and Modules

Node-Lightning is structured as a monorepo with individual packages existing inside of packages.

Examples of usage can be found inside examples

BOLT Status

Current status of Lightning RFC specification implementation:


Lighting Network implemented in Node.js

License:MIT License


Language:TypeScript 98.7%Language:C++ 1.1%Language:Python 0.2%