No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
scripts
src
test
.gitignore
README.md
package-lock.json
package.json

README.md

ilp-plugin-lightning

Interledger.js Ledger Plugin for the Lightning Network

This plugin enables Interledger payments through the Bitcoin and Litecoin Lightning Networks.

See the ILP Lightning Demo or the example script to watch this plugin in action.

Installation

npm install --save ilp-plugin-lightning

Usage

This plugin can be used with the ilp client module or the ilp-connector. See the Ledger Plugin Interface for documentation on available methods.

A minimal way to test your setup:

DEBUG=* LND_TLS_CERT_PATH=~/Library/"Application Support"/Lnd/tls.cert ALICE_PUBKEY=036fb00... BOB_PUBKEY=45c2e46... node scripts/test.js

or for Linux:

DEBUG=* LND_TLS_CERT_PATH=~/.lnd/tls.cert ALICE_PUBKEY=036fb00... BOB_PUBKEY=45c2e46... node scripts/test.js
  • It should output something like the following:
{ server: 'btp+ws://:pass@localhost:9000',
  maxBalance: '1000000',
  maxUnsecured: '1000',
  lndTlsCertPath: '/Users/michiel/Library/Application Support/Lnd/tls.cert',
  lndUri: 'localhost:10009',
  peerPublicKey: '036fb0045c2e4651995b7e2fe6656fac729087857af56dc75ab48f9769e0a7001f',
  _store: ObjStore { s: {} } }
{ listener: { port: 9000 },
  incomingSecret: 'pass',
  prefix: 'test.crypto.lightning.btc.testnet3.',
  info: {},
  maxBalance: '1000000',
  maxUnsecured: '1000',
  lndTlsCertPath: '/Users/michiel/Library/Application Support/Lnd/tls.cert',
  lndUri: 'localhost:10009',
  peerPublicKey: '036fb0045c2e4651995b7e2fe6656fac729087857af56dc75ab48f9769e0a7001f',
  _store: ObjStore { s: {} } }
connnn... 1
connnn... 2
connnn... 3
connnn... 1
connnn... 2
connnn... 3
Transfer prepared server-side. Condition: L0PV5Khe_vkNV2NIH5Sts8muJYGLb1lDrUEXHsAfPJc
Transfer prepared client-side, waiting for fulfillment...
Transfer executed. Fulfillment: yUu7TlEGuz6es7_UBi7AQGFqP_GOBczSytECWAoc9CI

See the Ledger Plugin Interface for documentation on available methods.

How It Works

This plugin can be used by two Interledger nodes (sender to connector, connector to connector, and connector to receiver) to send payments through an instance of the Lightning Network. It uses the Bilateral Transfer Protocol, implemented by the payment channel framework, to send Interledger payment and quote details that cannot currently be communicated through lnd itself. Because of the need for an additional messaging layer, this plugin implementation only works bilaterally at present.