BTC -> LTC Lightning Demo
Send payments between Lightning Networks using Interledger
- Node.js >= v7.10.0
- Docker (only to run local Lightning nodes)
Running the Demo
0. Set Up Lightning Networks
You can skip this step if you already have 2 lightning nodes setup on the Bitcoin Lightning Network and 2 on the Litecoin Lightning Network.
The following uses BitFury's
simple-simnet to run local testnets and Lightning daemons for both Bitcoin and Litecoin.
In one terminal run:
git clone https://github.com/BitfuryLightning/simple-simnet cd simple-simnet ./bitcoin/build.sh ./bitcoin/start.sh
In another terminal run:
cd simple-simnet ./litecoin/build.sh ./litecoin/start.sh
1. Run an Interledger Connector
This will run a connector and automatically configure it to connect to the
lnd nodes started in the previous step.
In a new terminal run:
git clone https://github.com/interledgerjs/ilp-lightning-demo cd ilp-lightning-demo npm install node run-connector.js
To configure the connector to use different
lnd nodes, set the environment variables
LITECOIN_LND_2 to those
lnd nodes' RPC endpoints.
2. Send a Payment
From another terminal run the following to send a payment from one of the Bitcoin
lnd nodes to a Litecoin
(Run with the environment variable
DEBUG=ilp* to see additional details of what is happening.)
How it Works
Interledger is a protocol for connecting payment networks or ledgers.
The Interledger packet is attached to transfers across individual ledgers and instructs connectors where to forward payments. Hashed-Timelock Agreements (HTLAs), a generalization of HTLCs, are used to secure Interledger payments.