Lightning network
C Assembly C++ Makefile Shell Python Other
Latest commit cae2830 Jan 13, 2017 @cdecker cdecker committed with rustyrussell sphinx: Committing the onion packet to the payment-hash
The sphinx onion packet now commits to the HTLC payment-hash it is
associated with. This prevents replay attacks with the same onion.
Permalink
Failed to load latest commit information.
bitcoin utils: add tal_hex() helper. Jan 10, 2017
ccan ccan: forgotten test files after last update. Jan 10, 2017
contrib contrib/lightning-pay: helper to make a payment. Oct 19, 2016
daemon sphinx: Committing the onion packet to the payment-hash Jan 16, 2017
doc doc: manpages for the various lightning RPC calls. Sep 6, 2016
libsodium @ fce6852 libsodium: add as submodule. Jan 10, 2017
lightningd lightningd/Makefile: fix check-source Jan 13, 2017
secp256k1 libsecp256k1: update. Jul 1, 2016
test sphinx: Committing the onion packet to the payment-hash Jan 16, 2017
tools tools/generate-wire.py: don't allocate on unknown names. Jan 10, 2017
wire libsodium: use our local submodule. Jan 10, 2017
.gitignore gitignore: Ignoring some of the test-binaries. Jan 13, 2017
.gitlab-ci.yml Add .gitlab-ci.yml Dec 11, 2016
.gitmodules libsodium: add as submodule. Jan 10, 2017
HACKING.md controlled_time: remove Nov 9, 2016
INSTALL.md libsodium: use our local submodule. Jan 10, 2017
LICENSE licensing: Make license explicit. Jan 21, 2016
Makefile libsodium: use our local submodule. Jan 10, 2017
README.md README.md: add "upgrade" instructions and add port config for public … Nov 20, 2016
TODO.md TODO: remove to-dones. Sep 6, 2016
check-bolt.c check-bolt: use new BOLTs. Jan 4, 2017
close_tx.c Use global secp256k1_ctx instead of passing it around. Dec 2, 2016
close_tx.h Use global secp256k1_ctx instead of passing it around. Dec 2, 2016
find_p2sh_out.c scripteq: simple helper for comparing scripts. May 3, 2016
find_p2sh_out.h Remove unused script functions now we use witness. Apr 24, 2016
irc.c Merge remote-tracking branch 'origin/pr/44' Oct 17, 2016
irc.h Merge remote-tracking branch 'origin/pr/44' Oct 17, 2016
lightning.pb-c.c proto: Added nested_pkt Jan 3, 2017
lightning.pb-c.h proto: Added nested_pkt Jan 3, 2017
lightning.proto proto: Added nested_pkt Jan 3, 2017
opt_bits.c opt_bits: parsing routines for 'bits' == 100 satoshi. Jun 7, 2015
opt_bits.h header cleanup: sort include lines into alpha order, after config.h Jan 21, 2016
overflows.h daemon: routing infrastructure. Jul 1, 2016
permute_tx.c permute_tx: don't save permutation map. Aug 18, 2016
permute_tx.h permute_tx: don't save permutation map. Aug 18, 2016
protobuf_convert.c type_to_string: move formatting to appropriate files. Jan 4, 2017
protobuf_convert.h Use global secp256k1_ctx instead of passing it around. Dec 2, 2016
remove_dust.h channel: remove htlcs array. Aug 18, 2016
status.c status: don't send overlarge messages. Jan 10, 2017
status.h status: API for status reporting. Jan 10, 2017
type_to_string.c type_to_string: move formatting to appropriate files. Jan 4, 2017
type_to_string.h type_to_string: move formatting to appropriate files. Jan 4, 2017
utils.c utils: add tal_hex() helper. Jan 10, 2017
utils.h utils: add tal_hex() helper. Jan 10, 2017
version.c getinfo: add version information Sep 13, 2016
version.h options: --help and --version are early args. Jan 4, 2017

README.md

Lightning Protocol Reference Implementation

In this repository we're developing a reference implementation of bitcoin lightning (see: http://lightning.network which proposed the original "lightning network").

This implementation is being developed in parallel with the protocol definition, which you can find on my fork of the protocol description repository.

If you're interested in using the daemon to test payments, the JSON-RPC interface is documented in the following manual pages:

Steps:

  1. If you're running a previous version, you'll need to shut it down (maybe close channels first) and delete the $HOME/.lightning directory.
  2. Install and compile the requirements.
  3. Make sure bitcoind is running in testnet mode, and has the latest blocks.
  4. Get some test bitcoins, such as from TPs' testnet faucet.
  5. If you want others to connect to your lightningd, create $HOME/.lightning/config and put port=8334 in it (or any other port).
  6. Run daemon/lightningd.
  7. Run daemon/lightning-cli getinfo to check it's working.
  8. Find a node using daemon/lightning-cli getnodes (this will populate over time).
  9. Create a new connection to the node using contrib/lightning-open-channel ADDRESS PORT AMOUNT where AMOUNT is in BTC (.04294967 is the maximum possible). If successful, this will return only once a block has been mined with the funding transaction in it.
  10. You can create more channels if you wish.
  11. You can accept payment using daemon/lightning-cli invoice MILLISATOSHI LABEL; it will give you a payment hash to give to the payer.
  12. You can send payments using contrib/lightning-pay DEST-ID MILLISATOSHI PAYMENT-HASH.

Final note: This is very much a testbed and work in progress; expect All The Things to change, all the time.

Welcome aboard!

Rusty.