diff --git a/.gitbook/assets/01-cyphernode.png b/.gitbook/assets/01-cyphernode.png new file mode 100644 index 0000000..72c6e5c Binary files /dev/null and b/.gitbook/assets/01-cyphernode.png differ diff --git a/.gitbook/assets/01a-cyphernode.png b/.gitbook/assets/01a-cyphernode.png new file mode 100644 index 0000000..120600a Binary files /dev/null and b/.gitbook/assets/01a-cyphernode.png differ diff --git a/.gitbook/assets/02-cyphernode.png b/.gitbook/assets/02-cyphernode.png new file mode 100644 index 0000000..a63513c Binary files /dev/null and b/.gitbook/assets/02-cyphernode.png differ diff --git a/.gitbook/assets/03-cyphernode.png b/.gitbook/assets/03-cyphernode.png new file mode 100644 index 0000000..bc982d9 Binary files /dev/null and b/.gitbook/assets/03-cyphernode.png differ diff --git a/.gitbook/assets/04-cyphernode.png b/.gitbook/assets/04-cyphernode.png new file mode 100644 index 0000000..c46774e Binary files /dev/null and b/.gitbook/assets/04-cyphernode.png differ diff --git a/.gitbook/assets/amp-figure01.png b/.gitbook/assets/amp-figure01.png new file mode 100644 index 0000000..5cad819 Binary files /dev/null and b/.gitbook/assets/amp-figure01.png differ diff --git a/.gitbook/assets/amp-figure02.png b/.gitbook/assets/amp-figure02.png new file mode 100644 index 0000000..94b50db Binary files /dev/null and b/.gitbook/assets/amp-figure02.png differ diff --git a/.gitbook/assets/amp-figure03.png b/.gitbook/assets/amp-figure03.png new file mode 100644 index 0000000..ae8934a Binary files /dev/null and b/.gitbook/assets/amp-figure03.png differ diff --git a/.gitbook/assets/amp-figure04.png b/.gitbook/assets/amp-figure04.png new file mode 100644 index 0000000..a03dbff Binary files /dev/null and b/.gitbook/assets/amp-figure04.png differ diff --git a/.gitbook/assets/amp-figure05 (1).png b/.gitbook/assets/amp-figure05 (1).png new file mode 100644 index 0000000..5afecd5 Binary files /dev/null and b/.gitbook/assets/amp-figure05 (1).png differ diff --git a/.gitbook/assets/amp-figure05.png b/.gitbook/assets/amp-figure05.png new file mode 100644 index 0000000..5afecd5 Binary files /dev/null and b/.gitbook/assets/amp-figure05.png differ diff --git a/.gitbook/assets/amp-figure06.png b/.gitbook/assets/amp-figure06.png new file mode 100644 index 0000000..74d19f1 Binary files /dev/null and b/.gitbook/assets/amp-figure06.png differ diff --git a/.gitbook/assets/amp-figure07.png b/.gitbook/assets/amp-figure07.png new file mode 100644 index 0000000..7091517 Binary files /dev/null and b/.gitbook/assets/amp-figure07.png differ diff --git a/.gitbook/assets/amp-figure08.png b/.gitbook/assets/amp-figure08.png new file mode 100644 index 0000000..2bf2152 Binary files /dev/null and b/.gitbook/assets/amp-figure08.png differ diff --git a/.gitbook/assets/amp-figure09.png b/.gitbook/assets/amp-figure09.png new file mode 100644 index 0000000..d996cbd Binary files /dev/null and b/.gitbook/assets/amp-figure09.png differ diff --git a/.gitbook/assets/amp-figure10.png b/.gitbook/assets/amp-figure10.png new file mode 100644 index 0000000..e295b74 Binary files /dev/null and b/.gitbook/assets/amp-figure10.png differ diff --git a/.gitbook/assets/amp-figure11.png b/.gitbook/assets/amp-figure11.png new file mode 100644 index 0000000..9f2e6f0 Binary files /dev/null and b/.gitbook/assets/amp-figure11.png differ diff --git a/.gitbook/assets/bitcoin.conf b/.gitbook/assets/bitcoin.conf new file mode 100644 index 0000000..34cb089 --- /dev/null +++ b/.gitbook/assets/bitcoin.conf @@ -0,0 +1,14 @@ +# server=1 tells bitcoind to accept JSON-RPC commands +server=1 + +# Enable publish raw block in
+zmqpubrawblock=tcp://127.0.0.1:28332 + +# Enable publish raw transaction in
+zmqpubrawtx=tcp://127.0.0.1:28333 + +# On client-side, you add the normal user/password pair to send commands: +rpcuser=rpcuser_here_844585 + +# change this password +rpcpassword=rpcpassword_here_12574 \ No newline at end of file diff --git a/.gitbook/assets/btcpay4aws-01 (1).png b/.gitbook/assets/btcpay4aws-01 (1).png new file mode 100644 index 0000000..a4b4933 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-01 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-01.png b/.gitbook/assets/btcpay4aws-01.png new file mode 100644 index 0000000..391b383 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-01.png differ diff --git a/.gitbook/assets/btcpay4aws-01b.png b/.gitbook/assets/btcpay4aws-01b.png new file mode 100644 index 0000000..021e192 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-01b.png differ diff --git a/.gitbook/assets/btcpay4aws-02 (1).png b/.gitbook/assets/btcpay4aws-02 (1).png new file mode 100644 index 0000000..493f2ad Binary files /dev/null and b/.gitbook/assets/btcpay4aws-02 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-02.png b/.gitbook/assets/btcpay4aws-02.png new file mode 100644 index 0000000..493f2ad Binary files /dev/null and b/.gitbook/assets/btcpay4aws-02.png differ diff --git a/.gitbook/assets/btcpay4aws-03 (1).png b/.gitbook/assets/btcpay4aws-03 (1).png new file mode 100644 index 0000000..83d1c0e Binary files /dev/null and b/.gitbook/assets/btcpay4aws-03 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-03.png b/.gitbook/assets/btcpay4aws-03.png new file mode 100644 index 0000000..83d1c0e Binary files /dev/null and b/.gitbook/assets/btcpay4aws-03.png differ diff --git a/.gitbook/assets/btcpay4aws-04 (1).png b/.gitbook/assets/btcpay4aws-04 (1).png new file mode 100644 index 0000000..b0fc7b5 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-04 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-04.png b/.gitbook/assets/btcpay4aws-04.png new file mode 100644 index 0000000..b0fc7b5 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-04.png differ diff --git a/.gitbook/assets/btcpay4aws-05 (1).png b/.gitbook/assets/btcpay4aws-05 (1).png new file mode 100644 index 0000000..52da0c4 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-05 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-05.png b/.gitbook/assets/btcpay4aws-05.png new file mode 100644 index 0000000..52da0c4 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-05.png differ diff --git a/.gitbook/assets/btcpay4aws-06 (1).png b/.gitbook/assets/btcpay4aws-06 (1).png new file mode 100644 index 0000000..104541b Binary files /dev/null and b/.gitbook/assets/btcpay4aws-06 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-06 (2).png b/.gitbook/assets/btcpay4aws-06 (2).png new file mode 100644 index 0000000..907d26f Binary files /dev/null and b/.gitbook/assets/btcpay4aws-06 (2).png differ diff --git a/.gitbook/assets/btcpay4aws-06 (3).png b/.gitbook/assets/btcpay4aws-06 (3).png new file mode 100644 index 0000000..0d01afb Binary files /dev/null and b/.gitbook/assets/btcpay4aws-06 (3).png differ diff --git a/.gitbook/assets/btcpay4aws-06.png b/.gitbook/assets/btcpay4aws-06.png new file mode 100644 index 0000000..907d26f Binary files /dev/null and b/.gitbook/assets/btcpay4aws-06.png differ diff --git a/.gitbook/assets/btcpay4aws-06a.png b/.gitbook/assets/btcpay4aws-06a.png new file mode 100644 index 0000000..fd514ac Binary files /dev/null and b/.gitbook/assets/btcpay4aws-06a.png differ diff --git a/.gitbook/assets/btcpay4aws-06b.png b/.gitbook/assets/btcpay4aws-06b.png new file mode 100644 index 0000000..b0b9f36 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-06b.png differ diff --git a/.gitbook/assets/btcpay4aws-07 (1).png b/.gitbook/assets/btcpay4aws-07 (1).png new file mode 100644 index 0000000..bcb0c2b Binary files /dev/null and b/.gitbook/assets/btcpay4aws-07 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-07.png b/.gitbook/assets/btcpay4aws-07.png new file mode 100644 index 0000000..bcb0c2b Binary files /dev/null and b/.gitbook/assets/btcpay4aws-07.png differ diff --git a/.gitbook/assets/btcpay4aws-08 (1).png b/.gitbook/assets/btcpay4aws-08 (1).png new file mode 100644 index 0000000..c0254a9 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-08 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-08.png b/.gitbook/assets/btcpay4aws-08.png new file mode 100644 index 0000000..c0254a9 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-08.png differ diff --git a/.gitbook/assets/btcpay4aws-09 (1).png b/.gitbook/assets/btcpay4aws-09 (1).png new file mode 100644 index 0000000..c9c7c5b Binary files /dev/null and b/.gitbook/assets/btcpay4aws-09 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-09.png b/.gitbook/assets/btcpay4aws-09.png new file mode 100644 index 0000000..c9c7c5b Binary files /dev/null and b/.gitbook/assets/btcpay4aws-09.png differ diff --git a/.gitbook/assets/btcpay4aws-10 (1).png b/.gitbook/assets/btcpay4aws-10 (1).png new file mode 100644 index 0000000..a9d6cff Binary files /dev/null and b/.gitbook/assets/btcpay4aws-10 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-10.png b/.gitbook/assets/btcpay4aws-10.png new file mode 100644 index 0000000..a9d6cff Binary files /dev/null and b/.gitbook/assets/btcpay4aws-10.png differ diff --git a/.gitbook/assets/btcpay4aws-10a (1).png b/.gitbook/assets/btcpay4aws-10a (1).png new file mode 100644 index 0000000..71e7c88 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-10a (1).png differ diff --git a/.gitbook/assets/btcpay4aws-10a.png b/.gitbook/assets/btcpay4aws-10a.png new file mode 100644 index 0000000..71e7c88 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-10a.png differ diff --git a/.gitbook/assets/btcpay4aws-10b (1).png b/.gitbook/assets/btcpay4aws-10b (1).png new file mode 100644 index 0000000..ef542a2 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-10b (1).png differ diff --git a/.gitbook/assets/btcpay4aws-10b.png b/.gitbook/assets/btcpay4aws-10b.png new file mode 100644 index 0000000..ef542a2 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-10b.png differ diff --git a/.gitbook/assets/btcpay4aws-11 (1).png b/.gitbook/assets/btcpay4aws-11 (1).png new file mode 100644 index 0000000..d6e6480 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-11 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-11.png b/.gitbook/assets/btcpay4aws-11.png new file mode 100644 index 0000000..d6e6480 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-11.png differ diff --git a/.gitbook/assets/btcpay4aws-12 (1).png b/.gitbook/assets/btcpay4aws-12 (1).png new file mode 100644 index 0000000..69fa6c7 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-12 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-12.png b/.gitbook/assets/btcpay4aws-12.png new file mode 100644 index 0000000..69fa6c7 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-12.png differ diff --git a/.gitbook/assets/btcpay4aws-13 (1).png b/.gitbook/assets/btcpay4aws-13 (1).png new file mode 100644 index 0000000..7fddc52 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-13 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-13.png b/.gitbook/assets/btcpay4aws-13.png new file mode 100644 index 0000000..7fddc52 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-13.png differ diff --git a/.gitbook/assets/btcpay4aws-14 (1).png b/.gitbook/assets/btcpay4aws-14 (1).png new file mode 100644 index 0000000..2064865 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-14 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-14.png b/.gitbook/assets/btcpay4aws-14.png new file mode 100644 index 0000000..2064865 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-14.png differ diff --git a/.gitbook/assets/btcpay4aws-15 (1).png b/.gitbook/assets/btcpay4aws-15 (1).png new file mode 100644 index 0000000..afbe27c Binary files /dev/null and b/.gitbook/assets/btcpay4aws-15 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-15.png b/.gitbook/assets/btcpay4aws-15.png new file mode 100644 index 0000000..afbe27c Binary files /dev/null and b/.gitbook/assets/btcpay4aws-15.png differ diff --git a/.gitbook/assets/btcpay4aws-16 (1).gif b/.gitbook/assets/btcpay4aws-16 (1).gif new file mode 100644 index 0000000..d1a16ca Binary files /dev/null and b/.gitbook/assets/btcpay4aws-16 (1).gif differ diff --git a/.gitbook/assets/btcpay4aws-16.gif b/.gitbook/assets/btcpay4aws-16.gif new file mode 100644 index 0000000..d1a16ca Binary files /dev/null and b/.gitbook/assets/btcpay4aws-16.gif differ diff --git a/.gitbook/assets/btcpay4aws-17 (1).gif b/.gitbook/assets/btcpay4aws-17 (1).gif new file mode 100644 index 0000000..adb9eb1 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-17 (1).gif differ diff --git a/.gitbook/assets/btcpay4aws-17.gif b/.gitbook/assets/btcpay4aws-17.gif new file mode 100644 index 0000000..adb9eb1 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-17.gif differ diff --git a/.gitbook/assets/btcpay4aws-18 (1).png b/.gitbook/assets/btcpay4aws-18 (1).png new file mode 100644 index 0000000..0299162 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-18 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-18.png b/.gitbook/assets/btcpay4aws-18.png new file mode 100644 index 0000000..0299162 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-18.png differ diff --git a/.gitbook/assets/btcpay4aws-19 (1).png b/.gitbook/assets/btcpay4aws-19 (1).png new file mode 100644 index 0000000..9c878ff Binary files /dev/null and b/.gitbook/assets/btcpay4aws-19 (1).png differ diff --git a/.gitbook/assets/btcpay4aws-19.png b/.gitbook/assets/btcpay4aws-19.png new file mode 100644 index 0000000..9c878ff Binary files /dev/null and b/.gitbook/assets/btcpay4aws-19.png differ diff --git a/.gitbook/assets/btcpay4aws-20.png b/.gitbook/assets/btcpay4aws-20.png new file mode 100644 index 0000000..92fb18b Binary files /dev/null and b/.gitbook/assets/btcpay4aws-20.png differ diff --git a/.gitbook/assets/btcpay4aws-21.png b/.gitbook/assets/btcpay4aws-21.png new file mode 100644 index 0000000..7a839d0 Binary files /dev/null and b/.gitbook/assets/btcpay4aws-21.png differ diff --git a/.gitbook/assets/channel-capacity.png b/.gitbook/assets/channel-capacity.png new file mode 100644 index 0000000..015e92a Binary files /dev/null and b/.gitbook/assets/channel-capacity.png differ diff --git a/.gitbook/assets/chjannel-flow.png b/.gitbook/assets/chjannel-flow.png new file mode 100644 index 0000000..76bd418 Binary files /dev/null and b/.gitbook/assets/chjannel-flow.png differ diff --git a/.gitbook/assets/image (1).png b/.gitbook/assets/image (1).png new file mode 100644 index 0000000..80ef192 Binary files /dev/null and b/.gitbook/assets/image (1).png differ diff --git a/.gitbook/assets/image (2).png b/.gitbook/assets/image (2).png new file mode 100644 index 0000000..c57d168 Binary files /dev/null and b/.gitbook/assets/image (2).png differ diff --git a/.gitbook/assets/image.png b/.gitbook/assets/image.png new file mode 100644 index 0000000..8913c0c Binary files /dev/null and b/.gitbook/assets/image.png differ diff --git a/.gitbook/assets/key-movement.png b/.gitbook/assets/key-movement.png new file mode 100644 index 0000000..2fa1d6b Binary files /dev/null and b/.gitbook/assets/key-movement.png differ diff --git a/.gitbook/assets/lightningpoll.png b/.gitbook/assets/lightningpoll.png new file mode 100644 index 0000000..890eeb8 Binary files /dev/null and b/.gitbook/assets/lightningpoll.png differ diff --git a/.gitbook/assets/lnd-home-00.png b/.gitbook/assets/lnd-home-00.png new file mode 100644 index 0000000..0f29027 Binary files /dev/null and b/.gitbook/assets/lnd-home-00.png differ diff --git a/.gitbook/assets/lnd-home-01.png b/.gitbook/assets/lnd-home-01.png new file mode 100644 index 0000000..276e7e3 Binary files /dev/null and b/.gitbook/assets/lnd-home-01.png differ diff --git a/.gitbook/assets/lnd-home-02.png b/.gitbook/assets/lnd-home-02.png new file mode 100644 index 0000000..79e821b Binary files /dev/null and b/.gitbook/assets/lnd-home-02.png differ diff --git a/.gitbook/assets/lnd-home-02b.png b/.gitbook/assets/lnd-home-02b.png new file mode 100644 index 0000000..c2fcbab Binary files /dev/null and b/.gitbook/assets/lnd-home-02b.png differ diff --git a/.gitbook/assets/lnd-home-02c.png b/.gitbook/assets/lnd-home-02c.png new file mode 100644 index 0000000..d77b06b Binary files /dev/null and b/.gitbook/assets/lnd-home-02c.png differ diff --git a/.gitbook/assets/lnd-home-02d.gif b/.gitbook/assets/lnd-home-02d.gif new file mode 100644 index 0000000..17dc109 Binary files /dev/null and b/.gitbook/assets/lnd-home-02d.gif differ diff --git a/.gitbook/assets/lnd-home-03.png b/.gitbook/assets/lnd-home-03.png new file mode 100644 index 0000000..c6bee36 Binary files /dev/null and b/.gitbook/assets/lnd-home-03.png differ diff --git a/.gitbook/assets/lnd-home-04.png b/.gitbook/assets/lnd-home-04.png new file mode 100644 index 0000000..16b3a4e Binary files /dev/null and b/.gitbook/assets/lnd-home-04.png differ diff --git a/.gitbook/assets/lnd-home-05.gif b/.gitbook/assets/lnd-home-05.gif new file mode 100644 index 0000000..474d9d0 Binary files /dev/null and b/.gitbook/assets/lnd-home-05.gif differ diff --git a/.gitbook/assets/lnd-home-06.png b/.gitbook/assets/lnd-home-06.png new file mode 100644 index 0000000..aa6effd Binary files /dev/null and b/.gitbook/assets/lnd-home-06.png differ diff --git a/.gitbook/assets/lnd-home-07.gif b/.gitbook/assets/lnd-home-07.gif new file mode 100644 index 0000000..742dc07 Binary files /dev/null and b/.gitbook/assets/lnd-home-07.gif differ diff --git a/.gitbook/assets/lnd-home-08.gif b/.gitbook/assets/lnd-home-08.gif new file mode 100644 index 0000000..4e9fda0 Binary files /dev/null and b/.gitbook/assets/lnd-home-08.gif differ diff --git a/.gitbook/assets/lnd-home-09.png b/.gitbook/assets/lnd-home-09.png new file mode 100644 index 0000000..3a5c4fd Binary files /dev/null and b/.gitbook/assets/lnd-home-09.png differ diff --git a/.gitbook/assets/lnd-home-10.png b/.gitbook/assets/lnd-home-10.png new file mode 100644 index 0000000..e219379 Binary files /dev/null and b/.gitbook/assets/lnd-home-10.png differ diff --git a/.gitbook/assets/lnd-home-11.png b/.gitbook/assets/lnd-home-11.png new file mode 100644 index 0000000..fda1d23 Binary files /dev/null and b/.gitbook/assets/lnd-home-11.png differ diff --git a/.gitbook/assets/lnd-home-12.png b/.gitbook/assets/lnd-home-12.png new file mode 100644 index 0000000..961cab0 Binary files /dev/null and b/.gitbook/assets/lnd-home-12.png differ diff --git a/.gitbook/assets/lnd-home-13.png b/.gitbook/assets/lnd-home-13.png new file mode 100644 index 0000000..66719ad Binary files /dev/null and b/.gitbook/assets/lnd-home-13.png differ diff --git a/.gitbook/assets/local-lightning.png b/.gitbook/assets/local-lightning.png new file mode 100644 index 0000000..11b47ac Binary files /dev/null and b/.gitbook/assets/local-lightning.png differ diff --git a/.gitbook/assets/logo.png b/.gitbook/assets/logo.png new file mode 100644 index 0000000..9f5610f Binary files /dev/null and b/.gitbook/assets/logo.png differ diff --git a/.gitbook/assets/payment-path.png b/.gitbook/assets/payment-path.png new file mode 100644 index 0000000..aa17f40 Binary files /dev/null and b/.gitbook/assets/payment-path.png differ diff --git a/.gitbook/assets/peek-2019-10-30-23-38.gif b/.gitbook/assets/peek-2019-10-30-23-38.gif new file mode 100644 index 0000000..7e8cb69 Binary files /dev/null and b/.gitbook/assets/peek-2019-10-30-23-38.gif differ diff --git a/.gitbook/assets/photo_2019-12-06_12-38-15.jpg b/.gitbook/assets/photo_2019-12-06_12-38-15.jpg new file mode 100644 index 0000000..150e878 Binary files /dev/null and b/.gitbook/assets/photo_2019-12-06_12-38-15.jpg differ diff --git a/.gitbook/assets/screen-shot-2019-06-13-at-2.38.11-pm.png b/.gitbook/assets/screen-shot-2019-06-13-at-2.38.11-pm.png new file mode 100644 index 0000000..bae02fa Binary files /dev/null and b/.gitbook/assets/screen-shot-2019-06-13-at-2.38.11-pm.png differ diff --git a/.gitbook/assets/screen-shot-2019-06-13-at-2.41.48-pm.png b/.gitbook/assets/screen-shot-2019-06-13-at-2.41.48-pm.png new file mode 100644 index 0000000..0720803 Binary files /dev/null and b/.gitbook/assets/screen-shot-2019-06-13-at-2.41.48-pm.png differ diff --git a/.gitbook/assets/screen-shot-2019-06-13-at-3.10.28-pm.png b/.gitbook/assets/screen-shot-2019-06-13-at-3.10.28-pm.png new file mode 100644 index 0000000..7998a49 Binary files /dev/null and b/.gitbook/assets/screen-shot-2019-06-13-at-3.10.28-pm.png differ diff --git a/.gitbook/assets/screen-shot-2019-06-19-at-2.24.27-pm.png b/.gitbook/assets/screen-shot-2019-06-19-at-2.24.27-pm.png new file mode 100644 index 0000000..e6e220f Binary files /dev/null and b/.gitbook/assets/screen-shot-2019-06-19-at-2.24.27-pm.png differ diff --git a/.gitbook/assets/screen-shot-2019-06-19-at-2.25.18-pm.png b/.gitbook/assets/screen-shot-2019-06-19-at-2.25.18-pm.png new file mode 100644 index 0000000..53f4f03 Binary files /dev/null and b/.gitbook/assets/screen-shot-2019-06-19-at-2.25.18-pm.png differ diff --git a/.gitbook/assets/screen-shot-2019-06-19-at-2.36.50-pm.png b/.gitbook/assets/screen-shot-2019-06-19-at-2.36.50-pm.png new file mode 100644 index 0000000..ec51e64 Binary files /dev/null and b/.gitbook/assets/screen-shot-2019-06-19-at-2.36.50-pm.png differ diff --git a/.gitbook/assets/screen-shot-2019-06-19-at-3.07.47-pm.png b/.gitbook/assets/screen-shot-2019-06-19-at-3.07.47-pm.png new file mode 100644 index 0000000..d9d485e Binary files /dev/null and b/.gitbook/assets/screen-shot-2019-06-19-at-3.07.47-pm.png differ diff --git a/.gitbook/assets/screenshot_20191129-170112.png b/.gitbook/assets/screenshot_20191129-170112.png new file mode 100644 index 0000000..d4c1dec Binary files /dev/null and b/.gitbook/assets/screenshot_20191129-170112.png differ diff --git a/.gitbook/assets/tiphub.png b/.gitbook/assets/tiphub.png new file mode 100644 index 0000000..82949e3 Binary files /dev/null and b/.gitbook/assets/tiphub.png differ diff --git a/.gitbook/assets/tiphubui.png b/.gitbook/assets/tiphubui.png new file mode 100644 index 0000000..8493ab4 Binary files /dev/null and b/.gitbook/assets/tiphubui.png differ diff --git a/README.md b/README.md index d9f658a..efc69d5 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,56 @@ -# Welcome +--- +description: Learn. Share. Accelerate Lightning. +--- + +# ⚡Welcome to our Lightning Wiki⚡ + +## Featured Articles + +{% tabs %} +{% tab title="Onboarding" %} +* [What is the Lightning Network?](tech/lightning/lightning-network.md) +* [Lightning Wallets](tutorials/wallets/) +* [Bootstrapping Lightning Channels](tutorials/bootstrapping-liquidity.md) +* [Lightning with Tor](tutorials/nodes/tor.md) +* [Understanding Lightning Invoices](tech/lightning/invoice.md) +* [LND \(Lightning Network Daemon\)](tutorials/nodes/lnd.md) +{% endtab %} + +{% tab title="Apps" %} +* [Bitcoin Testnet Lightning Network](tutorials/altcoin/bitcoin-testnet-ln.md) +* [Litecoin Lightning Network](tutorials/altcoin/litecoin.md) +* [Spacebit Satellite Client](tutorials/apps/spacebit-satellite-client.md) +* [Lightning Torch](tutorials/apps/lightning-torch.md) +* [Lightning Tipping Sites](tutorials/apps/tipping-sites.md) +{% endtab %} + +{% tab title="R&D" %} +* [Atomic Multi-Path Payments \(AMP\)](tech/research/atomic-multi-path-payments.md) +* [Lightning Hardware Appliances](tech/research/lightning-appliance.md) +* [Watchtower Services](tech/research/watchtowers.md) +* [Trustless Layer1-Layer2 \(Submarine\) Swaps](tech/research/submarine-swap.md) +* [Macaroons for LND Authentication](tech/research/macaroons.md) +* [Channel Backup](tech/channels/channel-backups.md) +{% endtab %} +{% endtabs %} + +## Welcome to the ION Lightning Network Wiki! + +The Lightning Network is here, and it's delivering **fast, free, and final Bitcoin payments**. ![](.gitbook/assets/ion_wiki_v2.png) -## Welcome to the Ion Wiki! +The number of nodes—and the amount of bitcoin—are increasing daily, and developers are creating new applications to experiment with the network and explore its possibilities. -The Lightning Network needed a wiki yesterday. By creating digestible, reliable, and objective knowledge covering concepts and developments in LN, we can help drive the next wave of innovation and adoption. +But as the resources for building with Lightning proliferate, they are spread across numerous GitHub repositories, Subreddits, Slack and Telegram chats, and Medium articles. -### Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) +ION wiki is a tool for **collecting the best Lightning Network tutorials, references, tools, and apps** in one place. -Want to help us build this nexus of information? Start by reading our [contributing guide](https://github.com/RadarRelay/ionwiki/blob/master/contributing.md), and taking a look at our [GitHub repo](https://github.com/RadarRelay/ionwiki/commits/master). +## [Contributing](wiki-basics/contributing.md) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) -We welcome all contributions. Submit any ideas, bug reports, or organizational changes as [GitHub issues](https://github.com/RadarRelay/ionwiki/issues) and submit content changes as [pull requests](https://github.com/RadarRelay/ionwiki/pulls). +Know something about Lightning? **Share your know-how** and accelerate the rate of LN development. -### Content License +#### [**This wiki lives in GitHub**](wiki-basics/content-license.md) and is Creative Commons licensed! It's your Lightning lab notebook—it's not locked in someone else's database. -We use the **Creative Commons Attribution 4.0 International** license for the Ion wiki. [Take a look at our rationale and view the license here](content-license.md). +Check out the [**top contributors on GitHub**](https://github.com/RadarTech/ionwiki/graphs/contributors) and join the discussion [**on Telegram**](https://t.me/radarion). diff --git a/SUMMARY.md b/SUMMARY.md index f544754..ccea077 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -1,61 +1,104 @@ # Table of contents -* [Welcome](README.md) -* [How To Contribute](contributing.md) -* [How This Content is Licensed](content-license.md) -* [Bitcoin Basics](bitcoin-basics/README.md) - * [Satoshi \(unit of currency\)](bitcoin-basics/satoshi-unit-of-currency.md) - * [Fees](bitcoin-basics/fees.md) - * [Coin Faucets](bitcoin-basics/faucet.md) - * [Digital Signatures](bitcoin-basics/signatures-on-lightning.md) - * [Hash](bitcoin-basics/hash.md) - * [Preimage](bitcoin-basics/pre-image.md) - * [Opcodes](bitcoin-basics/op-codes.md) - * [HTLC](bitcoin-basics/hltc.md) - * [Dust](bitcoin-basics/dust-limit.md) - * [Transaction Malleability](bitcoin-basics/transaction-malleability.md) - * [Bitcoin Address Formats](bitcoin-basics/bitcoin-address-formats.md) - * [Pubkey](bitcoin-basics/pubkey.md) - * [Replace-By-Fee \(RBF\)](bitcoin-basics/replace-by-fee-rbf.md) - * [State Channels](bitcoin-basics/state-channel.md) -* [Lightning Basics](lightning-basics/README.md) - * [What is the Lightning Network?](lightning-basics/lightning-network.md) - * [Basis of Lightning Technology \(BOLT\)](lightning-basics/basics-of-lightning-technology-bolt.md) - * [Onion Routing](lightning-basics/onion-routing.md) - * [Network Capacity](lightning-basics/network-capacity.md) - * [Node](lightning-basics/node.md) - * [Payment Channel](lightning-basics/payment-channel.md) - * [Payment Routing](lightning-basics/payment-routing.md) - * [Gossip](lightning-basics/gossip.md) - * [Hub](lightning-basics/hub.md) - * [Invoice](lightning-basics/invoice.md) - * [Sphinx Packet](lightning-basics/sphinx-packet.md) -* [Lightning Software](lightning-software/README.md) - * [Network Implementations](lightning-software/implementations-of-lightning-network.md) - * [LND](lightning-software/lnd/README.md) - * [Macaroon](lightning-software/lnd/macaroon.md) - * [c-lightning](lightning-software/c-lightning.md) - * [Eclair](lightning-software/eclair.md) - * [Rust Lightning](lightning-software/rust-lightning.md) - * [Wallet](lightning-software/wallet/README.md) - * [Eclair](lightning-software/wallet/eclair.md) - * [Shango](lightning-software/wallet/shango.md) - * [Zap Desktop](lightning-software/wallet/zap-desktop.md) -* [Lightning Channels](lightning-channels/README.md) - * [Channel Capacity](lightning-channels/channel-capacity.md) - * [Opening A Channel](lightning-channels/channel-opening.md) - * [Closing A Channel](lightning-channels/channel-closing.md) - * [Channel Backup](lightning-channels/channel-backups.md) -* [Troubleshooting](troubleshooting/README.md) - * [Payment failures](troubleshooting/payment-failures.md) - * [Error codes](troubleshooting/error-codes.md) - * [Theft \(on Lightning Network\)](troubleshooting/theft-on-lightning-network.md) -* [Lightning R&D](lightning-r-and-d/README.md) - * [Lightning Appliance](lightning-r-and-d/lightning-appliance.md) - * [Submarine Swap](lightning-r-and-d/submarine-swap.md) - * [Watchtowers](lightning-r-and-d/watchtower.md) - * [Channel Factories](lightning-r-and-d/channel-factory.md) - * [Eltoo](lightning-r-and-d/eltoo.md) - * [Scriptless Scripts \(Schnorr\)](lightning-r-and-d/scriptless-scripts-schnorr.md) - * [Privacy \(on Lightning Network\)](lightning-r-and-d/privacy-on-lightning-network.md) +* [⚡Welcome to our Lightning Wiki⚡](README.md) + +## Wiki Basics + +* [How To Contribute](wiki-basics/contributing.md) +* [Platform & Content License](wiki-basics/content-license.md) + +## Events + +* [Boltathon LN Hackathon](events/boltathon/README.md) + * [TipHub](events/boltathon/tiphub.md) + * [Lightning Poll](events/boltathon/lightning-poll.md) + * [Local Lightning](events/boltathon/local-lightning.md) + * [Lightning Mapper](events/boltathon/lightning-mapper.md) + * [Somebody Make This!](events/boltathon/somebody-make-this.md) + * [Bolt Action](events/boltathon/bolt-action.md) + +## Tutorials + +* [Bootstrapping Liquidity](tutorials/bootstrapping-liquidity.md) +* [Nodes To Connect To](tutorials/routing-nodes.md) +* [Lightning Exchanges](tutorials/lightning-exchanges.md) +* [Lightning Stores](tutorials/stores.md) +* [Lightning Apps](tutorials/apps/README.md) + * [Spacebit Satellite Client](tutorials/apps/spacebit-satellite-client.md) + * [Lightning Pizza Walkthrough](tutorials/apps/lightning-pizza-walkthrough.md) + * [Lightning Torch](tutorials/apps/lightning-torch.md) + * [Tipping Sites](tutorials/apps/tipping-sites.md) +* [Lightning Wallets](tutorials/wallets/README.md) + * [Zap Desktop](tutorials/wallets/zap-desktop.md) + * [Eclair Mobile](tutorials/wallets/eclair-mobile.md) + * [Shango](tutorials/wallets/shango.md) +* [Lightning Node Setup](tutorials/nodes/README.md) + * [Lightning at Home](tutorials/nodes/lighting-at-home.md) + * [BTCPay Server + AWS EC2](tutorials/nodes/btcpay-+-aws-ec2.md) + * [Cyphernode](tutorials/nodes/cyphernode.md) + * [ION Drive](tutorials/nodes/ion-drive.md) + * [LND](tutorials/nodes/lnd.md) + * [c-lightning](tutorials/nodes/c-lightning.md) + * [Eclair](tutorials/nodes/eclair.md) + * [Rust Lightning](tutorials/nodes/rust-lightning.md) + * [Lightning with Tor](tutorials/nodes/tor.md) +* [Altcoin Lightning](tutorials/altcoin/README.md) + * [Bitcoin Testnet LN](tutorials/altcoin/bitcoin-testnet-ln.md) + * [Litecoin LN](tutorials/altcoin/litecoin.md) + * [Decred LN](tutorials/altcoin/decred.md) +* [Troubleshooting](tutorials/troubleshooting/README.md) + * [Public Nodes](tutorials/troubleshooting/public-nodes.md) + * [Payment failures](tutorials/troubleshooting/payment-failures.md) + * [Error codes](tutorials/troubleshooting/error-codes.md) + * [Theft \(on Lightning Network\)](tutorials/troubleshooting/theft-on-lightning-network.md) + * [Static Channel Backup](tutorials/troubleshooting/static-channel-backups.md) + +## Lightning Technology + +* [Bitcoin Basics](tech/bitcoin/README.md) + * [Satoshi \(unit of currency\)](tech/bitcoin/satoshi-unit-of-currency.md) + * [Fees](tech/bitcoin/fees.md) + * [Coin Faucets](tech/bitcoin/faucet.md) + * [Digital Signatures](tech/bitcoin/signatures-on-lightning.md) + * [Hash](tech/bitcoin/hash.md) + * [Preimage](tech/bitcoin/pre-image.md) + * [Opcodes](tech/bitcoin/op-codes.md) + * [HTLC](tech/bitcoin/hltc.md) + * [Dust](tech/bitcoin/dust-limit.md) + * [Transaction Malleability](tech/bitcoin/transaction-malleability.md) + * [Bitcoin Address Formats](tech/bitcoin/bitcoin-address-formats.md) + * [Pubkey](tech/bitcoin/pubkey.md) + * [Replace-By-Fee \(RBF\)](tech/bitcoin/replace-by-fee-rbf.md) + * [State Channels](tech/bitcoin/state-channel.md) +* [Lightning Basics](tech/lightning/README.md) + * [What is the Lightning Network?](tech/lightning/lightning-network.md) + * [Basis of Lightning Technology \(BOLT\)](tech/lightning/basics-of-lightning-technology-bolt.md) + * [Onion Routing](tech/lightning/onion-routing.md) + * [Network Capacity](tech/lightning/network-capacity.md) + * [Node](tech/lightning/node.md) + * [Payment Channel](tech/lightning/payment-channel.md) + * [Payment Routing](tech/lightning/payment-routing.md) + * [Gossip](tech/lightning/gossip.md) + * [Hub](tech/lightning/hub.md) + * [Lightning Invoice](tech/lightning/invoice.md) + * [Sphinx Packet](tech/lightning/sphinx-packet.md) +* [Lightning Channels](tech/channels/README.md) + * [Channel Capacity](tech/channels/channel-capacity.md) + * [Opening A Channel](tech/channels/channel-opening.md) + * [Closing A Channel](tech/channels/channel-closing.md) + * [Channel Backup](tech/channels/channel-backups.md) +* [Research and Development](tech/research/README.md) + * [Key Send](tech/research/sphinx-send.md) + * [Hold Invoices](tech/research/hodl-invoice.md) + * [Watchtowers](tech/research/watchtowers.md) + * [Privacy](tech/research/privacy.md) + * [Macaroons](tech/research/macaroons.md) + * [Submarine Swap](tech/research/submarine-swap.md) + * [Lightning Appliances](tech/research/lightning-appliance.md) + * [Channel Factories](tech/research/channel-factory.md) + * [Scriptless Scripts](tech/research/scriptless-scripts-schnorr.md) + * [Hardware Wallets](tech/research/hardware-wallets.md) + * [Atomic Multi-Path Payments](tech/research/atomic-multi-path-payments.md) + * [Eltoo](tech/research/eltoo.md) +* [Lightning News Sources](tech/news.md) diff --git a/bitcoin-basics/hash.md b/bitcoin-basics/hash.md deleted file mode 100644 index 7d0108e..0000000 --- a/bitcoin-basics/hash.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -latest-revision: '2019-01-27T00:00:00.000Z' -original-author: Ryan Shea (ryan-shea) -created: '2019-01-01T00:00:00.000Z' -status: Accepted -title: Hash -contributors: Ryan Shea (ryan-shea); Gareth James (gjradar) -type: article -description: '' -discussions-to: GitHub URL -category: bitcoin-basics ---- - -# Hash - -## Overview - -A hash algorithm turns an arbitrary amount of data into a fixed-length **hash**. A hash is a fingerprint of the input data, and the same fingerprint can always be produced from the same input data. Hashes are essential to cryptographic functions not only on Bitcoin but also on the Lightning Network. - -## Details - -### Bitcoin Hashes - -Cryptographic hash functions are used extensively in Bitcoin: in bitcoin addresses, in script addresses, and in the mining Proof-of-Work algorithm. Bitcoin uses the SHA-256 algorithm to generate hashes. - -### Private and Public Keys - -![Image from Mastering Bitcoin](../.gitbook/assets/screen-shot-2019-01-24-at-8.46.37-am.png) - -In private and public key cryptography, a one-way cryptographic hash function is used to generate a bitcoin address. - -## Resources - -[SHA-256 Hash Generator](https://www.movable-type.co.uk/scripts/sha256.html) - -## References - -\[1\] [https://en.bitcoin.it/wiki/Hash](https://en.bitcoin.it/wiki/Hash) - -\[2\] [https://en.wikipedia.org/wiki/Cryptographic\_hash\_function](https://en.wikipedia.org/wiki/Cryptographic_hash_function) - diff --git a/content-license.md b/content-license.md deleted file mode 100644 index c03ec82..0000000 --- a/content-license.md +++ /dev/null @@ -1,14 +0,0 @@ -# How This Content is Licensed - -The Ion Wiki uses the **CC-BY-4.0** license to govern our content. Our main priority is to preserve the rights of individuals outside Radar that choose to contribute -- acknowledging their time investment and effort in contributing to such a far-reaching project. - -We also want to prevent the use of the wiki name in a fashion that is not consistent with its branding. - -Both of these priorities are best incarnated in the CC-BY license, outlined by [Creative Commons](https://creativecommons.org/). - -You can read the license below: - -{% hint style="info" %} -[Link to GitHub](https://github.com/RadarRelay/ionwiki/blob/master/LICENSE) -{% endhint %} - diff --git a/contributing.md b/contributing.md deleted file mode 100644 index 10e24c2..0000000 --- a/contributing.md +++ /dev/null @@ -1,92 +0,0 @@ -# How To Contribute - -## Introduction - -Thank you for considering contributing to the Ion Wiki. It's people like you that will pave the way for the next wave of Lightning developers and enthusiasts. - -Following these guidelines helps to establish a standard for high quality, useful content that will last for years to come. Establishing a nexus of information for the Lightning Network is needed; we're all here to make that happen in an organized, high quality way. - -### What type of contributions we're looking for - -Ion is an open source project and we love to receive contributions from our community! - -We're looking for support in the following areas: - -* Content creation -* Proofreading -* Improving stub articles -* Content research and roadmapping - -# [Click here to get started.](https://github.com/RadarTech/ionwiki/tree/master/.contributing/starthere.md) - -## Your First Contribution - -Unsure where to start? You can start by looking through these beginner and help-wanted issues: - -* [Beginner issues - issues which are great to start with](https://github.com/RadarRelay/ionwiki/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) -* [Help wanted issues - issues which should be a bit more involved than beginner issues.](https://github.com/RadarRelay/ionwiki/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) - -### Never contributed to open source before? - -Check out the following resources to get you started. It's way easier than it looks. - -* [A Guide to Open Source](https://opensource.guide/) -* [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github) -* [How to Make a Pull Request](http://makeapullrequest.com/) - -At this point, you're ready to make your changes! Feel free to ask for help; everyone is a beginner at first. - -## Getting started - -#### How to submit a contribution on GitHub - -Start by forking the Ion Wiki repo. From there, either: - -1. Create an article using the [template](https://github.com/RadarRelay/ionwiki/blob/master/template.md) in the root directory -2. Edit or revise existing articles -3. Move and restructure content - -As a rule of thumb, changes are obvious fixes if they do not introduce any new pages or structural organization. Some likely examples include the following: - -* Spelling / grammar fixes -* Typo correction, white space and formatting changes -* Comment clean up -* Adding notes in raw files for future contributors -* Changes to organizational files like Issue Templates, Contribution Guide, Table of Contents, etc. -* Moving files from one directory to another, restructuring page flow and organization - -After committing your changes, make a PR to the main repo and briefly describe your changes. - -#### How to contribute via GitBook - -Since we're using GitBook to manage our wiki, you can also submit content through the Gitbook GUI. - -Start by: - -1. Creating an account on GitBook -2. Opening a new draft and editing content in the draft -3. Saving the draft on GitBook with naming conventions - -We will be reviewing GitBook contributions with the same pipeline as GitHub contributions. Discussions will be posted in issue threads and PR discussions. - -#### Suggestion process - -If you find yourself searching for content that doesn't exist in the Ion Wiki, you're probably not alone. There are bound to be others out there with similar needs. Open an issue on GitHub describing the content you'd like to see, and we'll get on it in our next sprint. - -## Review process - -The core contributing team looks at Pull Requests on a regular basis and discusses content decisions in a weekly triage meeting that we hold in a public Google Hangout. The hangout is announced in the weekly status updates sent in the Ion Wiki developer chat. - -After feedback has been given, we anticipate responses within two weeks. After two weeks, we may close the pull request if it isn't showing any activity. If no feedback is needed, we'll merge the PR and credit you accordingly. - -For non-trivial contributions, pull requests should sit for at least 36 hours to ensure that contributors in other timezones have time to review. Consideration should also be given to weekends and other holiday periods to ensure active committers all have reasonable time to become involved in the discussion and review process if they wish. - -The default for each contribution is that it is accepted once no committer has an objection. During review committers may also request that a specific contributor who is most versed in a particular area takes a look before the PR can be merged. There is no additional "sign off" process for contributions to land. Once all issues brought by committers are addressed it can be landed by any committer. - -In the case of an objection being raised in a pull request by another committer, all involved committers should seek to arrive at a consensus by way of addressing concerns being expressed by discussion, compromise on the proposed change, or withdrawal of the proposed change. - -If a contribution is controversial and committers cannot agree about how to get it to land or if it should land then it will be escalated to the Ion Core team. Ion members will regularly discuss pending contributions in order to find a resolution. It is expected that only a small minority of issues be brought to the Ion Core team for resolution and that discussion and compromise among committers be the default resolution mechanism. - -## Outreach - -Have content or other suggestions, but aren't a fan of GitHub? You can reach us directly at outreach@ion.radar.tech. diff --git a/events/boltathon/README.md b/events/boltathon/README.md new file mode 100644 index 0000000..dc40949 --- /dev/null +++ b/events/boltathon/README.md @@ -0,0 +1,6 @@ +# Boltathon LN Hackathon + +{% embed url="https://boltathon.com/" %} + +\*\*\*\*[**Radar ION**](https://ion.radar.tech) was a sponsor of the 2019 Boltathon, the first virtual Lightning Network hackathon. In this page, you will find interviews with the Boltathon projects, links to speaker slides, and more! + diff --git a/events/boltathon/bolt-action.md b/events/boltathon/bolt-action.md new file mode 100644 index 0000000..5072b5f --- /dev/null +++ b/events/boltathon/bolt-action.md @@ -0,0 +1,29 @@ +# Bolt Action + +![Bolt Action is part of ShockWallet ](../../.gitbook/assets/logo.png) + + +**What inspired you to build Bolt Action?** + +I got inspired to start building on Lightning after experimenting with it early on, it seemed obvious to me that it will eventually be integrated into our lives like most other web protocols. The internet of money has found its HTTPS in my opinion. + +**In three sentences or less, tell us about your project.** + +Bolt Action was intended to be a concept demo showing how a lightning node could seamlessly fit into a social network. The name is a pun, Bolt of course for lightning, Bolt Action inferring a GUN. GUN is a decentralized database I'm using to build a social layer for lightning. + +**How did you build Bolt Action?** + +I ended up only having a few hours to devote to the hackathon, so I scratched out an agent in NodeJS and a view in React. + +**What are your plans for the project post hackathon?** + +I'm ultimately working on ShockWallet, which will integrate GUN and a number of social/commerce features it enables in a decentralized and trust-less way. \([http://shock.network](http://shock.network/)\) + +**What daemon features are you most excited about?** + +Atomic Multipath Payments, I think that will have a really large impact on UX that enables increased adoption. + + **What projects are you most excited about this next year?** + +The progress on the chain and lightning daemons aside, there are some potentially disruptive applications out there centered around lightning, such as SuredBits using it for monetizing API calls, to Koala Studios and Donner Lab adding a whole new element to the gaming scene. ShockWallet should be pretty cool too :\) + diff --git a/events/boltathon/lightning-mapper.md b/events/boltathon/lightning-mapper.md new file mode 100644 index 0000000..8c322b5 --- /dev/null +++ b/events/boltathon/lightning-mapper.md @@ -0,0 +1,34 @@ +# Lightning Mapper + +**What inspired you to build Lightning Mapper?** + +My main motivation was to take advantage of the learning environment that hackathons provide. I decided to build Lightning Mapper because of my background in geographic information systems. I had recently been using the mobile app "MapSwipe", where users volunteer their time to indicate whether or not certain features exist in portions of satellite images. When I saw the theme was "social good", I decided to implement a similar model to MapSwipe in the browser using Lightning payments to incentivize users. + +**In three sentences or less, tell us about your project.** + +In Lightning Mapper, users are paid to view satellite imagery and digitize features, such as roads and buildings, by drawing over them in the map. The digitized features can be used to help humanitarian groups locate people in need. Users can withdraw their earnings via Lightning Network at any time. + +**How did you build Lightning Mapper?** + +I built Lightning Mapper using a combination of open source tools: Blockstack Auth for authentication, Leaflet.js for mapping, NodeJS for webserver, Python and c-lightning for processing Lightning invoices and payments. + +**What were the biggest development challenges?** + +My background is not in software development, so learning to piece the different components together was challenging. + +**What operational challenges have you run into since launch?** + +Finding the time to finish the project. + +**What are your plans for the project post hackathon?** + +Unfortunately I wont be able to spend a lot of time working on Lightning Mapper in the near future, so I plan to shelve it for a bit. I will eventually finish and publish the source code, and potentially do a public launch if there is demand. + +**What projects are you most excited about this next year?** + +I'm most excited for the continuing work on the Lightning protocol itself as well as the major implementations. It's very important for these to be working well to have a healthy Lightning Network, and there is some exciting development coming in the next year! + +**Where can we find code or working application of your project?** + +Unfortunately it isn't ready to be released yet. When I do release it, I will be announcing it [on my Twitter account @billy\_btc](https://twitter.com/billy_btc). + diff --git a/events/boltathon/lightning-poll.md b/events/boltathon/lightning-poll.md new file mode 100644 index 0000000..ecc9e68 --- /dev/null +++ b/events/boltathon/lightning-poll.md @@ -0,0 +1,34 @@ +# Lightning Poll + +![Lightning Poll screenshot from Carla's "Hacking HODL Invoice" Medium Post](../../.gitbook/assets/lightningpoll.png) + +**What inspired you to build Lightning Poll?** + +I think that the Lightning Network is fascinating because it addresses some of the pain points associated with on chain transactions, without compromising the trustless nature of Bitcoin. The most apparent strength of the Lightning Network is micropayments, as many of the projects at Boltathon illustrated. I have been following the HODL invoices pull request for a while, because I think that the ease of refund they provide is another significant on chain pain point which lightning addresses. Pairing micropayments and easy refunds is exciting to me because it opens up possibilities which were previously unfeasible, and I wanted to explore ways in which this functionality could be used. + +**In three sentences or less, tell us about your project.** + +Lightning poll is a twist on the traditional votes-for-sats concept. Users can create polls with a refund strategy which refunds a certain set of users depending on the outcome of the vote. The hackathon theme was "hack social interaction", which lightning poll aligns with in the use case where content producers ask their followers what content they would like to see next, earn some sats from the majority vote and refund the voters whose choice doesn't get produced. + +**How did you build Lightning Poll?** + +Lightning poll is written in Golang, using a web framework called Gin and GOnic. I built LND with the HODL invoices tag, and used it to create refundable invoices for votes. I decided against using traditional login, because it is an annoying barrier when you're doing something as simple as creating a poll. Instead, a zero invoice \(which can be settled with any amount\) is required to create a poll, because we do not know how much will be paid out to the creator until after the poll is closed and users are refunded. + +**What were the biggest development challenges?** + +HODL invoices in LND are a new feature, and do not fit into the existing API. I assumed that they would be, and ended up having to backtrack a fair amount when I realised that they use a separate, and differently setup, set of endpoints. + +**What are your plans for the project post hackathon?** + +I am planning on launching lightning poll on mainnet. I have synced up a bitcoind and LND node, so just need to find the time to un-hack some of the more hacakthon-esque parts of lightning poll's code and then it will be up and running. + +**What daemon features are you most excited about?** + +I'm pretty excited for AMP, because I think it will really improve routing of bigger payments. Conner Fromknecht's Botlathon talk about watchtowers was also very exciting, because it opens up opportunities for mobile lightning apps, which I think are going to be a big part of driving the success of lightning. + +**What projects are you most excited about this next year?** + +I have been accepted into the Chaincode Bitcoin and Lightning Summer Residency, where we will have the opportunity to work on mentored projects contributing to Bitcoin Core or LND. I am going to look into extracting the signer interface from LND so that your private keys can sit separately from your LND node, which I am very excited about. + +**Hacking HODL invoices at \#Bothathon 2019** [https://medium.com/@kirkcohenc/hacking-hodl-invoices-at-bothathon-2019-7c540ccfa1ee](https://medium.com/@kirkcohenc/hacking-hodl-invoices-at-bothathon-2019-7c540ccfa1ee) + diff --git a/events/boltathon/local-lightning.md b/events/boltathon/local-lightning.md new file mode 100644 index 0000000..114f6ba --- /dev/null +++ b/events/boltathon/local-lightning.md @@ -0,0 +1,46 @@ +# Local Lightning + +![Locallightning.net](../../.gitbook/assets/local-lightning.png) + +**What inspired your team to work on Local Lightning?** + +At the time of the hackathon, I wasn't sure what to build. I spent a couple hours after hearing the "Social Good" prompt just brainstorming ideas and speaking to a few friends about it. Patrick Stanley from Blockstack had actually sent me a Blockstack post about a list of applications that could be built on Blockstack and one of the first ones was a decentralized Local Bitcoins. As soon as I saw that, I knew it was what I had to do. I already have some experience building a P2P decentralized application on Blockstack, so I knew a simple MVP of Local Lightning would work out well and definitely has a real-world use case, which mattered a lot to me. I'm all about marketplace freedom, which unfortunately with Local Bitcoins and with many crypto projects implementing KYC, is needed more and more each day. + +**In three sentences or less, tell us about your project.** + +Local Lightning is a website designed to get local sellers and buyers of bitcoin interacting with each other on the Lightning Network. By focusing on sellers/buyers interacting via the Lightning Network, what we'll see is quick engagements that end as soon as cash changes hands and the Lightning payment button is clicked. Instantly verifiable, \(near\) fee-less transactions with no need for escrows or waiting 10-60 minutes for block confirmations. + +**How did you build Local Lightning?** + +I built Local Lightning on top of Blockstack \(which allows for decentralized logins and data ownership for users\) and Lightning Charge. Lightning Charge made it easy to accept and query invoices via my own c-lightning node. For the hackathon, I made it a simple skeleton VueJS application, but have since put a lot of design effort into it to make it pretty. + +**What were the biggest development challenges?** + +The biggest challenge wasn't so much the development at all, but the interactions with Lightning tools. When I was trying to implement WebLN \(a web standard for browser plugin lightning payments\), I had a hard time finding things that supported c-lightning. Seems like a lot of tools/wallets in this space support LND instead of c-lightning. I was about to give up on trying to implement WebLN until fiatjaf \(another hackathon participant\) pointed out that he made a c-lightning WebLN compliant plugin \(kWh\), which worked out really well. + +**What operational challenges have you run into since launch?** + +I've never been the strongest at design and frontend in general, but I'd have to say that Lighting Channel management has been pretty challenging since launching. Luckily, with BTCPayServer, setting up a production level Lightning Node was easy, but since I am using c-lightning instead of LND, I miss out on a lot of channel management features like Loop Out. I have some ideas to bring more liquidity channels to my Lightning Node, without relying on people to open channels with me directly \(though there have been a couple kind souls that have already!\), but in general it hasn't as easy to deal with so far. + +**What are your plans for the project post hackathon?** + +The first plan was to design and launch, which I'm super excited that I was able to do so! Moving forward though, I hope to add possible core features such as messaging, review systems, and maybe even basic wallet support for connecting to your own nodes in app. Besides that, I hope to integrate with the community and provide an app and features that people want to use. + + +**What daemon features are you most excited about?** + +It just technically launched, but I'm really excited to try out Loop Out with LND. My home node is using LND, so I planned on upgrading soon to try it out. Besides that, I wanted to look into what plugins exist for c-lightning and what might come soon there as well. + + +**What projects are you most excited about this next year?** + +I'm really excited about the idea of submarine swap exchanges with lightning. I recently found out about SparkSwap and their Lightning exchange, so I'm looking forward to seeing it grow and using it. + + +**Where can we find code or working application of your project?** + +Website: [https://www.locallightning.net](https://www.locallightning.net) + +Github: [https://github.com/AnthonyRonning/Local-Lightning](https://github.com/AnthonyRonning/Local-Lightning) + + diff --git a/events/boltathon/somebody-make-this.md b/events/boltathon/somebody-make-this.md new file mode 100644 index 0000000..3adf9c3 --- /dev/null +++ b/events/boltathon/somebody-make-this.md @@ -0,0 +1,30 @@ +# Somebody Make This! + +**What inspired you to build Somebody Make This!** + +It was something I've wanted to do for some time, because I had some ideas and, mostly for Lightning-powered apps, and wanted to see them done. If more people shared my judgement that these were interesting ideas then it would be an incentive for builders everywhere, including myself. I then expanded this idea to a broader scope, but I think it just remains the same. + +**How did you build Somebody Make This!?** + +I wrote a "smart contract" on [https://etleneum.com/](https://etleneum.com/) with some lines of Lua, wrote some tests for it, then begin writing a purely-client side interface to it with JavaScript. + +**What were the biggest development challenges?** + +The time. I didn't have much time to work on it on that specific weekend, I spent all the time I could, but it wasn't enough. + +**What operational challenges have you run into since launch?** + +I didn't work on it since the hackathon. It needs quite a bit to be presentable. I spent too much of my brain on it during that weekend so I had to take a break. Only now I'm starting to think about it again. + +**What are your plans for the project post hackathon?** + +I'll finish the JavaScript interface and see if the community likes it. + +**What projects are you most excited about this next year?** + +I'm actually expecting Bitcoin to get mainstream interest again with new high prices or financial turmoils in the real world, hoping that will bring more people to the Lightning economy. + +**Where can we find code or working application of your project?** + +The "backend" code is at [https://etleneum.com/contract/94aj7mkrk](https://etleneum.com/contract/94aj7mkrk), the frontend will be published anytime soon. + diff --git a/events/boltathon/tiphub.md b/events/boltathon/tiphub.md new file mode 100644 index 0000000..c8bfb3a --- /dev/null +++ b/events/boltathon/tiphub.md @@ -0,0 +1,47 @@ +# TipHub + +![Tiphub.io](../../.gitbook/assets/tiphub.png) + +![TipHub UI](../../.gitbook/assets/tiphubui.png) + +**What inspired you and Carl to build TipHub?** + +We've both been really interested in alternative funding models for open source work. Maintaining open source projects has never been a lucrative endeavor in its own right, but the value of incentivizing it can't be understated. The majority of code today is written on top of open source languages, frameworks, and operating systems, and we need to continue to encourage people to keep contributing and maintaining. While we don't expect TipHub \(or any tip-based funding\) to completely solve the problem, a little bit of money and a nice message can sometimes be enough to keep someone passionate about working on their project. + +**In three sentences or less, tell us about your project.** + +TipHub is a non-custodial tipping service for open source projects. We make it easy to setup a tip button right in your project's readme to let users and other developers show some love to your project. Unlike most other Lightning tipping services, we facilitate a direct connection to developer's nodes. + + +**How did you build TipHub?** + +Our stack is a python backend using Flask and SQLAlchemy with a Postgres database, and a frontend written in Typescript using React and the Semantic UI component library. Carl focused on the backend and Lightning RPC layer, while I focused on the API and frontend. It's currently hosted on Heroku. + + +**What were the biggest development challenges?** + +Lightning developer libraries are still pretty early and sparse. The choice of Python for the backend was just something we were familiar with, but in general we found that the libraries available around Lightning, and Python and Flask's less-than-stellar handling of threading or asynchronous code made it less easy than we'd hoped. I won't speak for Carl on this, but personally I've found the Javascript \(better yet, Typescript\) tooling to be a little stronger so far, and its async-first approach to code makes working with sockets to the Lightning node and client a much better developer experience overall. + +**What operational challenges have you run into since launch** + +We haven't launched quite yet, and one of the things holding us back is making absolutely sure we handle all of the issues that can occur with accounting for tipping. While we're safe in the fact that users can never "lose" money since it's a direct tip to the developer's node with no intermediary, we want to make sure that it all gets logged correctly \(Since we record and notify when tips are made,\) or lets them know if something has gone wrong \(e.g. if their node is offline.\) + +**What are your plans for the project post hackathon?** + +The plan is to go live sometime in the next few weeks! As noted above, we want to be ready for everything that can go wrong with Lightning, and clean up some of our hackathon sins that made it in in the final hours. We've also got a handful of features planned such as on-chain fallback addresses for non-lightning users or those who want to make larger tips, and an embeddable leaderboard to show your project's highest tippers. Here's what that'd look like: + + +![](../../.gitbook/assets/image.png) + +![](blob:https://mail.superhuman.com/d4c9a341-64b7-4f45-9d19-546fef870f97) + + + +**What daemon features are you most excited about?** + +There are too many to go over, so I'll just pick one: The macaroon "bakery." LND provides you with auth tokens that have different levels of access called macaroons. It works similarly to oauth, giving external applications limited functionality. That's how TipHub is able to generate invoices for your node, without having access to do things such as make payments from your node, keeping your funds secure. The idea of the macaroon bakery would be a programmatic way of generating these macaroons. So one cool example of how this could work in the future is that you generate a macaroon that is only allowed to send a limited number of satoshis per month. Provide that macaroon to an external service, and now they can pull a monthly subscription directly from your node, that you can revoke at any time. + +**What projects are you most excited about this next year?** + +Lightning is moving so fast, it's hard to see what's coming beyond a few weeks. But stabilizing mainnet neutrino nodes to allow for easier setup is going to make Lightning absolutely explode, so I'm excited to onboard all of those new users. Likewise, so far most of what we've seen with Lightning have been built by solo enthusiasts, so I'm looking forward to what larger teams with will be able to put together once there's a much larger audience to attract them to building on Lightning. And hopefully, more hackathons like the Boltathon! + diff --git a/lightning-channels/channel-closing.md b/lightning-channels/channel-closing.md deleted file mode 100644 index b1ee04c..0000000 --- a/lightning-channels/channel-closing.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -latest-revision: '2019-01-27T00:00:00.000Z' -original-author: Ryan Shea (ryan-shea) -created: '2019-01-01T00:00:00.000Z' -status: Accepted -title: Channel Closing -contributors: Ryan Shea (ryan-shea); Gareth James (gjradar) -type: article -description: '' -discussions-to: GitHub URL -category: lightning-channels ---- - -# Closing A Channel - -## Overview - -To **close** an established channel on the Lightning Network, a closing transaction must be initiated. On top of a normal mutual close, there are other ways to close a channel. - -## Details - -### Cooperative Close - -In a mutual close, both channel participants agree to a cooperative close, where final channel amounts are settled on-chain. Both participants sign a digital signature that then authorizes the on chain settlement transaction. - -Both parties are able to send as many payments to their counterparty as they wish, as long as they have funds available in the channel, knowing that in the event of disagreements they can broadcast to the blockchain the current state at any time. In the vast majority of cases, all the outputs from the Funding Transaction will never be broadcast on the blockchain. They are just there in case the other party is non-cooperative, much like how a contract is rarely enforced in the courts. A proven ability for the contract to be enforced in a deterministic manner is sufficient incentive for both parties to act honestly. When either party wishes to close out a channel cooperatively, they will be able to do so by contacting the other party and spending from the Funding Transaction with an output of the most current Commitment Transaction directly with no script encumbering conditions. No further payments may occur in the channel. - -### Unilateral Close - -In an uncooperative close of a channel, a peer broadcasts a commitment transaction. - -### Revoked Transaction Close - -An invalid close of a channel, accomplished by broadcasting a revoked commitment transaction. Since the other peer knows the commitment revocation secret key, it can create a penalty transaction. - -### Penalty Transaction - -A transaction that spends all outputs of a revoked commitment transaction, using the commitment revocation private key. A peer uses this if the other peer tries to "cheat" by broadcasting a revoked commitment transaction. - -## Resources - -[BOLT \#0, Introduction and Index](https://github.com/lightningnetwork/lightning-rfc/blob/master/00-introduction.md) - -## References - -\[1\] [https://github.com/lightningnetwork/lightning-rfc/blob/master/00-introduction.md](https://github.com/lightningnetwork/lightning-rfc/blob/master/00-introduction.md) - diff --git a/lightning-r-and-d/README.md b/lightning-r-and-d/README.md deleted file mode 100644 index 5a29f0b..0000000 --- a/lightning-r-and-d/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Lightning R&D - diff --git a/lightning-r-and-d/privacy-on-lightning-network.md b/lightning-r-and-d/privacy-on-lightning-network.md deleted file mode 100644 index 1388fe9..0000000 --- a/lightning-r-and-d/privacy-on-lightning-network.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -latest-revision: '2019-01-27T00:00:00.000Z' -original-author: Ryan Shea (ryan-shea) -created: '2019-01-01T00:00:00.000Z' -status: Accepted -title: Privacy (on Lightning Network) -contributors: Ryan Shea (ryan-shea) -type: article -description: '' -discussions-to: GitHub URL -category: lightning-rnd ---- - -# Privacy \(on Lightning Network\) - -## Overview - -While there is no public, trackable ledger of Lightning transactions, **privacy** \_\_on Lightning is still a work in progress. Through techniques like [onion routing](../lightning-basics/onion-routing.md) and [eltoo](eltoo.md), privacy is improving. - -## Details - -### Implementation of Sphinx - -The current Lightning Network specification includes a solution to mask routing data from all intermediaries, based on [Sphinx](../lightning-basics/sphinx-packet.md). - -On Lightning, the payer determines a path over the peer-to-peer network and wraps a payment package in layers of encryption. Apart from just relay information, each intermediary also unpacks some additional data. This includes amounts, fees and more, along with allowing all intermediaries to set up a step in the payment chain. - -Importantly, all intermediaries only learn from which channel they receive tokens, and to which channel they must forward the payment. The intermediaries have no idea whether they are the first step in the chain, the last step, a step somewhere in the middle, or perhaps even the only step. Whoever originally sent the transaction, and the one who ultimately receives it, remain known to only the sender and the receiver. - -## Resources - -[Will Lightning Help or Hurt Bitcoin Privacy?](https://www.coindesk.com/will-lightning-help-hurt-bitcoin-privacy) - -## References - -\[1\] [https://medium.com/@rusty\_lightning/the-bitcoin-lightning-spec-part-5-8-onion-routing-protocol-86c91e455909](https://medium.com/@rusty_lightning/the-bitcoin-lightning-spec-part-5-8-onion-routing-protocol-86c91e455909) - -\[2\] [https://bitcoinmagazine.com/articles/how-the-lightning-network-layers-privacy-on-top-of-bitcoin-1482183775/](https://bitcoinmagazine.com/articles/how-the-lightning-network-layers-privacy-on-top-of-bitcoin-1482183775/) - diff --git a/lightning-r-and-d/submarine-swap.md b/lightning-r-and-d/submarine-swap.md deleted file mode 100644 index 2cfa428..0000000 --- a/lightning-r-and-d/submarine-swap.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -latest-revision: '2019-01-27T00:00:00.000Z' -original-author: Ryan Shea (ryan-shea) -created: '2019-01-01T00:00:00.000Z' -status: Accepted -title: Submarine Swap -contributors: Ryan Shea (ryan-shea) -type: article -description: '' -discussions-to: GitHub URL -category: lightning-rnd ---- - -# Submarine Swap - -## Overview - -Submarine Swaps are atomic on-chain to off-chain conditional swaps \(and vice versa\) of cryptocurrencies. - -This was made possible \(and put into production\) by Alex Bosworth, who named it a "Submarine Swap" \(one half is above water \[on-chain\], one half is below water \[off-chain\]\). - -## Details - -### Problem - -Transactions between on-chain blockchain addresses and off-chain Lightning addresses are not directly compatible. This creates a transaction barrier between the underlying blockchain and the off-chain Lightning Network, regardless of implementation. - -Submarine swaps solve this issue by enabling Lightning channels to be refilled via an on-chain transfer from the underlying blockchain to the off-chain LN channel. - -### Structure - -A submarine swap essentially looks like this: - -1. Alice produces or retrieves a Lightning Network payment invoice. _It doesn't matter whether the Lightning payment is to Alice or to someone else that Alice is trying to pay_. -2. Alice presents the Lightning invoice to Bob, a "submarine swap provider". -3. Bob quotes what he must be paid _on chain_ in order to pay the Lightning invoice _off-chain_. -4. If Alice accepts the exchange rate, Bob and Alice work together and construct an HTLC that creates a conditional **on-chain** payment to Bob. -5. Alice makes the conditional payment to Bob. -6. The conditional payment to Bob is hashlocked with the same secret that will be revealed if the Lightning invoice is paid. Bob can only redeem the conditional payment from Alice by making the Lightning payment. -7. Bob pays the Lightning invoice, forcing the Lightning payment recipient to reveal the secret S. -8. Bob uses the secret S to redeem the conditional payment from Alice. - -If Bob does not pay the Lightning invoice before it expires, Bob is not able to redeem the conditional payment from Alice. In this case, Alice can wait for the HTLC to expire, then redeem the conditional payment's funds back to herself. - -What do submarine swaps allow you to do? - -* _trustlessly_ pay someone on-chain to perform an off-chain payment for you -* _trustlessly_ pay someone on-chain to buy coins on the Lightning Network from them - -This means that a user can make Lightning Network payments without being on the Lightning Network, rebalance their Lightning Network channels with a fast and low-cost payment on another chain, and perform fast trustless swaps where the usual slow step is made instant. - -Submarine conditional swaps have been demonstrated on the Bitcoin and Litecoin Lightning Networks, using on-chain payments on Bitcoin, Litecoin, and BCH. They should also be possible \(albeit with more steps\) using on-chain payments on other Bitcoin derivatives, Ethereum, Stellar, Ripple, and more. - -## Resources - -[Submarine Swaps](https://submarineswaps.org) - -### Key People - -* [Alex Bosworth](https://twitter.com/alexbosworth) - -### See also - -[Submarine Swaps Service](https://github.com/submarineswaps/swaps-service) - -## References - -\[1\] [https://submarineswaps.org/](https://submarineswaps.org/) - diff --git a/lightning-software/README.md b/lightning-software/README.md deleted file mode 100644 index d166880..0000000 --- a/lightning-software/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Lightning Software - diff --git a/lightning-software/implementations-of-lightning-network.md b/lightning-software/implementations-of-lightning-network.md deleted file mode 100644 index 6b50874..0000000 --- a/lightning-software/implementations-of-lightning-network.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -latest-revision: '2019-01-27T00:00:00.000Z' -original-author: Gareth James (gjradar) -created: '2019-01-01T00:00:00.000Z' -status: Accepted -title: Network Implementations -contributors: Ryan Shea (ryan-shea); Gareth James (gjradar) -type: article -description: '' -discussions-to: GitHub URL -category: lightning-software ---- - -# Network Implementations - -## Overview - -Participation in the [Lightning Network](../lightning-basics/lightning-network.md) requires running an implementation of a Lightning Network daemon software. This software launches and runs a unique [node](../lightning-basics/node.md) that allows communication with other peers on the network. Multiple versions, or implementations, have been created by different entities, just as multiple implementations of core Bitcoin software exist. Different implementations maintain interoperability by conforming to [BOLT](../lightning-basics/basics-of-lightning-technology-bolt.md) \(Basis of Lightning Technology\) standards. - -## Details - -### Existing Implementations - -\*\*\*\*[**lnd**](lnd/), a BOLT-compliant Lightning node by Lightning Labs written in Golang [https://github.com/lightningnetwork/lnd](https://github.com/lightningnetwork/lnd) - -\*\*\*\*[**c-lightning**](c-lightning.md), a BOLT-compliant Lightning node by Blockstream written in C [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning) - -\*\*\*\*[**Eclair**](eclair.md), a BOLT-compliant Lightning node by ACINQ written in Scala [https://github.com/ACINQ/eclair](https://github.com/ACINQ/eclair) - -**Ptarmigan**, a BOLT-compliant Lightning node by written in C++ [https://github.com/nayutaco/ptarmigan](https://github.com/nayutaco/ptarmigan) - -**LIT**, a non-BOLT-compliant Lightning node by MIT-DCI written in Go [https://github.com/mit-dci/lit](https://github.com/mit-dci/lit) Native multichain support and some other novel features developed by Tadge Dryja - -## References - -\[1\] [https://github.com/lightningnetwork/lnd](https://github.com/lightningnetwork/lnd) - -\[2\] [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning) - -\[3\] [https://github.com/ACINQ/eclair](https://github.com/ACINQ/eclair) - -\[4\] [https://github.com/nayutaco/ptarmigan](https://github.com/nayutaco/ptarmigan) - -\[5\] [https://github.com/mit-dci/lit](https://github.com/mit-dci/lit) - diff --git a/lightning-software/lnd/README.md b/lightning-software/lnd/README.md deleted file mode 100644 index d2cae14..0000000 --- a/lightning-software/lnd/README.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -latest-revision: '2019-01-27T00:00:00.000Z' -original-author: Ryan Shea (ryan-shea) -created: '2019-01-01T00:00:00.000Z' -status: Accepted -title: LND -contributors: Ryan Shea (ryan-shea); Gareth James (gjradar) -type: article -description: '' -discussions-to: GitHub URL -category: lightning-software ---- - -# LND - -## Overview - -`lnd`, or the Lightning Network Daemon, is a complete implementation of a [BOLT](../../lightning-basics/basics-of-lightning-technology-bolt.md)-compliant Lightning Network [node ](../../lightning-basics/node.md)developed by Lightning Labs. It is currently deployed on the Bitcoin Test Network `testnet3` and on mainnet. `lnd` 0.1 alpha was released on January 11th, 2017, and since has been in active beta development. - -## Details - -### Technical Details - -`lnd` has several back-end chain services including [`btcd`](https://github.com/btcsuite/btcd) \(a full-node\), [`bitcoind`](https://github.com/bitcoin/bitcoin), and [`neutrino`](https://github.com/lightninglabs/neutrino) \(an experimental light client\). `lnd` is fully compliant with the current network specifications, outlined in the [Basis of Lightning Technology](../../lightning-basics/basics-of-lightning-technology-bolt.md) standards outline. - -At the time of writing, January 14th, 2018, `lnd` is capable of: - -* Creating channels. -* Closing channels. -* Completely managing all channel states \(including the exceptional ones!\). -* Maintaining a fully authenticated+validated channel graph. -* Performing path finding within the network, passively forwarding incoming payments. -* Sending outgoing [onion-encrypted payments](https://github.com/lightningnetwork/lightning-onion) through the network. -* Updating advertised fee schedules. -* Automatic channel management \([`autopilot`](https://github.com/lightningnetwork/lnd/tree/master/autopilot)\). - -### Developer Resources - -Lightning Labs has created multiple developer resources to facilitate application development. Alongside their two RPC interfaces \(a HTTP REST API and a gRPC service\), Lightning Labs has supporting documentation and a healthy ecosystem of developer tools. - -## Resources - -[lnd GitHub repository](https://github.com/lightningnetwork/lnd) - -A set of developer resources including talks, articles, and example applications can be found at: [dev.lightning.community](https://dev.lightning.community/). - -### Key People - -* [Elizabeth Stark](https://twitter.com/starkness) -* [Olaoluwa Osuntokun](https://twitter.com/roasbeef) - -### See also - -* [Lightning Labs](https://lightning.engineering/) -* [Lightning Dev Slack](https://join.slack.com/t/lightningcommunity/shared_invite/enQtMzQ0OTQyNjE5NjU1LWRiMGNmOTZiNzU0MTVmYzc1ZGFkZTUyNzUwOGJjMjYwNWRkNWQzZWE3MTkwZjdjZGE5ZGNiNGVkMzI2MDU4ZTE) - -## References - -\[1\] [https://lightning.engineering/](https://lightning.engineering/) - -\[2\] [https://dev.lightning.community/](https://dev.lightning.community/) - -\[3\] [https://api.lightning.community/](https://api.lightning.community/) - diff --git a/bitcoin-basics/README.md b/tech/bitcoin/README.md similarity index 100% rename from bitcoin-basics/README.md rename to tech/bitcoin/README.md diff --git a/bitcoin-basics/bitcoin-address-formats.md b/tech/bitcoin/bitcoin-address-formats.md similarity index 96% rename from bitcoin-basics/bitcoin-address-formats.md rename to tech/bitcoin/bitcoin-address-formats.md index 72b0093..5fc1e60 100644 --- a/bitcoin-basics/bitcoin-address-formats.md +++ b/tech/bitcoin/bitcoin-address-formats.md @@ -19,7 +19,7 @@ A **Bitcoin address** is an identifier that represents a destination for a Bitco ## Details -### Formats (WIF = Wallet Import Format) +### Formats \(WIF = Wallet Import Format\) _Private Key WIF \(51 characters base58, starts with a '5'\):_ `5KLgsTKHMLmVxetAvN8Vqa9H7FWSj1DdXYeEKMy4nyHS5YKTpuq` diff --git a/bitcoin-basics/dust-limit.md b/tech/bitcoin/dust-limit.md similarity index 100% rename from bitcoin-basics/dust-limit.md rename to tech/bitcoin/dust-limit.md diff --git a/bitcoin-basics/faucet.md b/tech/bitcoin/faucet.md similarity index 83% rename from bitcoin-basics/faucet.md rename to tech/bitcoin/faucet.md index 2646919..b2c4756 100644 --- a/bitcoin-basics/faucet.md +++ b/tech/bitcoin/faucet.md @@ -29,7 +29,7 @@ Crypto faucets exist to introduce people to the concept of Bitcoin or cryptocurr ### Bitcoin Testnet Faucets -Currently, there is only one Bitcoin `testnet3` faucet, the Radar Ion Faucet. Previous faucets that were functional include: [coinfaucet.eu](https://coinfaucet.eu/en/btc-testnet/); [uo1.net](https://bitcoinfaucet.uo1.net/); [tpfaucet](http://tpfaucet.appspot.com/); and [backend.hamburg](https://testnet.manu.backend.hamburg/faucet). +Currently, there is only one Bitcoin `testnet3` faucet, the [Radar Ion Faucet](https://ion.radar.tech/#faucet). Previous faucets that were functional include: [coinfaucet.eu](https://coinfaucet.eu/en/btc-testnet/); [uo1.net](https://bitcoinfaucet.uo1.net/); [tpfaucet](http://tpfaucet.appspot.com/); and [backend.hamburg](https://testnet.manu.backend.hamburg/faucet). ## Resources diff --git a/bitcoin-basics/fees.md b/tech/bitcoin/fees.md similarity index 100% rename from bitcoin-basics/fees.md rename to tech/bitcoin/fees.md diff --git a/tech/bitcoin/hash.md b/tech/bitcoin/hash.md new file mode 100644 index 0000000..026500f --- /dev/null +++ b/tech/bitcoin/hash.md @@ -0,0 +1,50 @@ +--- +latest-revision: '2019-01-27T00:00:00.000Z' +original-author: Ryan Shea (ryan-shea) +created: '2019-01-01T00:00:00.000Z' +status: Accepted +title: Hash +contributors: Ryan Shea (ryan-shea); Gareth James (gjradar) +type: article +description: '' +discussions-to: GitHub URL +category: bitcoin-basics +--- + +# Hash + +## Overview + +A hash algorithm turns an arbitrary amount of data into a unique fixed-length **hash**. A hash is a fingerprint of the input data, and the same fingerprint can always be produced from the same input data. Hashes are essential to cryptographic functions not only on Bitcoin but also on the Lightning Network. + +## Details + +### Bitcoin Hashes + +Cryptographic hash functions are used extensively in Bitcoin: in bitcoin addresses, in script addresses, and in the mining Proof-of-Work algorithm. Bitcoin uses the SHA-256 algorithm to generate hashes. + +### Private and Public Keys + +![](../../.gitbook/assets/key-movement.png) + +Public-key cryptography involves a key pair: a _public key_ and a _private key_. Each entity has their own. The public key can be shared around, the private key is secret. + +They allow doing two things: + +* _Encrypt_ a message with the public key, _decrypt_ it with the private key +* _Sign_ a message with the private key, _verify_ it with the public key + +Some common algorithms are [RSA](https://en.wikipedia.org/wiki/RSA_%28cryptosystem%29) \(used for both\) and [ECDSA](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm) \(only for signatures\). + +In the bitcoin protocol, a one-way cryptographic hash function is used to generate a bitcoin address. + +## Resources + +[SHA-256 Hash Generator](https://www.movable-type.co.uk/scripts/sha256.html) + +## References + +\[1\] [https://en.bitcoin.it/wiki/Hash](https://en.bitcoin.it/wiki/Hash) + +\[2\] [https://en.wikipedia.org/wiki/Cryptographic\_hash\_function](https://en.wikipedia.org/wiki/Cryptographic_hash_function) + diff --git a/bitcoin-basics/hltc.md b/tech/bitcoin/hltc.md similarity index 78% rename from bitcoin-basics/hltc.md rename to tech/bitcoin/hltc.md index 2c472ff..bad3d58 100644 --- a/bitcoin-basics/hltc.md +++ b/tech/bitcoin/hltc.md @@ -15,9 +15,9 @@ category: bitcoin-basics ## Overview -A **Hashed TimeLock Contract** or **HTLC** is smart contract that allows transactions to be sent between parties who do not have a direct [channel ](../lightning-basics/payment-channel.md)on the Lightning Network. HTLC's rely on the fact that an individual can structure a payment such that another party can only accept it if the party knows the secret whose [hash](hash.md) has been shared with them. +A **Hashed TimeLock Contract** or **HTLC** is smart contract that allows transactions to be sent between parties who do not have a direct [channel ](../lightning/payment-channel.md)on the Lightning Network. HTLCs rely on the fact that an individual can structure a payment such that another party can only accept it if the party knows the secret whose [hash](hash.md) has been shared with them. -HTLC's use hashlocks and timelocks to ensure payment security. HTLC's require that the receiver of a payment acknowledges receiving the payment prior to a deadline by generating cryptographic proof of payment or forfeits the ability to claim the payment, returning it to the payer. Because any receipt of funds triggers the creation of a new hash, this idea can be extended to allow a sequence of payments; with the right conditionality, payments can be securely routed through a series of users. +HTLCs use hashlocks and timelocks to ensure payment security. HTLCs require that the receiver of a payment acknowledges receiving the payment prior to a deadline by generating cryptographic proof of payment or forfeits the ability to claim the payment, returning it to the payer. Because any receipt of funds triggers the creation of a new hash, this idea can be extended to allow a sequence of payments; with the right conditionality, payments can be securely routed through a series of users. The cryptographic proof of payment the receiver generates can then be used to trigger other actions in other payments. diff --git a/bitcoin-basics/op-codes.md b/tech/bitcoin/op-codes.md similarity index 100% rename from bitcoin-basics/op-codes.md rename to tech/bitcoin/op-codes.md diff --git a/bitcoin-basics/pre-image.md b/tech/bitcoin/pre-image.md similarity index 81% rename from bitcoin-basics/pre-image.md rename to tech/bitcoin/pre-image.md index 3c0c44c..a6ae3ae 100644 --- a/bitcoin-basics/pre-image.md +++ b/tech/bitcoin/pre-image.md @@ -15,7 +15,7 @@ category: bitcoin-basics ## Overview -In the Lightning Network, a **preimage** is a data string that is passed into a [hash ](hash.md)function. Preimages are also referred to as 'secrets'. Possession of the relevant preimage allows users to claim [HTLC](hltc.md)s, which is a core process in the [routing](../lightning-basics/payment-routing.md) of payments between [nodes](../lightning-basics/node.md). +In the Lightning Network, a **preimage** is a data string that is passed into a [hash ](hash.md)function. Preimages are also referred to as 'secrets'. Possession of the relevant preimage allows users to claim [HTLC](hltc.md)s, which are a core process in the [routing](../lightning/payment-routing.md) of payments between [nodes](../lightning/node.md). ## References diff --git a/bitcoin-basics/pubkey.md b/tech/bitcoin/pubkey.md similarity index 100% rename from bitcoin-basics/pubkey.md rename to tech/bitcoin/pubkey.md diff --git a/bitcoin-basics/replace-by-fee-rbf.md b/tech/bitcoin/replace-by-fee-rbf.md similarity index 100% rename from bitcoin-basics/replace-by-fee-rbf.md rename to tech/bitcoin/replace-by-fee-rbf.md diff --git a/bitcoin-basics/satoshi-unit-of-currency.md b/tech/bitcoin/satoshi-unit-of-currency.md similarity index 100% rename from bitcoin-basics/satoshi-unit-of-currency.md rename to tech/bitcoin/satoshi-unit-of-currency.md diff --git a/bitcoin-basics/signatures-on-lightning.md b/tech/bitcoin/signatures-on-lightning.md similarity index 84% rename from bitcoin-basics/signatures-on-lightning.md rename to tech/bitcoin/signatures-on-lightning.md index a9446a4..6391696 100644 --- a/bitcoin-basics/signatures-on-lightning.md +++ b/tech/bitcoin/signatures-on-lightning.md @@ -27,7 +27,7 @@ The digital signature algorithm used in Bitcoin is the secp256k1 Elliptic Curve ### Signatures on Lightning -Digital signatures are an integral element of the multi signature holder address created in the establishment of a [channel](../lightning-basics/payment-channel.md). Two verified digital signatures are required to create the channel, as well as initiate the [closing transaction](../lightning-channels/channel-closing.md). Signatures are also essential to the [Hashed Timelock Transfer Contract](hltc.md), or HTLC, a smart contract that enables payments to be routed across the Lightning Network. +Digital signatures are an integral element of the multi signature holder address created in the establishment of a [channel](../lightning/payment-channel.md). Two verified digital signatures are required to create the channel, as well as initiate the [closing transaction](../channels/channel-closing.md). Signatures are also essential to the [Hashed Timelock Transfer Contract](hltc.md), or HTLC, a smart contract that enables payments to be routed across the Lightning Network. ## Resources diff --git a/bitcoin-basics/state-channel.md b/tech/bitcoin/state-channel.md similarity index 78% rename from bitcoin-basics/state-channel.md rename to tech/bitcoin/state-channel.md index ef6ab9b..1b80eda 100644 --- a/bitcoin-basics/state-channel.md +++ b/tech/bitcoin/state-channel.md @@ -15,7 +15,7 @@ category: bitcoin-basics ## Overview -State channels are a technique for allowing fast and cheap off-chain payments that retain the security of the underyling blockchain. They allow transacting users instant finality and minimal blockchain transaction fees. +**State channels** are a technique for allowing fast and cheap off-chain payments that retain the security of the underyling blockchain. They allow transacting users instant finality and minimal blockchain transaction fees. ## Details @@ -23,7 +23,7 @@ State channels are a technique for allowing fast and cheap off-chain payments th State channels enhance blockchain performance by taking state-modifying operations off of a blockchain and instead executing them directly between defined sets of participants. -[Payment channels ](../lightning-basics/payment-channel.md)were the first type of state channel to be described, using off-chain interactions to modify ownership of locked Bitcoin, thereby allowing users to make “off-chain payments” to each other. The term “state channels” generalizes this approach beyond payments, encompassing all types of blockchain state modification which operate within a security paradigm comparable to that of the payment channel. +[Payment channels ](../lightning/payment-channel.md)were the first type of state channel to be described, using off-chain interactions to modify ownership of locked Bitcoin, thereby allowing users to make “off-chain payments” to each other. The term “state channels” generalizes this approach beyond payments, encompassing all types of blockchain state modification which operate within a security paradigm comparable to that of the payment channel. State channels let parties securely modify locked portions of blockchain state called state deposits. These deposits are typically held in multisignature wallets, where the participants to the state channel are the signers to the multisig. diff --git a/bitcoin-basics/transaction-malleability.md b/tech/bitcoin/transaction-malleability.md similarity index 100% rename from bitcoin-basics/transaction-malleability.md rename to tech/bitcoin/transaction-malleability.md diff --git a/lightning-channels/README.md b/tech/channels/README.md similarity index 100% rename from lightning-channels/README.md rename to tech/channels/README.md diff --git a/lightning-channels/channel-backups.md b/tech/channels/channel-backups.md similarity index 100% rename from lightning-channels/channel-backups.md rename to tech/channels/channel-backups.md diff --git a/lightning-channels/channel-capacity.md b/tech/channels/channel-capacity.md similarity index 83% rename from lightning-channels/channel-capacity.md rename to tech/channels/channel-capacity.md index 02f8237..0be40c1 100644 --- a/lightning-channels/channel-capacity.md +++ b/tech/channels/channel-capacity.md @@ -23,15 +23,14 @@ Channels on the Lightning Network are 'bi-directional', as both participants are ### Inbound and outbound fund flow -![Example fund flow for network participants. Artwork from lightning.engineering](../.gitbook/assets/channel_balance.png) +![](../../.gitbook/assets/chjannel-flow.png) Funds may flow in and out of the Lightning Network for various reasons. -### Section 3 +![](../../.gitbook/assets/channel-capacity.png) -## Resources - -### See also +Option 1. Alice spends some of her channel balance with Lightning Chess and pushes funds over to them. +Option 2. Option 2 Lightning Chess opens a channel with Alice, with funds on Lightning Chess’s side. ## References diff --git a/tech/channels/channel-closing.md b/tech/channels/channel-closing.md new file mode 100644 index 0000000..0bddd6e --- /dev/null +++ b/tech/channels/channel-closing.md @@ -0,0 +1,57 @@ +--- +latest-revision: '2019-01-27T00:00:00.000Z' +original-author: Ryan Shea (ryan-shea) +created: '2019-01-01T00:00:00.000Z' +status: Accepted +title: Channel Closing +contributors: Ryan Shea (ryan-shea); Gareth James (gjradar) +type: article +description: '' +discussions-to: GitHub URL +category: lightning-channels +--- + +# Closing A Channel + +Payment channels on the Lightning Network have an unlimited lifespan, and will remain open forever until a participant in the channel initiates a **closing transaction**. + +Closing transactions come in different forms and may involve one or both parties to the channel. Closing transactions are broadcast to the blockchain, so the user must pay transaction fees and must wait for the transaction to be mined into the chain. A channel can no longer be used to route payments from the moment that the close is initiated. + +## Types of Closing Transactions + +Both parties are able to send as many Lightning payments to their counterparty as their funds in the Lightning channel allow, knowing that in the event of a disagreement they can settle their agreed-upon channel balance to the blockchain. In the vast majority of cases, there will be no disagreement and the entire lifecycle of a channel will consist of a single channel-funding transaction and a single cooperative close. + +Just in case there is a disagreement, every time a payment traverses the channel, participants create transactions committing to the current channel state and exchange secrets that revoke their previous commitments. The latest commitment and the secret keys that revoke previous commitments are kept by both parties just in case the other part is non-cooperative. + +During the normal operation of a Lightning channel with two non-malicious parties who cooperatively close a channel, no old commitment transactions or revocation keys are ever used, much like how a contract is rarely enforced in the courts. Because both parties understand exactly how the contracts that bind them in a channel will be enforced, both parties know that they cannot get away with fraud and they are incentivized to act honestly. + +### Cooperative Close + +In a cooperative close \(aka mutual close\), both channel participants agree to close the channel and settle the final state of the channel onto the blockchain. Both participants provide a digital signature that authorizes this cooperative settlement transaction. + +### Force Close + +If only one participant is online or if the participants disagree on the state of the channel, one participant can perform a force close \(aka unilateral close\) of the channel without the cooperation of the other participant. + +A force close is performed by broadcasting a "commitment transaction", a transaction that commits to a previous channel state that the channel participants have agreed upon. A force close is legitimate if the commitment transaction that is broadcast is the newest one that the channel participants have agreed upon; if the participant has broadcast a commitment transaction that has been revoked and superseded by a newer commitment, the force close is fraudulent can can be challenged by the other party when they come back online. + +The practical result of a force close is that both parties will receive their portion of the money in the channel, but the party that initiates the force close must wait anywhere from hours to weeks—the exact delay is negotiated by the nodes beforehand—to receive their funds. This delay, referred to as `to_self_delay` in the LND documentation, provides the offline node a window of opportunity to come back online and verify that the force-close was legitimate. If the force-close was fraudulent, the peer can challenge it with a penalty transaction. + +Fraudulent force close transactions can also be detected and responded to by [Watchtower services](../research/watchtowers.md). + +### Fraudulent Force Close + +An invalid unilateral close of a channel, caused by broadcasting a commitment transaction that does not represent the newest channel state agreed upon by the participants. + +If the invalid close is not detected by the other peer within the `to_self_delay` window, the malicious peer will get away with the fraudulent close and may steal some of their peer's money in the channel + +If the invalid close is detected by the other peer or by a [Watchtower service](../research/watchtowers.md), the other peer can use proof that the commitment was revoked, called a commitment revocation secret key, to create and broadcast a penalty transaction that punishes the peer who attempted a fraudulent force close. + +### Penalty Transaction + +A penalty transaction punishes a malicious node for attempting a fraudulent force close. The penalty transaction transfers the malicious node's portion of the funds in the channel to the node that they were attempting to defraud. + +## References + +1. [https://github.com/lightningnetwork/lightning-rfc/blob/master/00-introduction.md](https://github.com/lightningnetwork/lightning-rfc/blob/master/00-introduction.md) BOLT \#0, Introduction and Index + diff --git a/lightning-channels/channel-opening.md b/tech/channels/channel-opening.md similarity index 100% rename from lightning-channels/channel-opening.md rename to tech/channels/channel-opening.md diff --git a/lightning-basics/README.md b/tech/lightning/README.md similarity index 100% rename from lightning-basics/README.md rename to tech/lightning/README.md diff --git a/lightning-basics/basics-of-lightning-technology-bolt.md b/tech/lightning/basics-of-lightning-technology-bolt.md similarity index 95% rename from lightning-basics/basics-of-lightning-technology-bolt.md rename to tech/lightning/basics-of-lightning-technology-bolt.md index 17a7e24..a9fd049 100644 --- a/lightning-basics/basics-of-lightning-technology-bolt.md +++ b/tech/lightning/basics-of-lightning-technology-bolt.md @@ -15,7 +15,7 @@ category: lightning-basics ## Overview -The **Basis of Lightning Technology** is a standardized technical specification for the implementation of the Lightning Network. The standards define how various implementations can interoperate to interact with and create the same network. The specifications are currently a work-in-progress, and are continually being iterated upon as projects like [**lnd**](../lightning-software/lnd/) and [**c-lightning**](../lightning-software/c-lightning.md) are built in parallel. +The **Basis of Lightning Technology** is a standardized technical specification for the implementation of the Lightning Network. The standards define how various implementations can interoperate to interact with and create the same network. The specifications are currently a work-in-progress, and are continually being iterated upon as projects like [**lnd**](../../tutorials/nodes/lnd.md) and [**c-lightning**](../../tutorials/nodes/c-lightning.md) are built in parallel. ## Details diff --git a/lightning-basics/gossip.md b/tech/lightning/gossip.md similarity index 100% rename from lightning-basics/gossip.md rename to tech/lightning/gossip.md diff --git a/lightning-basics/hub.md b/tech/lightning/hub.md similarity index 100% rename from lightning-basics/hub.md rename to tech/lightning/hub.md diff --git a/lightning-basics/invoice.md b/tech/lightning/invoice.md similarity index 72% rename from lightning-basics/invoice.md rename to tech/lightning/invoice.md index f081b71..6e1044c 100644 --- a/lightning-basics/invoice.md +++ b/tech/lightning/invoice.md @@ -11,17 +11,19 @@ discussions-to: GitHub URL category: lightning-basics --- -# Invoice +# Lightning Invoice ## Overview -An **invoice** represents a request for funds on the Lightning Network. Invoices include numerous parameters, both required and optional, such as payment amount, chain, expiry date, payee [pubkey](../bitcoin-basics/pubkey.md), [routing hints](payment-routing.md#routing-hints), and other information. Invoices are used to make payments on the Lightning Network, rather than using [Bitcoin-style addresses](../bitcoin-basics/bitcoin-address-formats.md). +An **invoice** is a request for payment on the Lightning Network. Invoices include the information necessary to complete a payment on the network, such as payment amount, which blockchain the invoice applies to, expiry date, payee [pubkey](../bitcoin/pubkey.md), [routing hints](payment-routing.md#routing-hints), and other information. Invoices are used to make payments on the Lightning Network, rather than using [Bitcoin-style addresses](../bitcoin/bitcoin-address-formats.md). -Invoices are commonly presented as alphanumerical strings or QR codes. In order to parse specific information from the request string, users can pass the string into a decoding tool \[1\]. +Invoices are commonly presented as alphanumerical strings or QR codes. In order to parse specific information from the request string, users can pass the string into a decoding tool: -## Details +* [https://ion.radar.tech/developers\#decode](https://ion.radar.tech/developers#decode) +* [https://lightningdecoder.com/](https://lightningdecoder.com/) +* [https://lndecode.com/](https://lndecode.com/) -### Components +## Invoice Components Every Lightning invoice requires the following information in order to be valid: @@ -32,7 +34,9 @@ Every Lightning invoice requires the following information in order to be valid: * `timestamp`: Time when the invoice was created. This is measured in [seconds since 1970](https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md#data-part). * `cltv_expiry`: Delta to use for time-lock of CLTV extended to the final hop. -### Example Invoice +Convert timestamps to regular human time: [https://www.epochconverter.com/](https://www.epochconverter.com/) + +## Example Invoice Below is a sample invoice decoded using an invoice decoding tool. The standard fields included are: @@ -97,23 +101,11 @@ Below is a sample invoice decoded using an invoice decoding tool. The standard f } ``` -## Resources - -Lightning Decoder - -[https://lightningdecoder.com/](https://lightningdecoder.com/) - -Lightning Payment Request Decoder - -[https://lndecode.com/](https://lndecode.com/) - -### See also - -[Lightning Network Invoices](https://blockfuse.io/blog/lightning-network-invoices/) - ## References -\[1\] [Lightning Decoder](https://lightningdecoder.com/) - -\[2\] [BOLT \#11](https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md) +1. [BOLT \#11](https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md) standards document +2. [Lightning Payment Request Decoder](https://lndecode.com/) app +3. [Radar ION Invoice Decoder](https://ion.radar.tech/developers/#decode) +4. [Lightning Decoder](https://lightningdecoder.com/) app +5. ["Lightning Network Invoices"](https://blockfuse.io/blog/lightning-network-invoices/) , Blockfuse \(2018-12-08\) diff --git a/lightning-basics/lightning-network.md b/tech/lightning/lightning-network.md similarity index 99% rename from lightning-basics/lightning-network.md rename to tech/lightning/lightning-network.md index 090e52e..383f317 100644 --- a/lightning-basics/lightning-network.md +++ b/tech/lightning/lightning-network.md @@ -61,8 +61,6 @@ Through this network of interconnected payment channels, Lightning provides a sc **Single-funded channels:** when Alice needs to send a payment to Bob and doesn't currently have a way to pay him through the Lightning Network \(whether because she can't reach him or because she doesn't have enough money in an existing channel\), she can make a regular on-chain payment that establishes a channel without Bob needing to add any of his funds to the channel. Alice only uses 12 bytes more than she would for a non-Lightning direct payment and Bob would only need about 25 more segwit virtual bytes to close the channel than he would had he received a non-Lightning direct payment. -\_\_ - ## Resources ### Key People diff --git a/lightning-basics/network-capacity.md b/tech/lightning/network-capacity.md similarity index 70% rename from lightning-basics/network-capacity.md rename to tech/lightning/network-capacity.md index 9fbb6bb..2f3cc5c 100644 --- a/lightning-basics/network-capacity.md +++ b/tech/lightning/network-capacity.md @@ -21,22 +21,13 @@ category: null ## Overview -## Details - -### Section 1 - -### Section 2 - -### Section 3 +The **network capacity** on the Lightning Network is the sum total of all publicly indexed funds in channels. As of February 11th, 2019, $2.4 million US dollars are on the network. ## Resources -### Key People - -* [Person 1](network-capacity.md) -* [Person 2](network-capacity.md) - -### See also +[1ML, Lightning Network Visualizer](https://1ml.com/) ## References +\[1\] [1ML Stats](https://1ml.com/) + diff --git a/lightning-basics/node.md b/tech/lightning/node.md similarity index 87% rename from lightning-basics/node.md rename to tech/lightning/node.md index 22d1d1c..1d547a0 100644 --- a/lightning-basics/node.md +++ b/tech/lightning/node.md @@ -15,7 +15,7 @@ category: lightning-basics ## Overview -A **node** is an entity on the Lightning Network that is able to connect to other nodes by establishing a [payment channel](payment-channel.md). Users can create a node by running an implementation of [Lightning Network software](../lightning-software/implementations-of-lightning-network.md), either directly or as part of pre-packaged [wallet](../lightning-software/wallet/) software. +A **node** is an entity on the Lightning Network that is able to connect to other nodes by establishing a [payment channel](payment-channel.md). Users can create a node by running an implementation of [Lightning Network software](../../tutorials/nodes/), either directly or as part of pre-packaged [wallet](../../tutorials/wallets/) software. This should not be confused with a Bitcoin full node that validates Bitcoin blocks, although a full node's wallet may also be simultaneously used as a Lightning node to the advantage of the Lightning network user. diff --git a/lightning-basics/onion-routing.md b/tech/lightning/onion-routing.md similarity index 100% rename from lightning-basics/onion-routing.md rename to tech/lightning/onion-routing.md diff --git a/lightning-basics/payment-channel.md b/tech/lightning/payment-channel.md similarity index 71% rename from lightning-basics/payment-channel.md rename to tech/lightning/payment-channel.md index 0b8daf7..94e0ed0 100644 --- a/lightning-basics/payment-channel.md +++ b/tech/lightning/payment-channel.md @@ -17,13 +17,13 @@ category: lightning-basics On the [Lightning Network](lightning-network.md), a **payment channel** is a direct, bi-directional payment connection between two [nodes](node.md). -Payment channels are the primary building block for the Lightning Network as they allow for fast, low-cost transactions. Through on-chain [opening](../lightning-channels/channel-opening.md) and [closing ](../lightning-channels/channel-closing.md)transactions, payment channels leverage the security of the underlying blockchain to provide trustless payments between two parties. Based on the balance and [capacity](../lightning-channels/channel-capacity.md) of the channel, users exchange 'off-chain' commitments to each other outside of the Bitcoin blockchain. Payments within a channel are off-chain and do not require validation by or communication to the broader network. This means there is no explicit cost to each payment and no limit to the number of payments able to be shared within a channel. +Payment channels are the primary building block for the Lightning Network as they allow for fast, low-cost transactions. Through on-chain [opening](../channels/channel-opening.md) and [closing ](../channels/channel-closing.md)transactions, payment channels leverage the security of the underlying blockchain to provide trustless payments between two parties. Based on the balance and [capacity](../channels/channel-capacity.md) of the channel, users exchange 'off-chain' commitments to each other outside of the Bitcoin blockchain. Payments within a channel are off-chain and do not require validation by or communication to the broader network. This means there is no explicit cost to each payment and no limit to the number of payments able to be shared within a channel. -A payment channel can be [closed ](../lightning-channels/channel-closing.md)by broadcasting an on-chain transaction agreed upon by both parties that finalizes the net balance transferred over the life of the channel. +A payment channel can be [closed]() by broadcasting an on-chain transaction agreed upon by both parties that finalizes the net balance transferred over the life of the channel. ## Details -A channel is a fast, off chain method of mutually exchanging funds between to peers. To transact funds, peers exchange signatures to create a multi signature commitment transaction. The participants then fund the channel with an on-chain transaction, adding funds to the channel \(e.g., 0.1 bitcoin\) that is locked on the Bitcoin network. It is spendable only with both their signatures. +A channel is a fast, off-chain method of mutually exchanging funds between to peers. To transact funds, peers exchange signatures to create a multi signature commitment transaction. The participants then fund the channel with an on-chain transaction, adding funds to the channel \(e.g., 0.1 bitcoin\) that is locked on the Bitcoin network. It is spendable only with both their signatures. Initially they each hold a bitcoin transaction that sends all the bitcoin \(e.g. 0.1 bitcoin\) back to one party. They can later sign a new bitcoin transaction that splits these funds differently, e.g. 0.09 bitcoin to one party, 0.01 bitcoin to the other, and invalidate the previous bitcoin transaction so it won't be spent. @@ -34,7 +34,7 @@ An ideal use case for the technology is **micropayments**: Imagine a user making Other potential use cases: * Rewarding users for specific actions they take, such as contributing content to a blog, or writing a review -* Incrementally purchasing a service offering[j](https://storj.io/) +* Incrementally purchasing a service offering * Payments for other digital/virtual goods, such as a “contributor” badge on a forum * Referral network payments * Small/regular donations to charities, projects or individuals @@ -48,6 +48,8 @@ Other potential use cases: [Lightning Networks Part I: Revocable Transactions](https://rusty.ozlabs.org/?p=450) +[Micropayments, Abridged](https://medium.com/radartech/micropayments-abridged-2f110302677c) + ## References \[1\] [https://counterparty.io/docs/paymentchannels-lightning-faq/](https://counterparty.io/docs/paymentchannels-lightning-faq/) diff --git a/lightning-basics/payment-routing.md b/tech/lightning/payment-routing.md similarity index 93% rename from lightning-basics/payment-routing.md rename to tech/lightning/payment-routing.md index fb77f55..a638918 100644 --- a/lightning-basics/payment-routing.md +++ b/tech/lightning/payment-routing.md @@ -15,13 +15,13 @@ category: lightning-basics ## Overview -**Payment routing** is a fundamental concept in Lightning transactions, enabling nodes that do not have explicit channels to transmit payments to one another. Using [Hashed TimeLock Contracts](../bitcoin-basics/hltc.md), payments can be securely routed between intermediate nodes. +**Payment routing** is a fundamental concept in Lightning transactions, enabling nodes that do not have explicit channels to transmit payments to one another. Using [Hashed TimeLock Contracts](../bitcoin/hltc.md), payments can be securely routed between intermediate nodes. ## Details ### Multi-hop Payment Path -![An example multi-hop payment path. Image from lightning.engineering](../.gitbook/assets/multihop.png) +![](../../.gitbook/assets/payment-path.png) ### Gateway Nodes diff --git a/lightning-basics/sphinx-packet.md b/tech/lightning/sphinx-packet.md similarity index 100% rename from lightning-basics/sphinx-packet.md rename to tech/lightning/sphinx-packet.md diff --git a/tech/news.md b/tech/news.md new file mode 100644 index 0000000..c5fe828 --- /dev/null +++ b/tech/news.md @@ -0,0 +1,94 @@ +--- +description: Hungry for news? Want to keep up to date with the LN ecosystem? +--- + +# Lightning News Sources + +### Email Lists + +**Lightning-dev:** Lightning Network discussion, proposals, and standards development + +{% embed url="https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev" %} + +**Bitcoin Optech**: weekly summary of development progress in Bitcoin and Lightning + +{% embed url="https://bitcoinops.org/en/newsletters/" %} + +**LND:** devs, users, vendors, anyone building on Lightning Labs' Lightning Network Daemon \(LND\): + +{% embed url="https://groups.google.com/a/lightning.engineering/forum/\#!forum/lnd" %} + +**RADAR ION mailing list:** Lightning news, project announcements, reviews, and tutorials to your inbox + +{% embed url="https://us20.campaign-archive.com/home/?u=51b99b5d546c08240db211eda&id=ab22bff805" %} + +**Lapps.co mailing list:** your weekly dose of Lightning apps + +{% embed url="https://www.lapps.co/" %} + +**Lightning Hood:** weekly roundup of Lightning and Bitcoin news + +{% embed url="https://us20.campaign-archive.com/home/?u=a7046eb01361b676a68480cb8&id=c0bcb5fa97" %} + + + + + +### LN Social Media + +Social media sites built on, by, or for the Lightning Network. + +LND Lightning Developers Slack: troubleshooting and discussion for LND users + +{% embed url="https://lightning.engineering/slack.html" %} + +**Lightning Makers:** Telegram group for Lightning project sharing and discussions + +{% embed url="https://t.me/joinchat/EFJwOxEZmjqjTBEx2883Hw" %} + +**Yalls:** post and read in a forum powered by Lightning tips + +{% embed url="https://yalls.org/" %} + +**Lightning Network Subreddit** + +{% embed url="https://www.reddit.com/r/lightningnetwork/" %} + + + + + +### Sites and Blogs + +{% embed url="https://dev.lightning.community/" %} + +{% embed url="https://www.bitcoinlightning.com/" %} + +{% embed url="https://hackernoon.com/@StopAndDecrypt" %} + +{% embed url="https://medium.com/@pierre\_rochard" %} + +{% embed url="https://medium.com/@lopp" %} + +{% embed url="https://medium.com/casa" %} + +{% embed url="https://medium.com/@lightninghood" %} + +{% embed url="https://medium.com/@timevalueofbtc" %} + +{% embed url="https://medium.com/@rusty\_lightning" %} + + + + + +### Twitter + +{% embed url="https://twitter.com/clockwrrk/lists/ln-influencers" %} + +### + + + + + diff --git a/tech/research/README.md b/tech/research/README.md new file mode 100644 index 0000000..69c9d0c --- /dev/null +++ b/tech/research/README.md @@ -0,0 +1,2 @@ +# Research and Development + diff --git a/tech/research/atomic-multi-path-payments.md b/tech/research/atomic-multi-path-payments.md new file mode 100644 index 0000000..ded3944 --- /dev/null +++ b/tech/research/atomic-multi-path-payments.md @@ -0,0 +1,83 @@ +# Atomic Multi-Path Payments + +## Overview + +### Problem + +* Alice has two channels with Bob + * channel 1: 1 BTC + * channel 2: 1 BTC +* Alice wants to send 2 BTC to Bob +* Bob sends a 2 BTC invoice to Alice +* Alice cannot pay the invoice because each channel only has 1 BTC + +![](../../.gitbook/assets/amp-figure01.png) + +### Solution 1: Naive Way + +* Alice wants to send 2 BTC to Bob +* Step 1 + * Bob sends a 1 BTC invoice to Alice + * Alice pays 1 BTC to Bob through channel 1 +* Step 2 + * Bob sends a 1 BTC invoice to Alice + * Alice pays 1 BTC to Bob through channel 2 + +![](../../.gitbook/assets/amp-figure02.png) + +### Solution 2: Atomic Multi-Path Payment + +* Alice opens a channel with Bob. +* Bob sends 2 BTC invoice to Alice +* Alice pays 2 BTC to Bob by splitting the payment + * 1 BTC goes through channel1 + * 1 BTC goes through channel2 +* Bob receives and combines the two payments to claim his BTC + +![](../../.gitbook/assets/amp-figure03.png) + +### Atomic Multi-Path Payment Goals + +* Atomicity: Bob cannot receive the full payment until he receives all of the partial payments +* Avoid Payment Hash Reuse: Each partial payment has a distinct payment hash +* Order Invariance: Partial payment order does not matter +* Non-interactive Setup: Bob does not have to know the transaction is an AMP + +## How It Works + +Alice generates two partial shares since she'll pay through two channels. In this example, we'll use two random numbers 123456 and 654321. + +![](../../.gitbook/assets/amp-figure04.png) + +Alice generates a base pre-image \(BP\) by adding the partial shares. 123456 + 654321 = 777777. If Bob knows BP, then he can claim the funds. + +![](../../.gitbook/assets/amp-figure05.png) + +Alice computes the partial pre-images by concatenating the base pre-image to the sequence number i, then hashing the result. + +![](../../.gitbook/assets/amp-figure06.png) + +Alice creates the payment payments by hashing the partial pre-image. This makes each pre-image distinct and indistinguishable from the others. + +![](../../.gitbook/assets/amp-figure07.png) + +Alice sends the partial payments and partial shares to Bob. + +![](../../.gitbook/assets/amp-figure08.png) + +When Bob receives all of the payments, he will then combine partial shares to generate the base pre-image. + +![](../../.gitbook/assets/amp-figure09.png) + +Bob can now use the base pre-image to generate the partial pre-images to claim funds. + +![](../../.gitbook/assets/amp-figure10.png) + +If Bob does not receive **all** of the partial payments, then he cannot generate the base pre-image thus making it atomic. + +![](../../.gitbook/assets/amp-figure11.png) + +### References + +\[1\] [https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-February/000993.html](https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-February/000993.html) + diff --git a/lightning-r-and-d/channel-factory.md b/tech/research/channel-factory.md similarity index 100% rename from lightning-r-and-d/channel-factory.md rename to tech/research/channel-factory.md diff --git a/lightning-r-and-d/eltoo.md b/tech/research/eltoo.md similarity index 100% rename from lightning-r-and-d/eltoo.md rename to tech/research/eltoo.md diff --git a/tech/research/hardware-wallets.md b/tech/research/hardware-wallets.md new file mode 100644 index 0000000..5b7c130 --- /dev/null +++ b/tech/research/hardware-wallets.md @@ -0,0 +1,4 @@ +# Hardware Wallets + +This article is a stub. Help us by [expanding it](../../wiki-basics/contributing.md). + diff --git a/tech/research/hodl-invoice.md b/tech/research/hodl-invoice.md new file mode 100644 index 0000000..a06b8ff --- /dev/null +++ b/tech/research/hodl-invoice.md @@ -0,0 +1,57 @@ +# Hold Invoices + +## Overview + +A **hodl invoice** \(or **hold invoice**\) is an implementation extension to a [Lightning Invoice](../lightning/invoice.md) where the final step of an [HTLC](https://github.com/RadarTech/ionwiki/tree/8fe28ac442984e71f4749aa4cabde12c4396bddf/tech/bitcoin/htlc.md) resolution is withheld by the payment `receiver`, such that the payment `sender` is fully committed, and cancelled or executed _conditionally_ at a later time. + +A **hodl invoice** is not distinguishable from a normal one to a payment `sender` other than it will have a longer-than-normal `expiry` parameter. + +## Details + +Successful [HTLC](https://github.com/RadarTech/ionwiki/tree/8fe28ac442984e71f4749aa4cabde12c4396bddf/tech/bitcoin/htlc.md) resolution in a [payment channel](../lightning/payment-channel.md) is complete when a payment `receiver` exposes a preimage that hashes to a `payment_hash` of an [Invoice](../lightning/invoice.md) and withdrawing the locked funds. When a `sender`'s funds are committed there is no option but to wait until hashlock resolution \(completing the payment\) or timelock `tl` expiration \(canceling the payment\). By setting a long enough `tl`, a payment `receiver` has the option to withhold \(or cancel\) resolution after funds have been committed until a time `t` such that `t < tl`, otherwise `tl` expires \(`t >= tl`\) and funds are returned back to the `sender`. The conditions by which the `receiver` settles or cancels the [invoice](../lightning/invoice.md) can be arbitrary or cryptographically conditional \(ie. the `receiver` does not know the preimage and must obtain it to settle the payment\). + +## Use Cases + +### Simplified Merchant Returns + +Return processes for settled purchases of out-of-stock inventory can be cumbersome. A merchant could use a **hodl invoice** to only accept payment after it has verified the inventory is in stock, or instantly refund the purchaser otherwise. + +### Fidelity Bond + +A user gains access to a service by paying a **hodl invoice**. If the user is malicious the service settles the [invoice](../lightning/invoice.md), otherwise it is canceled when the user is finished and funds return to the user. + +### Atomic Item Delivery Payment + +Consider an `item` delivery Shop, a Customer could generate a `hash` of a `preimage` and send it to the Shop. The Shop generates an [invoice](../lightning/invoice.md) with `payment_hash` equal to `hash` and Customer pays it, however the Shop cannot settle it without `preimage`. Upon `item` delivery the Customer reveals the `preimage` to the Shop Courier who then settles the [invoice](../lightning/invoice.md). + +### Atomic Multi-party Item Delivery Payment + +Consider an `item` Shop, an independent Courier, and a shop Customer: + +* Customer generates a `preimage` and sends `hash` of `preimage` to the Shop +* Shop creates **hodl invoice** `invoice0` and Customer pays it +* Shop sends `hash` to the Courier who creates another **hodl invoice** `invoice1` \(for delivery costs\) with the same `payment_hash` and Shop pays it +* Upon delivery the Customer gives the `preimage` to the Courier who settles `invoice1` revealing the preimage to Shop who then settles `invoice0`. + +### [Submarine Swap](submarine-swap.md) Variation + +* Alice creates a `preimage` and sends `hash` to Bob +* Bob creates a **hodl invoice** with `payment_hash` equal to `hash` +* Alice pays the **hodl invoice** +* Bob creates an on-chain [HTLC](https://github.com/RadarTech/ionwiki/tree/8fe28ac442984e71f4749aa4cabde12c4396bddf/tech/bitcoin/htlc.md) with `hashlock` equal to `hash` and funds it +* Alice uses `preimage` to sweep funds from the on-chain [HTLC](https://github.com/RadarTech/ionwiki/tree/8fe28ac442984e71f4749aa4cabde12c4396bddf/tech/bitcoin/htlc.md) +* Bob uses revealed `preimage` to settle the **hodl invoice** + +## Caveats + +Reusing a `payment_hash` across multiple [invoices](../lightning/invoice.md) to create conditional payment chains incurs risk for all parties receiving the `preimage` after it has been revealed once as intermediate nodes on mutual payment paths will access the `preimage` that can be used to claim funds before the respective [HTLC](https://github.com/RadarTech/ionwiki/tree/8fe28ac442984e71f4749aa4cabde12c4396bddf/tech/bitcoin/htlc.md) resolution is complete, thereby potentially blocking settlement by the **hodl invoice** holder. + +## Key People + +* [Joost Jager](https://twitter.com/joostjgr). + +## References + +1. [LND pull-request](https://github.com/lightningnetwork/lnd/pull/2022) +2. [The Lite Podcast](http://thelitepodcast.libsyn.com/lightning-network-routing-and-hodl-invoices) with Joost Jager. + diff --git a/lightning-r-and-d/lightning-appliance.md b/tech/research/lightning-appliance.md similarity index 98% rename from lightning-r-and-d/lightning-appliance.md rename to tech/research/lightning-appliance.md index 85711f6..f0e6a95 100644 --- a/lightning-r-and-d/lightning-appliance.md +++ b/tech/research/lightning-appliance.md @@ -11,7 +11,7 @@ discussions-to: GitHub URL category: lightning-rnd --- -# Lightning Appliance +# Lightning Appliances ## Overview diff --git a/lightning-software/lnd/macaroon.md b/tech/research/macaroons.md similarity index 95% rename from lightning-software/lnd/macaroon.md rename to tech/research/macaroons.md index 691ea60..83f9134 100644 --- a/lightning-software/lnd/macaroon.md +++ b/tech/research/macaroons.md @@ -11,7 +11,7 @@ discussions-to: GitHub URL category: lightning-software --- -# Macaroon +# Macaroons ## Overview @@ -49,3 +49,5 @@ A macaroon should be sent over a secure channel. `lnd` enforces TLS for RPC requ \[2\] [http://theory.stanford.edu/~ataly/Papers/macaroons.pdf](http://theory.stanford.edu/~ataly/Papers/macaroons.pdf) +\[3\] [https://store.clobig.com/what-are-macaroon-files-in-lnd/](https://store.clobig.com/what-are-macaroon-files-in-lnd/) + diff --git a/tech/research/privacy.md b/tech/research/privacy.md new file mode 100644 index 0000000..4df1fd1 --- /dev/null +++ b/tech/research/privacy.md @@ -0,0 +1,66 @@ +--- +latest-revision: '2019-01-27T00:00:00.000Z' +original-author: Ryan Shea (ryan-shea) +created: '2019-01-01T00:00:00.000Z' +status: Accepted +title: Privacy (on Lightning Network) +contributors: Ryan Shea (ryan-shea) +type: article +description: '' +discussions-to: GitHub URL +category: lightning-rnd +--- + +# Privacy + +While there is no public, trackable ledger of Lightning transactions, **privacy** on Lightning is still a work in progress. Through techniques like [onion routing](../lightning/onion-routing.md) and [eltoo](eltoo.md), privacy is improving. + +## Invoice and Channel Privacy + +When you **create** an invoice, it reveals your node's public key, which stays the same for the lifetime of your node. This has privacy implications: + +* if you post invoices in public places, the pubkey may link together your identities across platforms +* the recipient of an invoice can link multiple invoices from the same node to eachother +* anyone can view the value of bitcoins that a node pubkey has in non-private channels +* anyone can view the channel opening and closing history of a node pubkey +* anyone can match public channel opening and closing events to the on-chain inputs used to find them, and can trace those inputs using blockchain analysis +* if your node is configured to broadcast a public IP address, + * your invoice reveals the node's IP address and approximate geolocation + * network participants can link together multiple nodes hosted at a single IP address +* if you use multiple nodes with a single identity, invoice recipients can link together those two nodes + +When you **pay** invoices, much less information is revealed: + +* A payment does not indicate to the recipient what node pubkey it originated from +* A node that routes a payment does not know conclusively which node the payment came from or which node the payment is going to + * the routing node only knows which node forwarded it the payment and which node it was instructed to forward the payment to +* If the recipient service uses accounts of embeds user-provided information in the invoice, then obviously the service can link together invoices. + +What things stay private? + +* The existence and balance of **private channels** remains secret to every node except for the node you have opened the private channel to, unless that node chooses to disclose that information +* Your on-chain wallet balance that is not contained in a channel is not linked to your node pubkey, unless though it may be possible to link on-chain wallet balance to previously closed public channels through blockchain analysis +* If you use separate nodes with separate identities, there is not a straightforward way to link them + +How does using [Tor with Lightning](../../tutorials/nodes/tor.md) improve your privacy? + +* By connecting your node to Tor, other Lightning nodes connected to Tor can open channels to your node _without requiring you to broadcast a public IP address_ + +## Sphinx Routing + +The current Lightning Network specification includes a solution to mask routing data from all intermediaries, based on [Sphinx](../lightning/sphinx-packet.md). + +On Lightning, the payer determines a path over the peer-to-peer network and wraps a payment package in layers of encryption. Apart from just relay information, each intermediary also unpacks some additional data. This includes amounts, fees and more, along with allowing all intermediaries to set up a step in the payment chain. + +Importantly, all intermediaries only learn from which channel they receive tokens, and to which channel they must forward the payment. The intermediaries have no idea whether they are the first step in the chain, the last step, a step somewhere in the middle, or perhaps even the only step. Whoever originally sent the transaction, and the one who ultimately receives it, remain known to only the sender and the receiver. + +## Resources + +[Will Lightning Help or Hurt Bitcoin Privacy?](https://www.coindesk.com/will-lightning-help-hurt-bitcoin-privacy) + +## References + +\[1\] [https://medium.com/@rusty\_lightning/the-bitcoin-lightning-spec-part-5-8-onion-routing-protocol-86c91e455909](https://medium.com/@rusty_lightning/the-bitcoin-lightning-spec-part-5-8-onion-routing-protocol-86c91e455909) + +\[2\] [https://bitcoinmagazine.com/articles/how-the-lightning-network-layers-privacy-on-top-of-bitcoin-1482183775/](https://bitcoinmagazine.com/articles/how-the-lightning-network-layers-privacy-on-top-of-bitcoin-1482183775/) + diff --git a/lightning-r-and-d/scriptless-scripts-schnorr.md b/tech/research/scriptless-scripts-schnorr.md similarity index 99% rename from lightning-r-and-d/scriptless-scripts-schnorr.md rename to tech/research/scriptless-scripts-schnorr.md index 5445123..a3127a8 100644 --- a/lightning-r-and-d/scriptless-scripts-schnorr.md +++ b/tech/research/scriptless-scripts-schnorr.md @@ -11,7 +11,7 @@ discussions-to: GitHub URL category: lightning-rnd --- -# Scriptless Scripts \(Schnorr\) +# Scriptless Scripts ## Overview diff --git a/tech/research/sphinx-send.md b/tech/research/sphinx-send.md new file mode 100644 index 0000000..cd254d3 --- /dev/null +++ b/tech/research/sphinx-send.md @@ -0,0 +1,32 @@ +--- +description: Send Lightning payments without using an invoice! +--- + +# Key Send + +Today \(2019-02-15\), you must acquire a one-time-use [Lightning invoice](../lightning/invoice.md) from a user in order to initiate a Lightning payment to them. **Key Send** is a technology currently in development that will allow any node to send a payment to any other \(online\) node without requiring an invoice. + +In [lnd](../../tutorials/nodes/lnd.md) version 0.7.0, **Sphinx Send** was renamed to **Key Send**. + +## Implications + +Today, a payer must receive a unique invoice from a payee for each payment: + +{% embed url="https://twitter.com/pavolrusnak/status/1096414778845786113" %} + +Many tools have been built that LND users can host on a webserver in order to dispense invoices to users: + +{% embed url="https://github.com/brndnhrbrt/ln-donate-node" %} + +{% embed url="https://github.com/michael1011/lightningtip" %} + +With Key Send, these dynamic invoice generators can be replaced with a static string or QR code that anyone can pay to. + +## Progress + +[LND](../../tutorials/nodes/lnd.md) has work-in-progress code that will enable Key Send: + +{% embed url="https://github.com/lightningnetwork/lnd/pull/2455" %} + +This work is incomplete, but if you build two LND nodes from source using the `Roasbeef:new-eob-sphinx-send` feature branch, these nodes are able to exchange Sphinx Send payments. + diff --git a/tech/research/submarine-swap.md b/tech/research/submarine-swap.md new file mode 100644 index 0000000..afc8cf8 --- /dev/null +++ b/tech/research/submarine-swap.md @@ -0,0 +1,313 @@ +--- +latest-revision: '2019-11-21T00:00:00.000Z' +original-author: Ryan Shea (ryan-shea) +created: '2019-01-01T00:00:00.000Z' +status: Accepted +title: Submarine Swap +contributors: Ryan Shea (ryan-shea) +type: article +description: '' +discussions-to: GitHub URL +category: lightning-rnd +--- + +# Submarine Swap + +Submarine Swaps are atomic on-chain to off-chain swaps \(and vice versa, often called Reverse Submarine Swaps\) of cryptocurrencies. + +This was made possible \(and put into production\) by Alex Bosworth. Olaoluwa Osuntokun originally coined the term Submarine Swap — one half is above water \(on-chain\), one half is below water \(off-chain\). + +{% embed url="https://twitter.com/alexbosworth/status/964276161902624768?lang=en" %} + +## Technical Details + +### Problem + +Transactions between on-chain blockchain addresses and off-chain Lightning addresses are not directly compatible. This creates a transaction barrier between the underlying blockchain and the off-chain Lightning Network, regardless of implementation. + +Submarine swaps solve this issue by enabling Lightning channels to be refilled via an on-chain transfer from the underlying blockchain to the off-chain LN channel. Reverse Submarine swaps solves the off-chain to on-chain transactions and enable Lightning channels to be reversed obtaining inbound liquidity via an off-chain transfer in the LN to a on-chain address + +### Structure + +#### A submarine swap essentially looks like this: + +1. Alice produces or retrieves a Lightning Network payment invoice. _It doesn't matter whether the Lightning payment is to Alice or to someone else that Alice is trying to pay_. +2. Alice presents the Lightning invoice to Bob, a "submarine swap provider". +3. Bob quotes what he must be paid _on chain_ in order to pay the Lightning invoice _off-chain_. +4. If Alice accepts the exchange rate, Bob and Alice work together and construct an HTLC that creates a conditional **on-chain** payment to Bob. +5. Alice makes the conditional payment to Bob. +6. The conditional payment to Bob is hashlocked with the same secret that will be revealed if the Lightning invoice is paid. Bob can only redeem the conditional payment from Alice by making the Lightning payment. +7. Bob pays the Lightning invoice, forcing the Lightning payment recipient to reveal the secret S. +8. Bob uses the secret S to redeem the conditional payment from Alice. + +If Bob does not pay the Lightning invoice before it expires, Bob is not able to redeem the conditional payment from Alice. In this case, Alice can wait for the HTLC to expire, then redeem the conditional payment's funds back to herself. + +What do submarine swaps allow you to do? + +* _trustlessly_ pay someone on-chain to perform an off-chain payment for you + +This means that a user can make Lightning Network payments without being on the Lightning Network, rebalance their Lightning Network channels \(refill\) with a fast and low-cost payment on another chain, and perform fast trustless swaps where the usual slow step is made instant. + +Submarine conditional swaps have been demonstrated on the Bitcoin and Litecoin Lightning Networks, using on-chain payments on Bitcoin, Litecoin, and BCH. They are possible \(albeit with more steps\) using on-chain payments on other Bitcoin derivatives, Ethereum, Stellar, Ripple, and more. + +#### A reverse submarine swap essentially looks like this: + +1. Alice generates a secret preimage, think in the secret as a random number that only the user knows, we call it preimage because we are going to use it as an input of a hash function, and we are going to make public \(at the beginning\) only the hash, hashes are one way functions, so knowing the hash give other no clues about which is the secret, but reached the point where the secret is revealed anyone can check that the secret originated that exact hash +2. Alice sends off-chain \(via Lightning\) a conditional payment to Bob, a "submarine swap provider", implemented with a HODL invoice, the condition is that the payment need the secret as an input to be settled or it will return to the payer \(Alice\) if a determined amount of time has elapsed. As soon as Bob discovers the secret \(when Alice reveals it\) he could take that money off-chain, meanwhile it will be on hold \(HODL\). We will call this, the swap payment +3. Alice sends off-chain \(via Lightning\) another payment, called the prepayment, in this case, this is a normal payment of at most a few thousands satoshis, with no condition as its purpose is to cover Bobs on-chain fees that needed to afford while constructing the swap structure. In case the swap fails or its cancelled, Alice won’t get this prepayment back, as the provider has already \(if he is fair\) spent that in the on-chain fees of the tx described below +4. Bob broadcasts an on-chain hash locked output tx ,it is a transaction to an output that can only be spent using the secret preimage, \(the one only Alice knows\) this is the payment to Alice on-chain and the amount of this transaction is the amount of the intended swap. It also has a time condition in case the swap fails, so as we have described we are in front of a Hash Time Locked Contract \(HTLC\), this is constructed using the same hash mentioned in 1., so the secret needed to unlock it, is the same that Alice generated and that at this point only Alice knows. This contract is imposing the following condition to Alice: “if you want the on-chain payment in your wallet, you have to let me settle the swap payment \(off-chain conditional payment\) by publishing your secret” in this way we have the same secret that unlocks the swap payment in favor of Bob and the on-chain payment in favor of Alice +5. Alice publishes the secret by disclosing the secret preimage in the spending transaction, HTLC \(the on-chain transaction that put the money in Alice wallet, often called sweep the payment\), so now anyone can see the secret, especially the provider +6. Bob uses the same secret published by Alice in 5. to settle the swap payment, the HODL invoice \(Bobs off-chain money in exchange for the money he locked on-chain\) + +What do reverse submarine swaps allow you to do? + +* _trustlessly_ pay someone off-chain to perform an on-chain payment for you + +This means that a user can make BTC payments even if he has all his funds commited to Lightning Network channels, rebalance their Lightning Network channels obtaining inbound liquidity, etc. + +## Examples + +See more examples on the [Lightning Exchanges](../../tutorials/lightning-exchanges.md#trustless-noncustodial-exchanges) page. + +### RADAR REDSHIFT + +**Radar.tech** has released **REDSHIFT**, a multi-network submarine swap provider + +{% embed url="https://ion.radar.tech/redshift" %} + +![](../../.gitbook/assets/peek-2019-10-30-23-38.gif) + +### Lightning Labs Loop + +**Lightning Labs** has released **Loop**, a submarine swap service that plugs into LND. Loop allows users running LND nodes to exchange BTC in Lightning channels for BTC on-chain, and vice-versa. Loop charges a fee \(0.1% as of 2019-10-24\) for this service. The Loop client is open source but the server is proprietary—to perform a swap, you have to perform it with Lightning Labs. + +The Loop swap server is hosted on this node: + +`03fb2a0ca79c005f493f1faa83071d3a937cf220d4051dc48b8fe3a087879cf14a` + +It's not possible to connect to this node directly, but you can connect to [this node ](https://1ml.com/node/021c97a90a411ff2b10dc2a8e32de2f29d2fa49d41bfbb52bd416e460db0747d0d)that acts as a gateway to the Loop node: + +`021c97a90a411ff2b10dc2a8e32de2f29d2fa49d41bfbb52bd416e460db0747d0d@18.224.56.146:9735` + +A Loop server is also available on the Bitcoin testnet at [this node](https://1ml.com/testnet/node/0223acffd7f363b4591ce860eda870fea352e981212d8a25e96a0ebea37faae288): + +`0223acffd7f363b4591ce860eda870fea352e981212d8a25e96a0ebea37faae288@40.71.39.161:9735` + +{% embed url="https://blog.lightning.engineering/posts/2019/03/20/loop.html" caption="" %} + +{% embed url="https://github.com/lightninglabs/loop" caption="" %} + +Up to now, the min amount to loop in one itaration is 250000 and the max amount to loop: 2000000, it can be obtained installing the loop command line client and executing `loop terms` and a quote could be request with `loop quote ` + +#### LOOP IN + +Loop in is a submarine swap, in this case joining Lightning BTC with BTC, so you can send a bitcoin payment on-chain and receive Lightning BTC off-chain into a LN channel, making use of it you could get outbound liquidity, refill a channel, or you could pay off-chain with your on-chain funds, or withdraw from an exchange into your Lightning channel using the --external option which allows the on-chain HTLC transacting to be published externally + +**HOW IT WORKS** + +Lets define two actors, the user AKA Alice \(the one who want to refill a channel, using the loop client\) and the provider of the submarine swap AKA Bob \(in this case the loop server\) + +Happy path: + +1. The user presents to the provider a Lightning Network payment invoice \(of the mount of the swap\), that in the case of being paid will reveal a secret/preimage +2. The user and the provider work together to construct an HTLC that creates a conditional on-chain payment \(of the mount of the swap\) to the provider, the conditions are that the secret/preimage \(the same of the LN invoice\) needs to be presented for the funds to end at the provider side or if a time condition is reached the funds will be returned back to the user +3. The user broadcast the previous HTLC \(makes the conditional payment to the provider\) + + 4 .The provider can only satisfy the conditional payment condition if he pays the LN invoice, so he pays that forcing the Lightning payment recipient \(the user here\) to reveal the secret/preimage + +4. The provider now knows the secret so he use it to redeem the conditional on-chain payment from the user \(satisfy the 1st condition of the HTLC\) + +If the provider does not pay the Lightning invoice before it expires, he is not able to redeem the conditional payment from the user, so the user waits for the HTLC to reach the time condition and redeem the conditional payment's funds back. Here we have a penalty for the user as it will lock his funds for that time window + +**TESTNET EXAMPLE** + +```text +$ loop in 2000000 +Max swap fees for 2000000 Loop In: 2562 +CONTINUE SWAP? (y/n), expand fee detail (x): x + +Max on-chain fee: 462 +Max swap fee: 2100 +CONTINUE SWAP? (y/n): y +Swap initiated +ID: 880476479d5492c0a1dbbf83d55c91504cb000c1beeca65f72a7f43487cf3195 +HTLC address: 2MuuE7evoExqtVmFX2K1WsJA6jpzY2aosac +Run `loop monitor` to monitor progress. +``` + +Monitor Output: + +```text +2019-11-18T12:40:22-03:00 LOOP_IN INITIATED 0.02 BTC - 2MuuE7evoExqtVmFX2K1WsJA6jpzY2aosac +2019-11-18T12:40:22-03:00 LOOP_IN HTLC_PUBLISHED 0.02 BTC - 2MuuE7evoExqtVmFX2K1WsJA6jpzY2aosac +2019-11-18T12:45:55-03:00 LOOP_IN INVOICE_SETTLED 0.02 BTC - 2MuuE7evoExqtVmFX2K1WsJA6jpzY2aosac (cost: server -1997900, onchain 0, offchain 0) +2019-11-18T13:05:53-03:00 LOOP_IN SUCCESS 0.02 BTC - 2MuuE7evoExqtVmFX2K1WsJA6jpzY2aosac (cost: server 2100, onchain 0, offchain 0) +``` + +[The swap HTLC](https://blockstream.info/testnet/address/2MuuE7evoExqtVmFX2K1WsJA6jpzY2aosac) + +[User funds the HTLC](https://blockstream.info/testnet/tx/b7a46dceffca8b738344011fc74ad88cd5eb0c158ceee50b84d5ece3699672ae) + +[Loop sweeps the HTLC](https://blockstream.info/testnet/tx/4dc4c183d937747db543a2f08753e16aa06ba688670ae9a1d24937f7544d4619) + +INVOICE for swap \(hint: use the [invoice decoder](https://ion.radar.tech/developers#decode)\): **lntb19979u1pwa9wm9pp53qz8v3ua2jfvpgwmh7pa2hy32pxtqqxphmk2vhmj5l6rfp70xx2sdq8wdmkzuqcqzpgxq97zvuqum3je4pe5kwf539taw0dqvj0kg9yyynvk323ngkaaq75kcwzcwmpjyp3c7fax8eeqhp0qxuzmx2xsl57v4w6da39tqlttsalyafd2tcpkl6ngz** + +![image](https://user-images.githubusercontent.com/45073251/69437256-b3368d00-0d21-11ea-8015-fcdff40a75f1.png) + +The HTLC bitcoin script: + +```text +OP_SIZE +OP_PUSHBYTES_1 20 +OP_EQUAL +OP_IF +OP_HASH160 +OP_PUSHBYTES_20 55c84ba23c5afcbdbe5a45b4fc5b0248a69c1b54 (preimage hash) +OP_EQUALVERIFY +OP_PUSHBYTES_33 0288f35c514096ffed23a81dd94f266402569f873d68a706df9302c0fca1c111b5 (loop server / provider address) +OP_ELSE +OP_DROP +OP_PUSHBYTES_3 6b9018 (value for absolute timelock CLTV) +OP_CLTV +OP_DROP +OP_PUSHBYTES_33 02d591d603a0766042dc19b33ff5082900be3d279da55bb888981157d4d2c0ad60 (user wallet address) +OP_ENDIF +OP_CHECKSIG +``` + +In simple words it says: if the preimage/secret hashes is equal to **55c84ba23c5afcbdbe5a45b4fc5b0248a69c1b54**, then the LN invoice was paid, so send the on-chain funds to the provider, else if the time condition is reached \(absolute time lock for **6b9018**\) return the funds to the user + +#### LOOP OUT + +Loop out is a reverse submarine swap, in this case joining Lightning BTC with BTC, so you can send a Lightning payment off-chain and receive BTC on-chain to your wallet, making use of it you could get inbound liquidity, reverse a channel, or you could pay on-chain with your off-chain funds \(suppose you have all your funds into channels\) providing an external BTC address to were that funds should go. + +**HOW IT WORKS** + +Lets define two actors, the user AKA Alice \(the one who want Inbound Liquidity, using the loop client\) and the provider of the reverse submarine swap AKA Bob \(in this case the loop server\) + +**Happy path:** + +1.The user generates a secret preimage, think in the secret as a random number that only the user knows, we call it preimage because we are going to use it as an input of a hash function, and we are going to make public \(at the beginning\) only the hash, hashes are one way functions, so knowing the hash give other no clues about which is the secret, but reached the point where the secret is revealed anyone can check that the secret originated that exact hash + +2.The user sends off-chain \(via Lightning\) a conditional payment to the provider, implemented with a HODL invoice, the condition is that the payment need the secret as an input to be settled or it will return to the payer \(the user\) if an amount of time has elapsed. As soon as the provider discovers the secret \(when the user reveals it\) he could take that money off-chain, meanwhile it will be on hold \(HODL\). We will call this, the swap payment + +3.The user sends off-chain \(via Lightning\) another payment, called the prepayment, in this case, this is a normal payment of at most a few thousands satoshis, with no condition as its purpose is to cover the provider on-chain fees that he needs to afford while constructing the swap structure. In case the swap fails or its cancelled, the user won’t get this prepayment back, as the provider has already \(if he is fair\) spent that in the on-chain fees of the tx described below + +4.The provider broadcasts an on-chain hash locked output tx ,it is a transaction to an output that can only be spent using the secret preimage, \(the one only the user knows\) this is the payment to the user on-chain and the amount of this transaction is the amount of the intended swap. It also has a time condition in case the swap fails, so as we have described we are in front of a Hash Time Locked Contract \(HTLC\), this is constructed using the same hash mentioned in 1\), so the secret needed to unlock it, is the same that the user generated and that at this point only the user knows. This contract is imposing the following condition to the user: “if you want the on-chain payment in your wallet, you have to let me settle the swap payment \(off-chain conditional payment\) by publishing your secret” in this way we have the same secret that unlocks the swap payment in favor of the provider and the on-chain payment in favor of the user, let’s see how it’s done next + +5.The user publishes the secret by disclosing the secret preimage in the spending transaction, HTLC \(the on-chain transaction that put the money in his wallet\), so now anyone can see the secret, especially the provider + +6.The provider uses the same secret published by the user in 5\) to settle the swap payment, the HODL invoice \(his off-chain money in exchange for the money he locked on-chain\) + +**Unhappy possible paths:** + +If the provider holds the swap payment and doesn’t publish the transaction that give the money back on-chain to the user, the swap payment time condition will time out and the funds will be returned to the user. In this way the service is non-custodial, but there is a penalty for the user as it will lock his funds for that time window. The user loses the prepayment! + +If the user never publishes the secret, the HTLC will time out, the on-chain funds will be returned to the provider, but the user has already paid with the prepayment the tx fees spent by the provider, it will lock some provider funds for that time window but it would have cost money to the user \(the prepayment\), here is where swap minimum and maximum values comes in as conditions from the provider in order to be protected + +If the user reveals the secret 5\) disclosing the spending tx but it stays in the mempool and is not mined, his off-chain funds held could go to the provider \(the swap payment could be settled as the secret now is public\) so the user needs to make sure that the tx is mined before the refund period begins. He can leverage fee bumping tools such as RBF and CPFP, that means to replace the tx fee for a greater one in order to incentivise miners to include it in the next block. This must be done before the HTLC time condition reached, as if this happens, the user will lose his funds \(they go back to the provider\) and the swap payment could be settled, the result is that the provider ends with all the money by his side. “The risk of the sweep transaction not confirming is dealt with in Lightning Loop by publishing with RBF enabled and trying to replace the sweep transaction in every block with a new transaction that is based on the latest fee estimate” the user could check this condition \(the tx being correctly constructed\) as the transaction will be public in mempool before deciding to publish his secret. The user could choose a safe time lock before starting the swap as he needs to have a reasonable opportunity to get the sweep transaction confirmed “The actual expiry height of the HTLC is picked by the server when the swap is initiated and checked against an acceptable minimum by the Loop client implementation. If the server proposes an expiry height that is too soon, the off-chain swap payment will not be paid and the swap will be aborted.” + +**TESTNET EXAMPLE** + +```text +$ loop out 2000000 --channel 1768408322629828608 +Max swap fees for 2000000 Loop Out: 42593 +CONTINUE SWAP? (y/n), expand fee detail (x) +Max on-chain fee: 447 +Max off-chain swap routing fee: 40010 +Max off-chain prepay routing fee: 36 +Max swap fee: 2100 +Max no show penalty: 1337 +CONTINUE SWAP? (y/n) y +Swap initiated +ID: 368dc49234d219937de2ade6ced83c88864791fc4b9b40dc4a98d6f47eda7399 +HTLC address: tb1qd9tfq2fjfyyylmwekfukde69jetexg0zn0c8u48mya6v8r2wz65s8c6pka + +Run `loop monitor` to monitor progress. +``` + +Monitor Output: + +```text +2019-11-14T01:10:34-03:00 LOOP_OUT INITIATED 0.02 BTC - tb1qd9tfq2fjfyyylmwekfukde69jetexg0zn0c8u48mya6v8r2wz65s8c6pka +2019-11-14T01:27:08-03:00 LOOP_OUT PREIMAGE_REVEALED 0.02 BTC - tb1qd9tfq2fjfyyylmwekfukde69jetexg0zn0c8u48mya6v8r2wz65s8c6pka +2019-11-14T01:43:59-03:00 LOOP_OUT SUCCESS 0.02 BTC - tb1qd9tfq2fjfyyylmwekfukde69jetexg0zn0c8u48mya6v8r2wz65s8c6pka (cost: server 2100, onchain 138, offchain 7) +``` + +Channel initial state: + +![image](https://user-images.githubusercontent.com/45073251/69437001-360b1800-0d21-11ea-87b7-b6a6983558e6.png) + +Channel final state: + +![image](https://user-images.githubusercontent.com/45073251/69437071-520eb980-0d21-11ea-89b2-f1a4348f65c7.png) + +Swap payment \(hint: use the [invoice decoder](https://ion.radar.tech/developers#decode)\): **lntb20007630n1pwue5aepp5x6xufy356gvexl0z4hnvakpu3zry0y0ufwd5phz2nrt0glk6wwvsdq8wdmkzuqcqzxgxq97zvuq7cn6xqanj28xw6hs47w64ag9zmzhqgxx6sl2s0437evmcma6wqk3hxwegm4ctrdf009gfvp955ezxn2mrv0s5x00zxvu9lureyq5ptqqx44865** + +![image](https://user-images.githubusercontent.com/45073251/69437401-027cbd80-0d22-11ea-9393-a5165e90b233.png) + +Prepayment \(hint: use the [invoice decoder](https://ion.radar.tech/developers#decode)\): **lntb13370n1pwue5aepp5vnsn7a56htw8rhck09ehzcuhy65tg2rjy2rae2nuljftcqte3c6qdq2wpex2urp0ycqzxgxq97zvuqvme3wmyfjp56a6s0s6nw0t736ptxn2gdn0yv5vrj0qz2h4yu2hvpk6wau5cdk9k7xasfdjqw9nlgf5tpevp5rwcugzjdgdwnf2mm3fqqtj860s** + +![image](https://user-images.githubusercontent.com/45073251/69437459-1c1e0500-0d22-11ea-9678-d2e6e7b53f47.png) + +[The swap HTLC](https://blockstream.info/testnet/address/tb1qd9tfq2fjfyyylmwekfukde69jetexg0zn0c8u48mya6v8r2wz65s8c6pka) + +[Loop Server funds the HTLC](https://blockstream.info/testnet/tx/eb97d56b81daba1e937f8706bd90705ef3f492c9ea4ca1c5cb3d54b77aa8b049) + +[User sweeps the HTLC](https://blockstream.info/testnet/tx/ebc884d3c565065b44244b46911c9601a044aca76d99f83d7be6b54edbdc48a7) + +The HTLC bitcoin script: + +```text +OP_SIZE +OP_PUSHBYTES_1 20 +OP_EQUAL +OP_IF +OP_HASH160 +OP_PUSHBYTES_20 fe8d137ab98993ae0cf58f05c090aacd30833ea9 (preimage hash) +OP_EQUALVERIFY +OP_PUSHBYTES_33 0389cb5046e0faf7e3293a31d4475474d66e2dd759fe6e7ab8cdd7dc4d80aaa029 (user wallet address) +OP_ELSE +OP_DROP +OP_PUSHBYTES_3 168b18 (value for absolute timelock CLTV) +OP_CLTV +OP_DROP +OP_PUSHBYTES_33 03da6b37bb38bccb24ffa2ac618a1fa338845d8f91934b8ca2063cbaa7b7668953 (loop server / provider address) +OP_ENDIF +OP_CHECKSIG +``` + +In simple words it says: if the preimage/secret hashes is equal to **fe8d137ab98993ae0cf58f05c090aacd30833ea9**, then the HODL invoice was settled, so send the on-chain funds to the user, else if the time condition is reached \(absolute time lock for **168b18**\) return the funds to the provider + +**Alex Bosworth** released an early demo of submarine swaps using fully open-source code: + +{% embed url="https://submarineswaps.org/" caption="" %} + +{% embed url="https://github.com/submarineswaps/swaps-service" caption="" %} + +Boltz Exchange has also open-sourced an implementation that is also compatible with Litecoin LN: + +{% embed url="https://boltz.exchange/" caption="" %} + +{% embed url="https://github.com/BoltzExchange" caption="" %} + +## Resources + +[London Bitcoin Devs - Submarine Swaps and Loop](http://diyhpl.us/wiki/transcripts/london-bitcoin-devs/2019-07-03-alex-bosworth-submarine-swaps/) + +[Submarine Swaps](https://submarineswaps.org) + +[Loop out in depth](https://blog.lightning.engineering/technical/posts/2019/04/15/loop-out-in-depth.html) + +### Key People + +* [Alex Bosworth](https://twitter.com/alexbosworth) + +### See also + +[Submarine Swaps Service](https://github.com/submarineswaps/swaps-service) + +## References + +\[1\] [https://submarineswaps.org/](https://submarineswaps.org/) + diff --git a/lightning-r-and-d/watchtower.md b/tech/research/watchtowers.md similarity index 95% rename from lightning-r-and-d/watchtower.md rename to tech/research/watchtowers.md index d1e6434..436e5d2 100644 --- a/lightning-r-and-d/watchtower.md +++ b/tech/research/watchtowers.md @@ -33,10 +33,14 @@ If that transaction is flagged in its memory as part of an outdated contract, it [Watchtower Support is coming to Bitcoin Lightning Wallet](https://medium.com/@akumaigorodski/watchtower-support-is-coming-to-bitcoin-lightning-wallet-8f969ac206b2) +[Olympus Watchtower Service](https://github.com/btcontract/olympus) \(used in Lightning-Wallet for Android\) + ### See also [Pisa: Arbitration Outsourcing for State Channels](https://eprint.iacr.org/2018/582.pdf) + + ## References \[1\] [https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-April/001196.html](https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-April/001196.html) diff --git a/tutorials/altcoin/README.md b/tutorials/altcoin/README.md new file mode 100644 index 0000000..0f33a46 --- /dev/null +++ b/tutorials/altcoin/README.md @@ -0,0 +1,2 @@ +# Altcoin Lightning + diff --git a/tutorials/altcoin/bitcoin-testnet-ln.md b/tutorials/altcoin/bitcoin-testnet-ln.md new file mode 100644 index 0000000..74c4b4a --- /dev/null +++ b/tutorials/altcoin/bitcoin-testnet-ln.md @@ -0,0 +1,35 @@ +# Bitcoin Testnet LN + +As of 2019-02, the Bitcoin Testnet Lightning Network has about 300 active nodes: + +{% embed url="https://explorer.btc-test.ln.dead.cash/" %} + +1ML indexes node and channel information for the Bitcoin Testnet: + +{% embed url="https://1ml.com/testnet" %} + +## Bitcoin Testnet Lightning Apps + +RADAR ION features a how-to guide for joining the Lightning Network, including a testnet bitcoin faucet, wallet and app recommendations, and a well-connected Lightning node to connect to: + + +{% embed url="https://ion.radar.tech/" %} + +Several apps are live on the BTC Testnet: + +{% embed url="https://starblocks.acinq.co/" %} + +{% embed url="https://testnet.yalls.org/" %} + +{% embed url="https://testnet.lightninggem.com/" %} + +{% embed url="https://testnet.satoshis.place/" %} + +{% embed url="https://example.coingate.com/" %} + +{% embed url="https://testnet.wildln.com/" %} + +{% embed url="https://spacebit.live/" %} + + + diff --git a/tutorials/altcoin/decred.md b/tutorials/altcoin/decred.md new file mode 100644 index 0000000..49c0cde --- /dev/null +++ b/tutorials/altcoin/decred.md @@ -0,0 +1,46 @@ +--- +description: Join the Decred Lightning Network +--- + +# Decred LN + +In late April 2019, the Lightning Network arrived for the Decred testnet; it is not currently \(as of May 6th 2019\) available for Mainnet. + +### Installing DCRLND + +Decred has chosen to enable users to connect to the Decred Lightning Network by maintaining `dcrlnd`, a Decred-specific fork of [LND](../nodes/lnd.md): + +{% embed url="https://github.com/decred/dcrlnd" %} + +Follow the installation instructions to install a Lightning Network node. You will also need to have `dcrd` installed and synchronized to the blockchain. + +{% embed url="https://github.com/decred/dcrlnd/blob/master/docs/INSTALL.md" %} + +### Joining the Network + +Use `dcrlncli newaddress p2pkh` to generate a new address for storing coins. Testnet DCR coins are available from this official faucet: + +{% embed url="https://faucet.decred.org/" %} + +A Decred Testnet block explorer is available here: + +{% embed url="https://testnet.decred.org/" %} + +To connect to the Decred Lightning network, you'll need to use `dcrlncli connect` to establish a p2p connection to other nodes on the network and then `dcrlncli openchannel` to open payment channels to them. Use these maps of the network to find other nodes to connect to: + +{% embed url="http://explorer.dcr-test.ln.dead.cash/" %} + +{% embed url="http://ln-map.jamieholdstock.com/" %} + +### Other Resources + +Join the Decred Slack to discuss the Decred Lightning Network and get support: + +{% embed url="https://slack.decred.org" %} + +Check out this other guide to installing DCRLND: + +{% embed url="https://docs.google.com/document/d/12d4ZTnaPMPFtZHvPrMTkm5nsP2z3VUR1DB-Sf1U\_418/edit" %} + + + diff --git a/tutorials/altcoin/litecoin.md b/tutorials/altcoin/litecoin.md new file mode 100644 index 0000000..2421cf3 --- /dev/null +++ b/tutorials/altcoin/litecoin.md @@ -0,0 +1,64 @@ +--- +description: Join the Litecoin Lightning Network +--- + +# Litecoin LN + +A Lightning Network is also available for Litecoin. [LND](litecoin.md) ships with Litecoin support built in, so you can connect to this Lightning Network using the same LND that you use to connect to the Bitcoin Lightning Network. You will also need to install the `litecoind` or `ltcd` backend and sync the Litecoin blockchain. + +The Litecoin Lightning Network has a smaller number of nodes than the Bitcoin Lightning Network: + +{% embed url="https://1ml.com/litecoin" caption="" %} + +{% embed url="https://explorer.ltc.ln.dead.cash/" caption="" %} + +## Litecoin Lightning Services + +Sparkswap's beta allows trustless trading between the Bitcoin and Litecoin Lightning Networks: + +{% embed url="https://sparkswap.com/" caption="" %} + +Places to spend Lightning LTC: + +{% embed url="https://litoshisplace.com/" caption="" %} + +{% embed url="https://millionlitecoinhomepage.net/" caption="" %} + +{% embed url="https://coingate.com/accept/ltc/litecoin" caption="" %} + +{% embed url="https://en.bitrefill.com/usa/" caption="" %} + +{% embed url="https://ltcshop.roska.life/" caption="" %} + +{% embed url="https://quinsolo.com/" caption="" %} + +## Litecoin Testnet + +Connect to the Litecoin Testnet Lightning Network using LND and the `litecoind` backend. + +The Litecoin Testnet Lightning Network is rather small: + +{% embed url="https://explorer.ltc-test.ln.dead.cash/" caption="" %} + +Get testnet LTC here: + +{% embed url="http://testnet.thrasher.io/" caption="" %} + +{% embed url="http://testnet.litecointools.com/" caption="" %} + +There are no known Litecoin Testnet lightning apps. + +## Tutorials + +For Mac: + +{% embed url="https://github.com/ecurrencyhodler/Litecoin-Resources/blob/master/LTC%20Guides/LTC%20Lightning%20Network%20lnd%20Guide%20\(Mac\).md" caption="" %} + +For Windows: + +{% embed url="https://github.com/ecurrencyhodler/Litecoin-Resources/blob/master/LTC%20Guides/LTC%20Lightning%20Network%20lnd%20Guide%20\(Win\).md" caption="" %} + +## Resources + +{% embed url="https://github.com/ecurrencyhodler/Litecoin-Resources/blob/master/Lightning%20Network%20Apps.md" caption="" %} + diff --git a/tutorials/apps/README.md b/tutorials/apps/README.md new file mode 100644 index 0000000..6e3718c --- /dev/null +++ b/tutorials/apps/README.md @@ -0,0 +1,12 @@ +# Lightning Apps + +Spend and earn Lightning BTC on these Lightning apps! + +Other great sources of Lightning apps: + +* [https://ion.radar.tech/apps](https://ion.radar.tech/apps) +* [https://www.lapps.co/](https://www.lapps.co/) +* [https://lightningnetworkstores.com/](https://lightningnetworkstores.com/) + + + diff --git a/tutorials/apps/lightning-pizza-walkthrough.md b/tutorials/apps/lightning-pizza-walkthrough.md new file mode 100644 index 0000000..24c6a1d --- /dev/null +++ b/tutorials/apps/lightning-pizza-walkthrough.md @@ -0,0 +1,8 @@ +--- +description: ln.pizza +--- + +# Lightning Pizza Walkthrough + +This article is a stub. Help us by [improving it.](../../wiki-basics/contributing.md) + diff --git a/tutorials/apps/lightning-torch.md b/tutorials/apps/lightning-torch.md new file mode 100644 index 0000000..0540759 --- /dev/null +++ b/tutorials/apps/lightning-torch.md @@ -0,0 +1,42 @@ +--- +description: A game on Twitter to relay Lightning payments all over the world (and beyond) +--- + +# Lightning Torch + +A chain of people paying the current "torch holder" in order to take possession of the Lightning Torch. The amount to pass the torch has increased with each participant, as has the fame of the holder. + +{% embed url="https://www.takethetorch.online/" %} + +## The Chain Begins + +{% embed url="https://twitter.com/hodlonaut/status/1086703428791865345" %} + +## Notable Torch Holders + +### Some Psycho Tries To End It + +{% embed url="https://twitter.com/eduard\_btc/status/1091055135550328833" %} + + + +### Jack Dorsey, CEO of Twitter and Square + +{% embed url="https://twitter.com/jack/status/1092892320842706944" %} + +### Elizabeth Stark, CEO of Lightning Labs + +{% embed url="https://twitter.com/starkness/status/1092979944022519809" %} + +### CZ, CEO of Binance + +{% embed url="https://twitter.com/cz\_binance/status/1094850530738823169" %} + +CZ goads Elon Musk to take the torch: + +{% embed url="https://twitter.com/cz\_binance/status/1094849886552416257" %} + +## In The News + +{% embed url="https://bitcoinmagazine.com/articles/lightning-torchs-bitcoin-payment-is-running-a-worldwide-marathon/" %} + diff --git a/tutorials/apps/litecoin-ln.md b/tutorials/apps/litecoin-ln.md new file mode 100644 index 0000000..33062cd --- /dev/null +++ b/tutorials/apps/litecoin-ln.md @@ -0,0 +1,60 @@ +# Litecoin LN + +Connect to the Litecoin Lightning Network using LND and the `litecoind` backend. + +The Litecoin Testnet Lightning Network has a moderate number of nodes: + +{% embed url="https://1ml.com/litecoin" caption="" %} + +{% embed url="https://explorer.ltc.ln.dead.cash/" caption="" %} + +## Litecoin Lightning Services + +Sparkswap's beta allows trustless trading between the Bitcoin and Litecoin Lightning Networks: + +{% embed url="https://sparkswap.com/" caption="" %} + +Places to spend Lightning LTC: + +{% embed url="https://litoshisplace.com/" caption="" %} + +{% embed url="https://millionlitecoinhomepage.net/" caption="" %} + +{% embed url="https://coingate.com/accept/ltc/litecoin" caption="" %} + +{% embed url="https://en.bitrefill.com/usa/" caption="" %} + +{% embed url="https://ltcshop.roska.life/" caption="" %} + +{% embed url="https://quinsolo.com/" caption="" %} + +## Litecoin Testnet + +Connect to the Litecoin Testnet Lightning Network using LND and the `litecoind` backend. + +The Litecoin Testnet Lightning Network is rather small: + +{% embed url="https://explorer.ltc-test.ln.dead.cash/" caption="" %} + +Get testnet LTC here: + +{% embed url="http://testnet.thrasher.io/" caption="" %} + +{% embed url="http://testnet.litecointools.com/" caption="" %} + +There are no known Litecoin Testnet lightning apps. + +## Tutorials + +For Mac: + +{% embed url="https://github.com/ecurrencyhodler/Litecoin-Resources/blob/master/LTC%20Guides/LTC%20Lightning%20Network%20lnd%20Guide%20\(Mac\).md" caption="" %} + +For Windows: + +{% embed url="https://github.com/ecurrencyhodler/Litecoin-Resources/blob/master/LTC%20Guides/LTC%20Lightning%20Network%20lnd%20Guide%20\(Win\).md" caption="" %} + +## Resources + +{% embed url="https://github.com/ecurrencyhodler/Litecoin-Resources/blob/master/Lightning%20Network%20Apps.md" caption="" %} + diff --git a/tutorials/apps/spacebit-satellite-client.md b/tutorials/apps/spacebit-satellite-client.md new file mode 100644 index 0000000..a873b38 --- /dev/null +++ b/tutorials/apps/spacebit-satellite-client.md @@ -0,0 +1,64 @@ +# Spacebit Satellite Client + +Ever want to pay magic internet money to send `HELLO WORLD` to the entire world by bouncing it off a satellite? It's 2019 and this is a thing you can do. Bid testnet bitcoin using Lightning payments in order to send messages through a fleet of five [Blockstream satellites](https://blockstream.com/satellite/) that broadcast over pretty much the entire planet; anyone listening in with a satellite dish will get your message. + +Sending a message with this service couldn't be easier, but verifying your message was sent requires tools that aren't as user-friendly. + +{% embed url="https://spacebit.live/" caption="Use this tool to pay for and broadcast messages" %} + +{% embed url="https://1ml.com/testnet/node/039d2201586141a3fff708067aa270aa4f6a724227d5740254d4e34da262a79c2a" caption="This is the node that accepts testnet BTC payments for Spacebit " %} + +## Receive Messages + +{% embed url="https://blockstream.com/satellite/" caption="Use this tool to verify that your message has been broadcast" %} + +{% embed url="https://github.com/Blockstream/satellite" caption="Use these tools to receive messages sent by you and others, with or without a satellite dish" %} + +Once you've installed the Blockstream satellite Python utilities, run the following to receive messages sent over the satellite by connecting directly to a server, no satellite dish needed: + +```text +blockstream-satellite/api/examples$ ./demo-rx.py +``` + +Then run the following to grab and save these messages: + +```text +blockstream-satellite/api/examples$ ./api_data_reader.py --plaintext +Waiting for data... + +[2019-02-04 23:22:42]: Got 2135 bytes Saving as plaintext +Saved in downloads/20190204232242. +[2019-02-05 02:57:25]: Got 1024 bytes Saving as plaintext +Saved in downloads/20190205025725. +``` + +Open the saved plaintext files to read the messages! + +{% hint style="info" %} +If messages are encrypted, the saved text will be unintelligible. Only unencrypted plaintext messages, like those sent via spacebit.live, will be readable! +{% endhint %} + +## Set up a Satellite Dish + +Yes, this is a thing that you can do! Requires ~$200 worth of equipment and quite a bit of technical expertise. + +{% embed url="https://www.drgoss.org/\#h.p\_\_lWCP0Nx-gXF" %} + +{% embed url="https://twitter.com/notgrubles/status/1091011511961731073" %} + +## Things People Have Sent + +Somebody has been using the satellite to blog: + +{% embed url="https://twitter.com/adam3us/status/1088907796794490881" %} + +Pavol Rusnak, CTO of SatoshiLabs \(creatos of the Trezor [hardware wallet](../../tech/research/hardware-wallets.md)\), even used the Blockstream satellites to relay the [Lightning Torch](lightning-torch.md): + +{% embed url="https://twitter.com/pavolrusnak/status/1093568672923348997" %} + +## News + +{% embed url="https://bitcoinmagazine.com/articles/blockstream-satellites-now-cover-asia-pacific-send-messages-lightning/" %} + + + diff --git a/tutorials/apps/tipping-sites.md b/tutorials/apps/tipping-sites.md new file mode 100644 index 0000000..f189d26 --- /dev/null +++ b/tutorials/apps/tipping-sites.md @@ -0,0 +1,56 @@ +--- +description: 'sites that let you tip people, places, or things' +--- + +# Tipping Sites + +In the earlier years of blockchain, Bitcoin gained a reputation as "magic internet money" in part because it was simple and cheap to send small-dollar tips to random people on the internet. For most of Bitcoin's first decade, transactions that paid no transaction fee would still be mined into the mostly-empty Bitcoin blocks in a reasonable amount of time. This is no longer the case! + +The Lightning Network brings back the world of simple, free, anonymous tipping and makes it instantaneous—the tip recipient can spend that money immediately, they don't need to wait for a tip to be mined into a block. + +Many sites will likely spring up to make use of this tipping functionality in interesting ways. Here is a selection that we've discovered! + +### Bitcoin Graveyard + +Links to articles, with the then-current price of Bitcoin, about the hundreds of times that Bitcoin has "died". Place flowers on these graves with Lightning payments. + +{% embed url="https://niffler.co/bitcoin-graveyard/" %} + +### Michael1011's Tip Widget + +LightningTip connects to LND and allows you to receive tips on your site. + +While it works great, the example on Michael1011's website does not change to "thanks for your tip!" when the tip is received. + +{% embed url="https://michael1011.at/lightning.html" %} + +{% embed url="https://github.com/michael1011/lightningtip" %} + +### p2sh.info Tipbox + +[https://p2sh.info/](https://p2sh.info/) is a fantastic site with lots of transaction statistics gleaned from the Bitcoin blockchain. You can tip the author with Lightning on their tip page. + +{% embed url="https://tip.p2sh.info/" %} + +### Bitcotools.com + +{% embed url="https://bitcotools.com/donate/" %} + +### Jochen Hoenicke + +Jochen has done some really cool [hacking on the Trezor](https://jochen-hoenicke.de/crypto/trezor-power-analysis/), written guides to [self-custody OMNI assets](https://jochen-hoenicke.de/crypto/omni/) \(such as Tether\), and created this awesome [mempool monitoring tool](https://jochen-hoenicke.de/queue/#0,24h). + +{% embed url="https://jochen-hoenicke.de/lightning/" %} + +### Sergio, Tippin.me + +[Sergio](https://twitter.com/eiprol) created an easy-to-use Bitcoin Mainnet custodial tipping wallet with Twitter login. + +{% embed url="https://tippin.me/help-tippin" %} + +### LNroute.com + +Tip the maintainers of the LNroute Lightning resources site. + +{% embed url="https://tippin.me/@lnroute" %} + diff --git a/tutorials/bootstrapping-liquidity.md b/tutorials/bootstrapping-liquidity.md new file mode 100644 index 0000000..d2f90b6 --- /dev/null +++ b/tutorials/bootstrapping-liquidity.md @@ -0,0 +1,154 @@ +--- +description: quickly improve your Lightning Network connection +--- + +# Bootstrapping Liquidity + +Your Lightning node starts with zero channels, and you must fund channels with other nodes on the network in order to send Lightning payments. Connecting to nodes that are already well-connected helps ensure that you will be able to find routes and send payments anywhere on the network. + +Because payment channels are currently funded only by the initiating party \(though [dual-funded channels](../tech/channels/channel-opening.md) are eventually planned\), opening channels only gives you capacity to send, not to receive. To get receiving capacity, you must either open a channel and then spend money through it, or you must convince other nodes to open channels to you. This guide will walk you through the process! + +## Spend With Lightning + +The easiest way to get inbound capacity is to open a Lightning channel and then spend some of the BTC balance in it. Spending money on Lightning transfers some of your Lightning channel "local balance" that you can spend into "remote balance" that you can use to receive Lightning payments. When you receive a Lightning payment in a channel, "remote balance" within that channel is converted back into "local balance" that you can spend again—the circular Lightning economy! + +For recommendations on places to spend money on the Lightning Network, see [Lightning Apps](apps/) and [Lightning Stores](stores.md). + +You can also acquire inbound liquidity by selling BTC in the Lightning Network; see the article on [Lightning-compatible exchanges](lightning-exchanges.md). + +## Ask For Inbound Channels + +One way to get more inbound liquidity is simply to ask for it. This does requires other nodes to lock up BTC to open a channel to you, so don't be surprised if your request does not receive a response. + +Several Lightning request boards allow you to offer a bounty for others to complete requests, such as opening a channel to your node. As of 2019-12, Microlancer and Sats-4-Likes are the most popular: + +{% embed url="https://microlancer.io/" %} + +{% embed url="https://kriptode.com/satsforlikes/index.html" %} + +\[offline as of 2019-12-06\] [https://singles.shock.network/](https://singles.shock.network/) is an inbound liquidity request board. We have not tried it, but you can list your node there along with any conditions of opening a return channel and maybe someone will open inbound channels to you. + +## Inbound Channel Marketplaces + +Some node operators are offering the service of connecting back to other nodes if they meet certain criteria, usually opening a channel to their node first or making a payment. This page details some of these services that we have tested. + +Please note that services that require you to pay to open a channel are NOT TRUSTLESS, so there is nothing technically stopping them from stealing your money. You should only use these if you trust the operator and/or small amounts of money are involved. + +### Prerequisites + +In order for another node to open a channel to your node, the other node must have a way of contacting your node on the network. There are several ways of accomplishing this: + +1. using a wallet and a channel service that supports LNURL +2. configuring your node to advertise a public IP address +3. [connecting to the network with Tor](nodes/tor.md), if the other node is also connected to Tor +4. connecting first to the other node, whether or not you open a channel with that node + +If you are using `lnd` on the command line, you can connect to a node with `lncli connect @
`. If your wallet app uses LND under the hood, it may or may not expose this functionality. Try starting to open a channel with the node and then cancelling it before actually sending the transaction. + + + +### LNBIG + +LNBIG is the operator of a large number of nodes that hold a significant fraction of the total BTC in the Lightning Network. Simply fill out a form and LNBIG will open a channel to you. Your wallet must support LNURL or you must have—and know how to use—terminal access to your node. + +Successfully tested on 2019-11-05. + +{% embed url="https://lnbig.com/" %} + + + +### LightningTo.Me + +By filling out the form on this website, this node will immediately open a 2,000,000 satoshi channel to you without conditions—you don't even need to open a channel to them! + +Successfully tested on 2019-02-06. + +{% embed url="https://lightningto.me/" caption="" %} + +{% embed url="https://1ml.com/node/03bb88ccc444534da7b5b64b4f7b15e1eccb18e102db0e400d4b9cfe93763aa26d" caption="" %} + + + +### LightningPowerUsers + +If you open a channel to this node and fill out the form on the website, this node will open a channel of the same size back to you. + +Successfully tested on 2019-11-05. + +{% embed url="https://lightningpowerusers.com/home/" caption="" %} + +{% embed url="https://1ml.com/node/0331f80652fb840239df8dc99205792bba2e559a05469915804c08420230e23c7c" caption="" %} + + + +### Lightning Conductor + +If you open a channel larger than 250,000 satoshis and fill out the form on the website, this node will open a 250,000 satoshi channel back to you. + +Successful tested on 2019-02-06. + +{% embed url="https://lightningconductor.net/channels" caption="" %} + +{% embed url="https://1ml.com/node/03c436af41160a355fc1ed230a64f6a64bcbd2ae50f12171d1318f9782602be601" caption="" %} + + + +### Y'alls + +Pay a Lightning payment and Y'alls will open a channel back to your node. If your node doesn't appear on the list of node public keys, then Y'alls is not connected to your node \(see [prerequisites](bootstrapping-liquidity.md#prerequisites)\). + +This exchange is **not trustless**, but there are several mitigating factors: + +* Y'alls will only allow you to pay to attempt to open a channel to nodes that the Y'alls node is already connected to; therefore it's unlikely that Y'alls will not succeed in opening a channel once you have paid for it. +* Y'alls is run by [Alex Bosworth](https://twitter.com/alexbosworth/), an engineer at Lightning Labs. He is a public figure that has made numerous contributions to the Lightning Network and is currently working on [LND](nodes/lnd.md). It is unlikely that he is going to steal $0.50 from you. + +Successfully tested on 2019-02-10. Offer was 18,900 satoshis for a 2,000,000 satoshi channel \(0.945%\) + +Successfully tested on 2019-02-27. Offer was 63,000 satoshis for a 2,000,000 satoshi channel \(3.15%\) + +Successfully tested on 2019-12. Offer was $5.65 for a 4,000,00 satoshi channel \(1.89%\) + +{% embed url="https://yalls.org/about/" caption="" %} + + + +### Bitrefill + +Bitrefill Thor is a service that charges high fees to open a channel to your node. The channel is only guaranteed to remain open for 30 days. + +Due to high fees, we have not tested this service. + +{% embed url="https://www.bitrefill.com/thor-lightning-network-channels/" caption="" %} + + + +### Popmin.net + +You must open a channel to their node OR pay a 10,000 satoshi one-time fee to "register". + +Will open a channel to your node for a fee of 1% of the channel balance, up to 2,000,000 satoshis. + +Successfully tested on 2019-02-15. + +{% embed url="https://popmin.net/inbound" caption="" %} + +{% embed url="https://1ml.com/node/03d24a4d2c8841890779f3c788cd269d467ad8ff8fcfdc21c8ceead42c7dd7f04b" caption="" %} + + + +### WILL\_CONNECT\_BACK + +This node's name and large number of channels suggests that it will connect back, but it's unclear what the terms of a reciprocal channel are. + +Tested on 2019-02-09. Had not received a channel by 2019-02-15. + +{% embed url="https://1ml.com/node/03ee180e8ee07f1f9c9987d98b5d5decf6bad7d058bdd8be3ad97c8e0dd2cdc7ba" caption="" %} + + + + + + + + + diff --git a/tutorials/lightning-exchanges.md b/tutorials/lightning-exchanges.md new file mode 100644 index 0000000..8146730 --- /dev/null +++ b/tutorials/lightning-exchanges.md @@ -0,0 +1,92 @@ +--- +description: Acquire and exchange Lightning BTC +--- + +# Lightning Exchanges + +Have some spare ETH or LTC and want BTC on the Lightning Network? Need to offload your altcoins to test out a new Lightning app? Need to spend some Lightning BTC so that you have [inbound liquidity](bootstrapping-liquidity.md)? You're in luck. There are a few exchanges that enable you to exchange various tokens for BTC on Lightning. + +## Trustless Noncustodial Exchanges + +These exchanges support noncustodial peer-to-peer trading without accounts, custodial deposits, or a trusted third-party. They employ mechanisms that ensure trades are atomic: either both sides happen, or neither side happens. This can be implemented with techniques like the "[submarine swap](../tech/research/submarine-swap.md)" \(atomic swap between a blockchain and the Lightning Network\) that use blockchain-based HTLC escrow to guarantee that the user can refund their payment for the trade if something goes wrong. + +### [RADAR REDSHIFT](https://ion.radar.tech/redshift) + +![Funding Bottle Pay with ETH via REDSHIFT](../.gitbook/assets/peek-2019-10-30-23-38.gif) + +This service uses submarine swaps to allow you to pay a Lightning invoice with on-chain BTC or ETH. Supports the Metamask wallet browser extension for Ethereum, so ETH can be stored within the extension or in a Ledger hardware wallet. + + + +### [submarineswaps.org](https://submarineswaps.org) + +![](../.gitbook/assets/screen-shot-2019-06-19-at-2.25.18-pm.png) + +This service uses submarine swaps to allow you to pay a Lightning invoice with on-chain BTC or LTC. The code is [open source](https://github.com/submarineswaps/). + + + +### [Boltz](https://boltz.exchange/) + +![](../.gitbook/assets/screen-shot-2019-06-19-at-2.36.50-pm.png) + +Boltz is an implementation of submarine swaps, providing a trustless, non-custodial platform for exchange. Supports swaps between BTC and LTC. + + + +### [SparkSwap](https://sparkswap.com/) + +![Sparkswap desktop application](../.gitbook/assets/photo_2019-12-06_12-38-15.jpg) + +SparkSwap is a desktop exchange application that allows you to purchase LN-BTC with your bank account. It plugs into your bank account and your own Lightning node, and it's powered by an escrow system utilizing AnchorUSD on the backend. It requires account signup and extensive KYC. + +Formerly, Sparkswap supported Lightning BTC to LTC exchange through a CLI interface. + +## Trusted \(Non-Atomic\) Exchange + +These services also support swaps between bitcoin on the Lightning Network and other assets. They are NOT trustless—though unlikely, it would be possible for the service to take your money and fail to deliver the assets you paid for. Some of these services do not require an account or a deposit like a traditional exchange, but all require you to trust a third party. + +### [FixedFloat](https://fixedfloat.com/) + +![](../.gitbook/assets/screen-shot-2019-06-13-at-2.38.11-pm.png) + +FixedFloat is a Lightning compatible exchange that uses custodial swaps to exchange tokens. FixedFloat supports Bitcoin, Bitcoin \(Lightning\), Ethereum, Litecoin, Monero, 0x, Basic Attention, Binance Token, Bitcoin Cash, Bitcoin Gold, Dash, Ethereum Classic, Golem, OmiseGO, Paxos Standard, STASIS EURS, TrueUSD, and Zcash. Additionally, FixedFloat has an open [API](https://fixedfloat.com/api) that can be used with an email signup. + +### [ZigZag](https://zigzag.io/#/) + +![](../.gitbook/assets/screen-shot-2019-06-13-at-2.41.48-pm.png) + +ZigZag is a Lightning exchange that relies on custodial swaps. With less support for altcoins than FixedFloat, ZigZag has swaps available for Ethereum, Bitcoin, Dash, and Litecoin. + +### [SideShift](https://sideshift.ai/) + +![](../.gitbook/assets/screen-shot-2019-06-19-at-3.07.47-pm.png) + +SideShift is a custodial exchange that provides token swaps. + +SideShift is blocked in the following countries: North Korea \(DPRK\); United States; Iran, Islamic Republic of; Belarus; Burundi; Central African Republic; Cuba; Congo; Iraq; Libya; Nicaragua; Somalia; Syrian Arab Republic; Yemen; Zimbabwe; Lebanon; South Sudan; and Sudan. + +### [CoinPlaza](https://www.coinplaza.it/) + +![](../.gitbook/assets/screen-shot-2019-06-19-at-2.24.27-pm.png) + +Coinplaza will accept a lightning BTC payment in exchange for BTC, LTC, ETH, or a dozen other assets. + +You must create an account. Does not support US customers. Successfully tested on 2019-02-10. + +### [Lightning Conductor](https://lightningconductor.net/invoice) + +Convert between LN-BTC and BTC without an account. + +Pay an LN invoice to receive a BTC payment on-chain, minus transaction fees and a 4,000 satoshi charge. This is useful to instantly convert some of your existing sending capacity into receiving capacity. + +Successfully tested on 2019-02-10. + +### [LN Zone](https://ln.zone/) + +Another service that offers to send you on-chain BTC in exchange for paying a Lightning invoice, thereby converting some of your existing sending capacity into receiving capacity. + +We are not sure who is operating this service and we have not tested it. + + + diff --git a/tutorials/nodes/README.md b/tutorials/nodes/README.md new file mode 100644 index 0000000..30dbdbc --- /dev/null +++ b/tutorials/nodes/README.md @@ -0,0 +1,32 @@ +# Lightning Node Setup + +## Overview + +Participation in the [Lightning Network](../../tech/lightning/lightning-network.md) requires running an implementation of a Lightning Network daemon software. This software launches and runs a unique [node](../../tech/lightning/node.md) that allows communication with other peers on the network. Multiple versions, or implementations, have been created by different entities, just as multiple implementations of core Bitcoin software exist. Different implementations maintain interoperability by conforming to [BOLT](../../tech/lightning/basics-of-lightning-technology-bolt.md) \(Basis of Lightning Technology\) standards. + +## Details + +### Existing Implementations + +[**lnd**](lnd.md), a BOLT-compliant Lightning node by Lightning Labs written in Golang [https://github.com/lightningnetwork/lnd](https://github.com/lightningnetwork/lnd) + +[**c-lightning**](c-lightning.md), a BOLT-compliant Lightning node by Blockstream written in C [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning) + +[**Eclair**](eclair.md), a BOLT-compliant Lightning node by ACINQ written in Scala [https://github.com/ACINQ/eclair](https://github.com/ACINQ/eclair) + +**Ptarmigan**, a BOLT-compliant Lightning node by written in C++ [https://github.com/nayutaco/ptarmigan](https://github.com/nayutaco/ptarmigan) + +**LIT**, a non-BOLT-compliant Lightning node by MIT-DCI written in Go [https://github.com/mit-dci/lit](https://github.com/mit-dci/lit) Native multichain support and some other novel features developed by Tadge Dryja + +## References + +\[1\] [https://github.com/lightningnetwork/lnd](https://github.com/lightningnetwork/lnd) + +\[2\] [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning) + +\[3\] [https://github.com/ACINQ/eclair](https://github.com/ACINQ/eclair) + +\[4\] [https://github.com/nayutaco/ptarmigan](https://github.com/nayutaco/ptarmigan) + +\[5\] [https://github.com/mit-dci/lit](https://github.com/mit-dci/lit) + diff --git a/tutorials/nodes/btcpay-+-aws-ec2.md b/tutorials/nodes/btcpay-+-aws-ec2.md new file mode 100644 index 0000000..f672687 --- /dev/null +++ b/tutorials/nodes/btcpay-+-aws-ec2.md @@ -0,0 +1,154 @@ +# BTCPay Server + AWS EC2 + +## Overview + +This guide will explain how to set up [BTCPay](https://btcpayserver.org/) on an [AWS](https://aws.amazon.com/) EC2 instance. BTCPay Server is a self-hosted, open-source cryptocurrency payment processor with lightning integration. Host your lightning wallet on the cloud to access your wallet from anywhere. BTCPay Server lets you connect to different wallets such as zap, spark and joule. It also has [Lapp](https://blockstream.com/2018/01/16/lightning-charge/) and [WordPress](https://wordpress.org/plugins/btcpay-for-woocommerce/) integration to host your own blog and lightning store! + +This guide is split into three sections: + +* Set up AWS EC2 +* Set up DNS +* Install BTCPay Server + +## Items/Cost + +To comfortably run mainnet: + +| Items | Cost | +| :--- | :--- | +| BTCPay Server | Free | +| AWS | ≈ $35/month | +| DNS | ≈ $15/year | +| Setup Time | 1-2 hours | +| Sync Time | 1-2 days | + +An AWS EC2 instance is in the cloud so are also[ other ways](https://github.com/btcpayserver/btcpayserver-doc/blob/master/Deployment.md) to install BTCPay Server. Depending on your needs \(testnet vs mainnet\), the EC2 instance can be scaled down to save some money. There are also other DNS services to choose from such as [namecheap](https://www.namecheap.com/) and [google domains](https://domains.google/#/). + +## Set up AWS EC2 + +Sign into AWS and click `Services` + +![](../../.gitbook/assets/btcpay4aws-01.png) + +Set up an EC2 instance. + +![](../../.gitbook/assets/btcpay4aws-01b.png) + +Launch a new instance. + +![](../../.gitbook/assets/btcpay4aws-02.png) + +Select Ubuntu Server + +![](../../.gitbook/assets/btcpay4aws-03.png) + +In this example, we selected instance type `t2.medium` which works well on mainnet. Feel free to experiment to get the best [₿](https://emojipedia.org/bitcoin-sign/)ang for you buck. + +![](../../.gitbook/assets/btcpay4aws-04.png) + +To keep things simple, we kept the default configurations. + +![](../../.gitbook/assets/btcpay4aws-05.png) + +Running lightning currently requires a fully synced node. Storage size depends on the blockchain. + +* For bitcoin mainnet, we recommend 250 GB of free disk space +* For bitcoin testnet, we recommend 50 GB of free disk space + +![](../../.gitbook/assets/btcpay4aws-06%20%281%29.png) + +To keep things simple, we kept the default tags. + +![](../../.gitbook/assets/btcpay4aws-06a.png) + +Add rules to open ports `80` and `443`. This is required to access BTCPay Server on the web. + +![](../../.gitbook/assets/btcpay4aws-06b.png) + +Review and launch! + +![](../../.gitbook/assets/btcpay4aws-07.png) + +To access your instance you'll need to create a new key pair. This should allow you to connect to your instance and install BTCPay Server. Name, download and store it somewhere safe. The file should be something like `btcpay-4-aws.pem` We'll come back to this. + +![](../../.gitbook/assets/btcpay4aws-08%20%281%29.png) + +Once the instance is launched, you'll need to collect some information. + +![](../../.gitbook/assets/btcpay4aws-09%20%281%29.png) + +Get the public IP to set up DNS and install BTCPay Server. + +![](../../.gitbook/assets/btcpay4aws-10%20%281%29.png) + +## Set up DNS + +Setting up DNS is required for BTCPay. We'll be using a service called [easyDNS](https://easydns.com/). Create an account then click `Add Domain` + +![](../../.gitbook/assets/btcpay4aws-11.png) + +Create a domain then continue with the checkout process. + +![](../../.gitbook/assets/btcpay4aws-12%20%281%29.png) + +Once created, it's time to add a DNS record. + +![](../../.gitbook/assets/btcpay4aws-13%20%281%29.png) + +![](../../.gitbook/assets/btcpay4aws-14.png) + +Add the public IP from AWS. In this example, we set the host to `admin`. Once everything is complete, we should be able to access the BTCPay Server at http://admin.btcpay2aws.com. + +![](../../.gitbook/assets/btcpay4aws-15%20%281%29.png) + +## Install BTCPay Server + +Remember the `btc-4-aws.pem` file we downloaded? This will be used to ssh in and install BTCPay Server. Open terminal and use `chmod 400` to [set the permissions](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html) of your private key file so that only you can read it. + +![](../../.gitbook/assets/btcpay4aws-16.gif) + +ssh into the instance with the command: + +`ssh -i ubuntu@` + +![](../../.gitbook/assets/btcpay4aws-17%20%281%29.gif) + +Once logged in, type some [commands](https://github.com/btcpayserver/btcpayserver-docker#full-installation-for-technical-users) to install BTCPay Server. + +```text +# Login as root +sudo su - + +# Clone this repository +git clone https://github.com/btcpayserver/btcpayserver-docker +cd btcpayserver-docker + +# Run btcpay-setup.sh with the right parameters +export BTCPAY_HOST="admin.btcpay4aws.com" +export NBITCOIN_NETWORK="mainnet" +export BTCPAYGEN_CRYPTO1="btc" +export BTCPAYGEN_REVERSEPROXY="nginx" +export BTCPAYGEN_LIGHTNING="clightning" +. ./btcpay-setup.sh -i + +exit +``` + +Make sure to change `BTC_HOST="admin.btcpay4aws.com` to the name you created . To change from c-lightning to lnd, simply change `export BTCPAYGEN_LIGHTNING="clightning"` to `export BTCPAYGEN_LIGHTNING="lnd"` + +Both [clightning](https://github.com/btcpayserver/btcpayserver-doc/blob/master/LightningNetwork.md#getting-started-with-btcpay-and-c-lightning) and [lnd](https://github.com/btcpayserver/btcpayserver-doc/blob/master/LightningNetwork.md#getting-started-with-btcpay-and-lnd) have their slightly different features. For example, use lnd to connect to a [zap wallet](https://wiki.ion.radar.tech/~/edit/drafts/-LaNE4NKJT06bTxyFWW4/tutorials/wallets/zap-desktop) while c-lightning has more Lapp integration. + +![](../../.gitbook/assets/btcpay4aws-18.png) + +Once everything is installed, go to your browser and enter you DNS name. Click `REGISTER` to create an account. + +![](../../.gitbook/assets/btcpay4aws-19%20%281%29.png) + +Notice nodes are syncing. Accessing a lighting wallet currently requires a fully synced node so be patient! + +![](../../.gitbook/assets/btcpay4aws-20.png) + +Once synced, start exploring the different features! This includes setting up a lighting [wallet](https://github.com/btcpayserver/btcpayserver-doc/blob/master/LightningNetwork.md), running a [lightning store](https://github.com/btcpayserver/btcpayserver-doc/blob/master/WooCommerce.md), or receive micropayments for [news and blogs](https://www.youtube.com/watch?v=ZbM3jcxau0o). + +![](../../.gitbook/assets/btcpay4aws-21.png) + diff --git a/lightning-software/c-lightning.md b/tutorials/nodes/c-lightning.md similarity index 55% rename from lightning-software/c-lightning.md rename to tutorials/nodes/c-lightning.md index c65e9ed..829fd81 100644 --- a/lightning-software/c-lightning.md +++ b/tutorials/nodes/c-lightning.md @@ -15,7 +15,7 @@ category: lightning-software ## Overview -**c-lightning** is a a [BOLT](../lightning-basics/basics-of-lightning-technology-bolt.md)-compliant Lightning implementation by Blockstream \[2\] written in C. Version 1 of c-lightning was released on August 8th, 2015, and has since been under active beta development. c-lightning runs on Linux. +**c-lightning** is a a [BOLT](../../tech/lightning/basics-of-lightning-technology-bolt.md)-compliant Lightning implementation by Blockstream \[2\] written in C. Version 1 of c-lightning was released on August 8th, 2015, and has since been under active beta development. c-lightning runs on Linux. ## Details @@ -23,6 +23,18 @@ category: lightning-software On top of complying with all BOLT standards, c-lightning is developing an architecture for plugins. Plugins can be built to extend the c-lightning command line API. +### Developer Tools + +There are a number of developer tools, libraries and plugins that exist for the c-lightning implementation. + +{% embed url="https://github.com/ElementsProject/lightning-charge" caption="" %} + +{% embed url="https://github.com/ElementsProject/paypercall" caption="" %} + +{% embed url="https://github.com/ElementsProject/lightning-charge-client-php" caption="" %} + +{% embed url="https://github.com/ElementsProject/lightning-charge-client-js" caption="" %} + ## Resources [c-lightning GitHub](https://github.com/ElementsProject/lightning) diff --git a/tutorials/nodes/cyphernode.md b/tutorials/nodes/cyphernode.md new file mode 100644 index 0000000..dc2d8cf --- /dev/null +++ b/tutorials/nodes/cyphernode.md @@ -0,0 +1,307 @@ +# Cyphernode + +## Overview + +Cyphernode is a modular Bitcoin full-node microservices API server architecture and utilities toolkit to build scalable, secure and featureful apps and services without trusted third parties. + +Note: The project is in heavy development - [they](http://cyphernode.io) are currently looking for reviews, new features, user feedback and contributors to their roadmap. + +## Setup + +#### System requirements: + +* 250 GB of storage +* 2GB of RAM. +* Docker + +#### Installation instructions can also be found [here](https://github.com/SatoshiPortal/cyphernode/blob/master/doc/INSTALL.md): + +Create a directory called cyphernode + +`$ mkdir cyphernode && cd cyphernode` + +Use the quick install + +```text +$ curl -fsSL https://raw.githubusercontent.com/SatoshiPortal/cyphernode/master/dist/setup.sh -o setup_cyphernode.sh && chmod +x setup_cyphernode.sh && ./setup_cyphernode.sh +``` + +![](../../.gitbook/assets/01-cyphernode.png) + +Follow the configuration process. Below is an example: + +```text +? Cyphernode: Enable help? Yes +? Cyphernode: What features do you want to add to your cyphernode? + +What optional features do you want me to activate? + + Lightning node +? Cyphernode: What net do you want to run on? + +Which Bitcoin network do you want Cyphernode to run on? + + Testnet +? Cyphernode: Run as different user? + +I recommend running Cyphernode as a different user when possible. Using your +current user would give Cyphernode your current access rights, which could be a +security issue especially if you are a sudoer. Please note that this feature is +not supported on OSX at runtime, but you will be fine activating it in case you +want to use the configuration file on another machine. + + No +? Cyphernode: Use a default xpub key to watch or generate adresses? + +Cyphernode can derive Bitcoin addresses from an xPub and the derivation path you +want. If you want, you can provide your xPub and derivation path right now and +call 'derive' with only the index instead of having to pass your xPub and +derivation path on each call. + + No +? Gatekeeper: Enter a password to protect your client keys with + +The Gatekeeper checks all the incoming requests for the right permissions before +delegating them to the proxy. Following the JWT standard, it uses HMAC signature +verification to allow or deny access. Signatures are created and verified using +secret keys. I am going to generate the secret keys and keep them in an encrypted +file. You will be able to download this encrypted file later. Please provide the +encryption passphrase. + + [hidden] +? Gatekeeper: Confirm your client keys password. + + + + [hidden] +? Gatekeeper: Gatekeeper cert CNS (ips, domains, wildcard domains seperated by com +ma)? + +I use domain names and/or IP addresses to create valid TLS certificates. For +example, if https://cyphernodehost/getbestblockhash and +https://192.168.7.44/getbestblockhash will be used, enter cyphernodehost, +192.168.7.44 as a possible domains. 127.0.0.1, localhost, gatekeeper will be +automatically added to your list. Make sure the provided domain names are in your +DNS or client's hosts file and is reachable. + + localhost +? Gatekeeper: Edit API properties? + +If you know what you are doing, it is possible to manually edit the API +endpoints/groups authorization. (Not recommended) + + No +? Bitcoin: Where is your bitcoin full node running? + +Cyphernode can spawn a new Bitcoin Core full node for its own use. But if you +already have a Bitcoin Core node running, Cyphernode can use that. + + Nowhere! I want cyphernode to run one. +? Bitcoin: Name of bitcoin rpc user? + +Bitcoin Core's RPC username used by Cyphernode when calling the node. + + bitcoin +? Bitcoin: Password of bitcoin rpc user? + +Bitcoin Core's RPC password used by Cyphernode when calling the node. + + [hidden] +? Bitcoin: Run bitcoin node in prune mode? + +If you don't have at least 350GB of disk space, you should run Bitcoin Core in +prune mode. NOTE: when running Bitcoin Core in prune mode, the incoming +transactions' fees cannot be computed by Cyphernode and won't be part of the +addresses watching's callbacks payload. + + No +? Bitcoin: Any UA comment? + +User Agent string used by Bitcoin Core. (Optional) + + +? Lightning: What name has your lightning node? + +LN nodes have names. Choose the name you want for yours. + + myLnNode +? Lightning: What color has your lightning node? + +LN nodes have colors. Choose the color you want for yours in RGB format (RRGGBB). +For example, pure red would be ff0000. + + +? Installer: Where do you want to install cyphernode? + +Only one installation mode is supported, right now: local docker (self-hosted). +Choose wisely ;-) + + Docker +? Installer: Where do you want to store your gatekeeper data? + +The Gatekeeper's files (TLS certs, HMAC keys, Groups/API) will be stored in a +container's mounted directory. Please provide the local mounted path to that +directory. If running on OSX, check mountable directories in Docker's File Sharing + +configs. + + /Users/leon/Desktop/cyphernode/cyphernode/gatekeeper +? Installer: Where do you want to store your proxy data? + +The Cyphernode proxy container, which routes all the requests to the right +services uses a sqlite3 database to keep track of some things. This DB will be +mounted from a local path, easy to back up from outside Docker. If running on OSX, + +check mountable directories in Docker's File Sharing configs. + + /Users/leon/Desktop/cyphernode/cyphernode/proxy +? Installer: Where do you want to store your bitcoin full node data? + +Path name to where Bitcoin Core's data files (blockchain data, wallets, configs, +etc.) are stored. This directory will be mounted into the Bitcoin node's +container. If you already have a sync'ed node, you can copy data there to be used +by the node, instead of resyncing everything. NOTE: only copy chainstate/ and +blocks/ contents. If running on OSX, check mountable directories in Docker's File +Sharing configs. + + /Users/leon/Desktop/cyphernode/cyphernode/bitcoin +? Installer: Where do you want to store your lightning node data? + +Path name to where LN's data files are stored. This directory will be mounted into + +the LN node's container. If running on OSX, check mountable directories in +Docker's File Sharing configs. + + /Users/leon/Desktop/cyphernode/cyphernode/lightning +? Installer: Expose bitcoin full node outside of the docker network? + +By default, Bitcoin node ports (RPC and protocol) won't be published outside of +Docker. Do you want to expose them so that your node can be accessed from outside +of the Docker network? + + Yes +? Installer: Expose lightning node outside of the docker network? + +By default, LN node port will be published outside of Docker. Do you want to hide +it so that your node can't be accessed from outside of the Docker network? + + No +? Installer: What docker mode: docker swarm or docker-compose? + +Cyphernode Docker services can be run using Docker Swarm +(https://docs.docker.com/engine/swarm/) or docker-compose +(https://docs.docker.com/compose/overview/). Both will work, some users prefer one + +to another depending on deployment types, scalability, current framework, etc. + + docker-compose +? Installer: Cleanup installer after installation? + +Do you want to remove this configurator Docker image after installation? This +would free about 150MB of disk space. + + Yes +``` + +![](../../.gitbook/assets/01a-cyphernode.png) + +Starting the containers + +`$ ./start.sh` + +![](../../.gitbook/assets/02-cyphernode.png) + +Once everything is finished, you'll see: + +```text +Depending on your current location and DNS settings, point your favorite browser to one of the following URLs to access Cyphernode's status page: + +https://localhost/status/ +https://127.0.0.1/status/ +https://localhost/status/ +https://gatekeeper/status/ + +Use 'admin' as the username with the configuration password you selected at the beginning of the configuration process. +``` + +Go to your browser and enter the url. If this is deployed on the cloud, then make sure port 443 is open. + +![](../../.gitbook/assets/03-cyphernode.png) + +Download `API ID's and keys`. Use an [unzipping tool](https://theunarchiver.com/) to unzip `client.7z` which contains `cacert.pem` and `keys.txt` + +![](../../.gitbook/assets/04-cyphernode.png) + +The `keys.txt` has the id and keys. Each label has roles assigned. 001 has the least permissions while 003 is admin. + +```text +001=9c7d3e23d5d720f1d75db9142fbe2f5e38347b6b44025d0f564f9bc15372d7b2 +002=27720fb1993a410c3ecd295d3599ff0a721435704fd700c6d095a9b30be0fb49 +003=ef7bf0c0ce5a68aafdf07210a58c74a7f1cf85e697451bcaa07f4b5bc868426a +``` + +## Testing + +[Manually](https://github.com/SatoshiPortal/cyphernode/blob/master/doc/INSTALL.md#manually-test-your-installation-through-the-gatekeeper) test your installation through the Gatekeeper: + +Replace `k="2df1eeea3..."` with the key from `keys.txt` + +```text +$ id="001";h64=$(echo -n "{\"alg\":\"HS256\",\"typ\":\"JWT\"}" | base64);p64=$(echo -n "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+10))}" | base64);k="2df1eeea370eacdc5cf7e96c2d82140d1568079a5d4d87006ec8718a98883b36";s=$(echo -n "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1);token="$h64.$p64.$s";curl -v -H "Authorization: Bearer $token" -k https://127.0.0.1/v0/getbestblockhash + +{"result":"000000004c5d9ac49571b1772b48600113fe24f9c158416c9db5239792cec1a6","error":null,"id":null} +``` + +## Development + +Cyphernode has a list of [endpoints](https://github.com/SatoshiPortal/cyphernode/blob/master/doc/API.md). There's a [go](https://github.com/schulterklopfer/cyphernode_welcome/blob/dev/cnAuth/cnAuth.go) and [javascript](https://github.com/SatoshiPortal/cyphernode/blob/dev/clients/javascript/cyphernode-client.js) implementation. Below will help you get started: + +```javascript +const CryptoJS = require("crypto-js"); +const request = require('request') + +// allow self signed certificates +process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0; + +// from keys.txt +const api = { + id: '002', + key: '27720fb1993a410c3ecd295d3599ff0a721435704fd700c6d095a9b30be0fb49' +} + +// echo -n "{\"alg\":\"HS256\",\"typ\":\"JWT\"}" | base64 +const h64 = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9Cg==' + +// set expiration time +const exp = Math.round(new Date().getTime()/1000) + 10 + +// create message +const p = { + exp, + id: api.id +} +const p64 = Buffer.from(JSON.stringify(p)).toString('base64') +const msg = h64 + '.' + p64 + +// hash message + key to create token +const s = CryptoJS.HmacSHA256(msg, api.key).toString() +const token = msg + '.' + s + +// use token to request data +request({ + method: 'GET', + url: 'https://127.0.0.1/v0/getnewaddress', + headers: { + Authorization: `Bearer ${token}` + }, +}, (err, res, body) => { + // {"address":"2N3e4VzKqrEkwmdJ51ETeyuxpzt9bqMHyRB"} + console.log(body) +}) + +``` + +### Future + +Note that cyphernode is currently in development. Version 0.2.0 will be out soon. + diff --git a/lightning-software/eclair.md b/tutorials/nodes/eclair.md similarity index 94% rename from lightning-software/eclair.md rename to tutorials/nodes/eclair.md index f30385b..f000b50 100644 --- a/lightning-software/eclair.md +++ b/tutorials/nodes/eclair.md @@ -25,7 +25,7 @@ category: lightning-software * Platforms: Android * Networks: BTC, tBTC -* Capabilities: Send +* Capabilities: Send / Receive \(Needs to be enabled in settings\) * LN Connection: Eclair * Bitcoin Connection: Electrum * Channel Backup: Google Drive diff --git a/tutorials/nodes/ion-drive.md b/tutorials/nodes/ion-drive.md new file mode 100644 index 0000000..d1e43ef --- /dev/null +++ b/tutorials/nodes/ion-drive.md @@ -0,0 +1,4 @@ +# ION Drive + +ION drive is do-it-yourself Lightning Node utilizing an Odroid Home Cloud single board computer. + diff --git a/tutorials/nodes/lighting-at-home.md b/tutorials/nodes/lighting-at-home.md new file mode 100644 index 0000000..d0af5d6 --- /dev/null +++ b/tutorials/nodes/lighting-at-home.md @@ -0,0 +1,200 @@ +# Lightning at Home + +## Overview + +This guide will explain how to set up a working Lightning Network node at home, consisting of Bitcoin Core \(mainnet\) and [Lightning Network Daemon](lnd.md) \(LND\). Running a Lightning Network node \(such as LND\) requires a [backend blockchain watcher](lnd.md#chainwatcher-backends) \(such as Bitcoin Core\) in order to see what on-chain transactions are occurring. The second half of this guide shows how to connect the two, as well as add the [Zap Desktop](../wallets/zap-desktop.md) graphical user interface to your node. + +We've included specific details for each step, with the assumption that users are not completely comfortable with using the CLI \(Command Line Interface\). Given the stage of the network, creating a local, secure Lightning Network node will require a small amount of CLI interaction. + +The Bitcoin blockchain is large and continues to grow, so we recommend at least 250 GB of free disk space. If you want to sync either Bitcoin Testnet or Litecoin you'll need [significantly less space](lnd.md#chainwatcher-backends). Downloading the blockchain is the longest part of the entire process \(anywhere from a few hours to a number of days\), while installing and connecting LND and Zap Desktop should take 10-20 minutes. + +## Set up Bitcoin Core + +{% embed url="https://bitcoin.org/en/download" caption="" %} + +When you download Bitcoin Core, you'll be prompted to review space requirements and specify a data directory \(where the blockchain is saved\). In this example we'll use the default directory. + +* Linux: `~/.bitcoin` +* OSX `~/Library/Application\ Support/Bitcoin` +* Windows `C:\Users\\AppData\Roaming\Bitcoin` + +![](../../.gitbook/assets/lnd-home-00.png) + +Start! You'll see this screen on startup below, and it can take some time to migrate to the status screen. Don't be discouraged if it hangs while working slowly in the background. You can always check debug.log to see the details. + +![](../../.gitbook/assets/lnd-home-01.png) + +Wait... Depending on your computer, internet connection, or external hard drive, this can take anywhere from a few hours to a week. + +![](../../.gitbook/assets/lnd-home-02.png) + +## Configure Bitcoin to work with LND + +Running Bitcoin Core does not open certain connections for LND by default. Bitcoin Core uses a file called `bitcoin.conf` that contains settings that allow the software to talk with LND. For those familiar with editing `bitcoin.conf`here is what's needed: + +```text +# server=1 tells bitcoind to accept JSON-RPC commands +server=1 + +# Enable publish raw block in
+zmqpubrawblock=tcp://127.0.0.1:28332 + +# Enable publish raw transaction in
+zmqpubrawtx=tcp://127.0.0.1:28333 + +# On client-side, you add the normal user/password pair to send commands: +rpcuser=rpcuser_here_844585 + +# change this password +rpcpassword=rpcpassword_here_12574 +``` + +Another way is to download the bitcoin.conf provided below. You can open it in any text editor. + +{% file src="../../.gitbook/assets/bitcoin.conf" caption="bitcoin.conf" %} + +We have to ensure this configuration file is in the correct directory for Bitcoin Core to find it. Start by going to your bitcoin directory. + +![](../../.gitbook/assets/lnd-home-02b.png) + +![](../../.gitbook/assets/lnd-home-02c.png) + +Add `bitcoin.conf` to that directory. + +![](../../.gitbook/assets/lnd-home-02d.gif) + +Restart Bitcoin Core. It should now be able to connect to LND once we have both running. + +## Download LND + +[LND](lnd.md), or the Lightning Network Daemon, is the software that interacts with other users on the Lightning Network. There are a few ways to install LND: + +* From Releases: [https://github.com/lightningnetwork/lnd/releases](https://github.com/lightningnetwork/lnd/releases) +* From Source: [https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md](https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md) + +In this example, we'll download the the latest release. Select the correct version for your operating system. + +![](../../.gitbook/assets/lnd-home-03.png) + +The download directory should include both `lnd` and `lncli` + +* `lnd`: Runs the daemon +* `lncli`: Interacts with the daemon + +![](../../.gitbook/assets/lnd-home-04.png) + +## Start LND + +For those familiar with editing `lnd.conf`here is what's needed: + +```text +bitcoin.active=1 +bitcoin.mainnet=1 +bitcoin.node=bitcoind +bitcoind.rpcuser=rpcuser_here_844585 +bitcoind.rpcpass=rpcpassword_here_12574 +bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 +bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333 +``` + +Another way is to add it into the command used to run LND. This is where you'll have to step into the terminal for a brief moment. + +* Make sure bitcoin core is running +* Open terminal +* Drag `lnd` into the terminal from your finder/explorer window +* Paste:`--bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --bitcoind.rpcuser=rpcuser_here_844585 --bitcoind.rpcpass=rpcpassword_here_12574 --bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 --bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333` +* Press Enter +* Keep this terminal window open + +![](../../.gitbook/assets/lnd-home-05.gif) + +Here is a summary of what each of those flags mean: + +* `--bitcoin.active` connects to the bitcoin chain \(instead of litecoin\) +* `--bitcoin.mainnet` connects to mainnet \(instead of testnet\) +* `--bitcoin.node=bitcoind` connects to the bitcoind backend +* `--bitcoind.rpcuser` is the rpc username in bitcoin.conf +* `--bitcoind.rpcpass` is the rpc password in bitcoin.conf +* `bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332` is the socket which sends rawtx notifications from bitcoind +* `bitcoind.zmqpubrawblock=tcp://127.0.0.1:28333` is the socket which sends rawblock notifications from bitcoind + +There should be a prompt that says:`Waiting for wallet encryption password. Use lncli create to create a wallet, lncli unlock to unlock an existing wallet, or lncli changepassword to change the password of an existing wallet and unlock it.` + +## Create a Lightning Network wallet + +Now you have LND up and running, it's time to set up a wallet. + +* Open a new terminal window \(or new tab\). +* Drag `lncli` into the terminal. This lets the terminal know you're entering an LND command. +* Type `create` and press enter. +* Create a password. Your password must be at least 8 characters. Note that you won't see any of your password characters as you type them, but LND will ask you to confirm your password a second time. +* LND will ask if you have a passphrase. You can enter 'n' here, or enter a passphrase for extra security \(your password unlocks your wallet, whereas your passphrase is used for encryption and decryption\). +* Save your seed phrase! This is necessary for recovering your on-chain wallet if LND is lost or uninstalled. + +![](../../.gitbook/assets/lnd-home-07.gif) + +## Verify LND's connection + +Once you've created your wallet we need to check that everything is working. We'll use a command called `getinfo` to see our node's information. + +Run your first command! + +* drag `lncli` into the terminal +* type `getinfo` + +![](../../.gitbook/assets/lnd-home-08.gif) + +And you're off! + +## Connect to Zap Desktop \(optional\) + +If interacting through the command line interface is not your thing, then let's connect to [Zap Desktop ](https://wiki.ion.radar.tech/tutorials/wallets/zap-desktop). This will give you a functional GUI to check your on and off-chain balance, as well as your channels. + +Make sure `lnd` is running before connecting. + +Download Zap wallet: [https://zap.jackmallers.com/](https://zap.jackmallers.com/) + +Create a new wallet. + +![](../../.gitbook/assets/lnd-home-09.png) + +Connect your own node. + +![](../../.gitbook/assets/lnd-home-10.png) + +### Connection details \(default\): + +* Linux + * Host: `localhost:10009` + * TLS Certificate: `~/.lnd/tls.cert` + * Macaroon: `~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon` +* OSX + * Host: `localhost:10009` + * TLS Certificate: `~/Library/Application Support/Lnd/tls.cert` + * Macaroon: `~/Library/Application Support/Lnd/data/chain/bitcoin/mainnet/admin.macaroon` +* Windows + * Host: `localhost:10009` + * TLS Certificate: `C:\Users\\AppData\Roaming\Lnd\tls.cert` + * Macaroon: `C:\Users\\AppData\Roaming\Lnd\data\chain\bitcoin\mainnet\admin.macaroon` + +![](../../.gitbook/assets/lnd-home-11.png) + +You're connected! + +![](../../.gitbook/assets/lnd-home-12.png) + +## Post Setup + +Now you're wondering, "I ran through the installation process and got everything connected. What happens if I restart my computer?" + +You'll have to make sure that you start both pieces of software again, and unlock your wallet. + +* Start Bitcoin Core +* Start lnd + * `lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --bitcoind.rpcuser=rpcuser_here_844585 --bitcoind.rpcpass=rpcpassword_here_12574 --bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 --bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333` +* Unlock lnd + * `lnd unlock` + * or unlock with zap wallet + +![](../../.gitbook/assets/lnd-home-13.png) + diff --git a/tutorials/nodes/lnd.md b/tutorials/nodes/lnd.md new file mode 100644 index 0000000..a9224e5 --- /dev/null +++ b/tutorials/nodes/lnd.md @@ -0,0 +1,133 @@ +--- +latest-revision: '2019-01-27T00:00:00.000Z' +original-author: Ryan Shea (ryan-shea) +created: '2019-01-01T00:00:00.000Z' +status: Accepted +title: LND +contributors: Ryan Shea (ryan-shea); Gareth James (gjradar) +type: article +description: '' +discussions-to: GitHub URL +category: lightning-software +--- + +# LND + +The Lightning Network Daemon \(LND\) is a complete Golang implementation of a [BOLT](../../tech/lightning/basics-of-lightning-technology-bolt.md)-compliant Lightning Network node developed by Lightning Labs. It can connect to the Lightning Networks deployed on Bitcoin \(mainnet, testnet3\) and Litecoin \(mainnet, testnet4\). + +LND is open source software under [very active development on GitHub](https://github.com/lightningnetwork/lnd/projects/1): v0.1-alpha was released on January 11th 2017; v0.5-beta was released on September 18th 2018; v0.6-beta is expected in Spring 2019. + +## Implementation Details + +Lightning Labs is an active contributor to the BOLT standards and LND strives for compliance with these specifications. + +### Chainwatcher Backends + +Like all Lightning nodes, LND requires access to information stored in the blockchain in order to manage channels. LND accesses this information by connecting to a backend node that provides access to the chain. + +On supported blockchains, LND can use the following full nodes: + +* derived from Bitcoin Core: [bitcoind](https://github.com/bitcoin/bitcoin), [litecoind](https://github.com/litecoin-project/litecoin) +* derived from BTCsuite: [btcd](https://github.com/btcsuite/btcd), [ltcd](https://github.com/ltcsuite/ltcd) + +These full nodes must be fully synced with a transaction index database \(e.g. `bitcoind -txindex=1`\) , which requires a substantial amount of disk space: + +* bitcoin mainnet: 240 GB +* bitcoin testnet: 28 GB +* litecoin mainnet: 24 GB +* litecoin testnet: 2 GB + +As a lightweight alternative for mobile and other resource-constrained devices, Lightning Labs is developing a lightweight trust-minimizing privacy-preserving Bitcoin light client called [Neutrino](https://github.com/lightninglabs/neutrino). In contrast, Neutrino requires only a few hundred MB of storage. LND ships with Neutrino and can be configured to automatically launch and manage it when LND is started. Neutrino can theoretically run on the Mainnet today if it is able to find `btcd` full node peers that will serve it compact filters, but due to [known money-losing bugs](https://github.com/lightninglabs/neutrino/issues) this is strongly discouraged. A mainnet-ready Neutrino is expected later in 2019. + +### Client Capabilities + +As of February 2019, LND is capable of: + +* Creating channels. +* Closing channels. +* Completely managing all channel states \(including the exceptional ones!\). +* Maintaining a fully authenticated and validated channel graph. +* Performing path finding within the network, passively forwarding incoming payments. +* Sending outgoing [onion-encrypted payments](https://github.com/lightningnetwork/lightning-onion) through the network. +* Updating advertised fee schedules. +* Automatic channel management \(aka [`autopilot`](https://github.com/lightningnetwork/lnd/tree/master/autopilot)\) + +## Bash One-Liners + +LND ships with `lncli`, a tool for controlling LND in the command line. The outputs of `lncli` commands are often pages and pages of JSON that is hard to read. By using standard Bash tools, you can reprocess this output into something that is more readable. + +For these examples, you will need to install a small tool called [`jq`](https://stedolan.github.io/jq/) to process the JSON. In Debian/Ubuntu Linux, you can do this with `sudo apt install jq`. + +For instance, to view a **table of the payments your node routed** in 2019 \(use [epochconverter](https://www.epochconverter.com/) to go between Unix epoch time \(looks like `1552118735`\) and normal human time: + +```text +$ lncli fwdinghistory --start_time 1546300800 --end_time 9999999999 --max_events 10000000 | jq '.forwarding_events[] | "(.timestamp|tonumber|gmtime|todate) (.amt_out|tonumber) (.fee|tonumber)"' | awk 'BEGIN {printf "%6s %18s %8s %5s\n", "id", "time", "sats", "fee"} {printf "%6s %18s %8s %5s\n", NR, substr($1,2,16), $2, substr($3,1,length($3)-1)}' + + id time sats fee + 1 2019-01-01T19:28 1000 1 + 2 2019-01-01T19:28 2000 1 + 3 2019-01-02T19:39 151 1 + 4 2019-01-02T23:06 70 1 + 5 2019-01-02T23:08 151 1 +``` + +To view a simple **table of your channels,** including how the channel balance is divided between you and your channel peer and whether your peer is online and the channel is active: + +```text +lncli listchannels | jq '.channels[] | ["\(.remote_pubkey) \(.capacity) \(.local_balance) \(.remote_balance) \(.active)"] | @tsv'| awk 'BEGIN {printf "%19s %10s %10s %10s %7s\n", "peer", "capacity", "local", "remote", "active"} {printf "%19s %10s %10s %10s %7s\n", substr($1,2,16)"...", $2, $3, $4, substr($5,1,length($5)-1)}' + peer capacity local remote active +020398acf2628709... 4999823 4737659 258860 true +022decf2837abadd... 5375294 5371990 0 true +023ab7123987213a... 9000000 159998 8836166 true +024832efabc23786... 1000000 497948 498747 true +02438972abcd3966... 1000000 941894 53449 true +0242387974587aba... 1886031 63000 1819195 false +``` + +## Developer Resources + +We've written to \(relatively\) [**quickly and easily get set up on the Lightning Network with a Bitcoin full node**](lighting-at-home.md). + +Check out **Radar ION**, our all-in-one guide to joining and exploring the Lightning Network: + +{% embed url="https://ion.radar.tech/" caption="" %} + +Linux users can build LND from source with Go 1.11+: + +```text +go get -d github.com/lightningnetwork/lnd +cd $GOPATH/src/github.com/lightningnetwork/lnd +git checkout v0.5.2-beta +make && make install +``` + +For more information, including setting up a Go environment, see the official LND guide: + +{% embed url="https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md" caption="" %} + +Pierre Rochard has created an LND Node Launcher application for quickly and easily installing a Lightning Network node on Windows and MacOS. Check out this tool and the accompanying installation guide: + +{% embed url="https://github.com/lightning-power-users/node-launcher/" caption="" %} + +{% embed url="https://medium.com/lightning-power-users/windows-macos-lightning-network-284bd5034340" caption="" %} + +### RPC client implementations + +LND supports a Remote Procedure Call \(RPC\) interface for interacting with underlying functionality programmatically, methods documented [here](https://api.lightning.community). To interact with LND over RPC users can use their LND credentials \([macaroons](https://github.com/RadarTech/ionwiki/tree/88897b37c10cc3f027e7254bb86cb82cdf64e8ab/tutorials/nodes/tech/research/macaroons.md) and TLS\) to authenticate calls into their LND node. Several language-specific \(ie. Typescript, Python, Ruby\) client implementations have emerged to lower the barrier of developing on LND: + +{% embed url="https://github.com/RadarTech/lnrpc" caption="" %} + +{% embed url="https://github.com/willcl-ark/lnd\_grpc" caption="" %} + +{% embed url="https://github.com/ivanacostarubio/lightning\_network" caption="" %} + +## References + +1. [https://lightning.engineering/](https://lightning.engineering/) Lightning Labs homepage +2. [https://github.com/lightningnetwork/lnd](https://github.com/lightningnetwork/lnd) LND on Github +3. [https://dev.lightning.community/](https://dev.lightning.community/) developer resources for LND including talks, articles, and example applications +4. [https://api.lightning.community/](https://api.lightning.community/) [https://api.lightning.community/rest/](https://api.lightning.community/rest/) API documentation +5. [LND developers Slack chat](https://lightningcommunity.slack.com/join/shared_invite/enQtMzQ0OTQyNjE5NjU1LWRiMGNmOTZiNzU0MTVmYzc1ZGFkZTUyNzUwOGJjMjYwNWRkNWQzZWE3MTkwZjdjZGE5ZGNiNGVkMzI2MDU4ZTE) +6. CEO Elizabeth Stark - [Twitter](https://twitter.com/starkness), [GitHub](https://github.com/starkness) +7. CTO Olaoluwa Osuntokun - [Twitter](https://twitter.com/roasbeef), [GitHub](https://github.com/roasbeef) + diff --git a/tutorials/nodes/node-dashboards.md b/tutorials/nodes/node-dashboards.md new file mode 100644 index 0000000..fd3c792 --- /dev/null +++ b/tutorials/nodes/node-dashboards.md @@ -0,0 +1,53 @@ +--- +category: lightning-software +contributors: Gareth James (sirgarethjames) +created: 2019-04-05 +description: +discussions-to: +latest-revision: +original-author: "" +status: +title: Node Dashboards +type: article +--- + +# Node Dashboards + +## Overview + +Node dashboards are software that allow users to view or interact with a Lightning Network node without relying on the command line interface. They require the user to already have an instance of [LND](lnd.md), or the relevant Lightning Network daemon, running. They are not a substitute for LND or applications like [Zap Desktop wallet](../wallets/zap-desktop.md). + +## Details + +Included below are existing examples of node dashboard options. + +#### LND Explorer + +LND Explorer is a web interface for interacting with the Lightning Network \(via an underlying node\). They host demo nodes and a network graph explorer at [lndexplorer.com](https://lndexplorer.com/). + +{% embed url="https://github.com/altangent/lnd-explorer" %} + +#### LND Web Client (lncli-web) + +LND Web Client is a light-weight node monitoring and management solution that provides users a heads-up-display within their browser. It is written in NodeJS and Angular. + +{% embed url="https://github.com/mably/lncli-web" %} + +#### Ride The Lightning (RTL) + +RTL is a browser-based Lightning Network node dashboard designed to function across different device types. The home page furnishes information such as wallet balance, peers, channel balances, chain sync status, and other network information. It has a number of other pages that provide greater granularity and ability to manage the connected node. + +{% embed url="https://github.com/ShahanaFarooqui/RTL" %} + +#### Lightning Dashboard (lndash) + +Lightning Dashboard provides a basic, browser-based interface to view node information without additional visual detail. This includes standard identification data for a node, plus LND version details, simple peer & channel stats, and a pubkey QR code. Where lndash shines is in the more complex tabs on the dashboard: Channels, Events, Query, and Map. The Channels tab has some helpful metrics and graohs if you want to inspect, or even share, channel specific data. These include private metrics such as total payments within a channel, data sent and received, fee rate, min HTLC, time lock delta, and a simple slider bar for visualizing local and remote balance. + +{% embed url="https://github.com/djmelik/lndash" %} + +#### LND-For-WP + +A WordPress plugin that allows you to access your node from the administration panel. + +{% embed url="https://github.com/rstmsn/lnd-for-wp" %} + diff --git a/lightning-software/rust-lightning.md b/tutorials/nodes/rust-lightning.md similarity index 100% rename from lightning-software/rust-lightning.md rename to tutorials/nodes/rust-lightning.md diff --git a/tutorials/nodes/tor.md b/tutorials/nodes/tor.md new file mode 100644 index 0000000..d300792 --- /dev/null +++ b/tutorials/nodes/tor.md @@ -0,0 +1,223 @@ +--- +description: Improve your Lightning Network privacy and connectivity with Tor +--- + +# Lightning with Tor + +## Overview + +This tutorial explains how to install and run [Tor](https://www.torproject.org/) with [LND](lnd.md). This allows you to connect to the Lightning Network without revealing your IP address and therefore your location. As an added bonus, Lightning nodes on Tor can accept incoming connections from other nodes on Tor even if they are behind one or more routers and do not have a publicly-accessible IP address. + +Note that your privacy can be compromised if you do not also connect your backend node—`bitcoind` or `btcd`—to Tor. `bitcoind` will automatically seek out a Tor connection with a default configuration, but `btcd` requires some configuration. + +## Install Tor + +[Linux](https://www.torproject.org/docs/debian.html.en) + +```text +$ sudo apt install tor +``` + +[OSX](https://www.torproject.org/docs/tor-doc-osx.html.en) + +```text +$ brew install tor +``` + +**Verify installation** + +```text + $ tor --version +``` + +**Add Tor Configuration to** `torrc` + +* Linux: `/etc/tor/torrc` +* OSX: `/usr/local/etc/tor/torrc` + +```text + SOCKSPort 9050 + Log notice stdout + ControlPort 9051 + CookieAuthentication 1 +``` + +## Run Tor + +On any platform, this will work: + +```text +$ tor +``` + +If you are on Ubuntu or Arch Linux and you use `systemctl`: + +```text +sudo systemctl enable tor.service +sudo systemctl start tor.service +sudo systemctl status tor.service +``` + +## Configuring Your Node + +### LND with Tor + +Enable LND to connect to Tor: + +* `tor.active` allows LND to route through Tor +* `tor.v3` sets up a v3 onion service +* `tor.streamisolation` will create a new circuit for each connection +* `listen` to localhost to prevent unintentional leaking of identifying information + + ```text + $ lnd --tor.active --tor.v3 --listen=localhost --tor.streamisolation + ``` + + or update your `lnd.conf`: + +```text +[Tor] +tor.active=true +tor.v3=true +tor.streamisolation=true +listen=localhost +``` + +**Linux Permissions Issues** + +If you are on Ubuntu or Arch Linux, you may encounter a "cookie authentication error" when LND attempts to connect to Tor: + +`2019-02-18 01:23:27.503 [ERR] SRVR: unable to start server: unable to retrieve authentication cookie: open /var/lib/tor/control_auth_cookie: permission denied` + +You will need to make it possible for your user that runs LND to access the control cookie. + +Check and see what user is running Tor: + +`ps aux | grep tor` + +Now see what the permissions are on the control cookie listed in the error: + +`ls -lA /path/to/tor/cookie` + +**Debian and Ubuntu** + +Debian and Ubuntu's Tor control cookie is in `/var/run/tor/control.authcookie` and is readable by the `debian-tor` user and group. If you run LND with your regular user, try adding your regular user to the `debian-tor` group: + +`sudo usermod -a -G debian-tor yourusername` + +Log out and log back in again or run `sudo su - yourusername` to update your groups, then try running LND again and see if it can connect to Tor. + +**Arch Linux** + +Arch Linux's Tor control cookie is in `/var/lib/tor/control_auth_cookie` and is only readable by the `tor` user. One option is to add your user to the `tor` group and change the permissions on the directory to make it readable by members of the `tor` group: + +```text +sudo usermod -a -G tor yourusername +sudo chmod 750 /var/lib/tor +sudo chmod 740 /var/lib/tor/control_auth_cookie +``` + +**Tor for multi-LND systems** + +If you want to run multiple instances of LND simulaneously on the same machine and have them use different Tor Hidden Service addresses, add this to `lnd.conf` \(a new private key will automatically be created if the file specified here does not exist\): + +```text +tor.privatekeypath=/v3_onion_private_key +``` + +**Broadcasting Tor Address and Public IP** + +You can connect to Tor and also broadcast a public IP address so that your node can serve as a gateway between the Tor and public networks. **THIS DOES NOT PROVIDE YOU WITH ANY OF TOR'S PRIVACY ADVANTAGES.** To this, modify your `lnd.conf`: + +```text +listen=localhost: +externalip=: +``` + +You will then need to configure a reverse proxy from that `externalip` address and port to localhost at that port specified in `listen`. + +If you are running a version of LND newer than [this addition](https://github.com/lightningnetwork/lnd/pull/2490), skip the reverse proxy and use this in your `lnd.conf`: + +```text +listen=localhost: +externalip=: +``` + +**Verifying LND success** + +You have LND configured correctly when you see this message when LND starts: + +`2019-02-18 05:34:47.906 [INF] SRVR: Proxying all network traffic via Tor (stream_isolation=true)! NOTE: Ensure the backend node is proxying over Tor as well` + +**Verify LND Node Information** + +Get your public key + +```text + $ lncli getinfo | grep identity_pubkey + + "identity_pubkey": "0346095e50ed1f8cf4dbda1fca442cd2ebccf082912e33c1c2e19868f1f56a190a", +``` + +Get node information about your public key + +```text + $ lncli getnodeinfo 0346095e50ed1f8cf4dbda1fca442cd2ebccf082912e33c1c2e19868f1f56a190a + + { + "node": { + "last_update": 1548783346, + "pub_key": "0346095e50ed1f8cf4dbda1fca442cd2ebccf082912e33c1c2e19868f1f56a190a", + "alias": "0346095e50ed1f8cf4db", + "addresses": [ + { + "network": "tcp", + "addr": "b53ztxul4vdcktgcgmvcvgjigi2vq2hy4ah6wg7frqpiiesdoxozx3ad.onion:9735" + } + ], + "color": "#3399ff" + }, + "num_channels": 7, + "total_capacity": "11732911" + } +``` + +Verify that your `addr` is an `onion` address \(ending in '.onion' as above\) + +### BTCD with Tor + +Setup is not as self-explanatory as LND, so read the official Tor guide for BTCD: + +{% embed url="https://github.com/btcsuite/btcd/blob/master/docs/configuring\_tor.md" caption="" %} + +It looks like BTCD does not support v3 onion services: + +{% embed url="https://github.com/btcsuite/btcd/issues/1070" caption="" %} + +If you're a Golang person, submit a PR! + +## Connect to Tor Nodes + +Connecting to a Tor node is the same as connecting to any other node: `publicKey@address:port` + +Example: + +```text +lncli connect 0346095e50ed1f8cf4dbda1fca442cd2ebccf082912e33c1c2e19868f1f56a190a@b53ztxul4vdcktgcgmvcvgjigi2vq2hy4ah6wg7frqpiiesdoxozx3ad.onion:9735 +lncli openchannel --node_key 0346095e50ed1f8cf4dbda1fca442cd2ebccf082912e33c1c2e19868f1f56a190a --local_amt 20000 +``` + +Alternatively: + +```text +lncli openchannel --node_key 0346095e50ed1f8cf4dbda1fca442cd2ebccf082912e33c1c2e19868f1f56a190a --connect b53ztxul4vdcktgcgmvcvgjigi2vq2hy4ah6wg7frqpiiesdoxozx3ad.onion:9735 --local_amt 20000 +``` + +Looking for Tor nodes to connect to? 1ML has a filter for that: + +{% embed url="https://1ml.com/node?order=capacity&iponionservice=true" caption="" %} + +## Reference + +[https://github.com/lightningnetwork/lnd/blob/master/docs/configuring\_tor.md](https://github.com/lightningnetwork/lnd/blob/master/docs/configuring_tor.md) + diff --git a/tutorials/routing-nodes.md b/tutorials/routing-nodes.md new file mode 100644 index 0000000..b906c01 --- /dev/null +++ b/tutorials/routing-nodes.md @@ -0,0 +1,78 @@ +--- +description: Lightning nodes that run popular Lightning apps and services +--- + +# Nodes To Connect To + +These nodes have lots of channels funded with lots of bitcoin. Nodes that also host Lightning Network apps and services have a strong incentive to have good uptime and will tend to have larger volumes of inbound payments, so their channels with other nodes will tend to have both sending and receiving capacity. Connect to them and you can route payments through them to large swathes of the Lightning Network graph. See the [1ML list by capacity](https://1ml.com/node?order=capacity) for other large nodes. + +Note that without additional information, it is not possible to know whether a node is actually run by the individual or company that it is named after—anyone can name a node anything. A representative _can_ prove that they control a particular Lightning node by signing a message with the private key that corresponds to the node's public key, e.g. in LND with `lncli signmessage `. + +### Y'alls + +Y'alls is a Lightning-powered forum run by Alex Bosworth, an engineer at Lightning Labs. + +{% embed url="https://1ml.com/node/03e50492eab4107a773141bb419e107bda3de3d55652e6e1a41225f06a0bbf2d56" caption="" %} + +### Bitrefill + +Bitrefill is a merchant that sells store credit and vouchers, bill payments, gift cards, cell phone minutes, and more for Lightning payments. + +{% embed url="https://www.bitrefill.com/" caption="" %} + +{% embed url="https://1ml.com/node/030c3f19d742ca294a55c00376b3b355c3c90d61c6b6b39554dbc7ac19b141c14f" caption="" %} + +### Lightning Roulette + +{% embed url="https://lightning-roulette.com/" caption="" %} + +{% embed url="https://1ml.com/node/031678745383bd273b4c3dbefc8ffbf4847d85c2f62d3407c0c980430b3257c403" caption="" %} + +### OpenNode + +Opennode is a custodial Lightning payment processor. + +{% embed url="https://www.opennode.co/" caption="" %} + +{% embed url="https://1ml.com/node/03abf6f44c355dec0d5aa155bdbdd6e0c8fefe318eff402de65c6eb2e1be55dc3e" caption="" %} + +### zigzag.io + +ZigZag is a Shapeshift-like exchange that uses Lightning payments for the Bitcoin side of the exchange. + +{% embed url="https://zigzag.io/" caption="" %} + +{% embed url="https://1ml.com/node/0232e20e7b68b9b673fb25f48322b151a93186bffe4550045040673797ceca43cf" caption="" %} + +### tippin.me + +tippin.me is a custodial Lightning web wallet with Twitter login. + +{% embed url="https://tippin.me/" caption="" %} + +{% embed url="https://1ml.com/node/03c2abfa93eacec04721c019644584424aab2ba4dff3ac9bdab4e9c97007491dda" caption="" %} + +### Bottle Pay + +Bottle Pay is a custodial Lightning web wallet which supports integration with multiple online accounts, such as Twitter, Instagram and Reddit. + +{% embed url="https://about.bottle.li" caption="" %} + +{% embed url="https://1ml.com/node/033025e6701f5266d5c7d83859d032213708e50430c82602b8d02d152c91853811" caption="" %} + +### ACINQ + +This node is a large-volume and high-uptime Eclair node run by ACINQ, the creators of the [Eclair node software](nodes/eclair.md). This node is the default connection recommended to [Eclair Mobile](wallets/eclair-mobile.md) users. If you are able to establish receiving capacity from this node, you will have a short path to reliably receive payments from many Eclair Mobile users. + +{% embed url="https://1ml.com/node/03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f" caption="" %} + +### Satoshi Labs + +Satoshi Labs is the creator of the Trezor hardware wallet. We have not confirmed that this node is actually run by Satoshi Labs. + +{% embed url="https://1ml.com/node/0279c22ed7a068d10dc1a38ae66d2d6461e269226c60258c021b1ddcdfe4b00bc4" caption="" %} + +### LNBIG + +LNBIG is an unknown entity that has set up dozens of Lightning Network nodes and used dozens of bitcoin to fund thousands of channels across the Lightning Network. You will notice several LNBIG nodes on the [list of top capacity nodes](https://1ml.com/node?order=capacity). The owner of LNBIG, as verified by a messaged signed by an LNBIG node key, sometimes posts messages in the [Y'alls forum](https://yalls.org/). Because LNBIG doesn't offer any services, its channels tend to all be outgoing and unbalanced. Whether you want to connect to this entity is up to you—they cannot steal Bitcoin in your Lightning channels, but their identity and intentions are unknown and they are a source of centralization in the Lightning Network. + diff --git a/tutorials/stores.md b/tutorials/stores.md new file mode 100644 index 0000000..c218e4d --- /dev/null +++ b/tutorials/stores.md @@ -0,0 +1,134 @@ +--- +description: Use Lightning to buy stuff +--- + +# Lightning Stores + +Want to buy physical goods with Lightning? Check out these stores. + +Other great sources of Lightning stores: + +* [https://ion.radar.tech/apps](https://ion.radar.tech/apps) +* [https://www.lapps.co/](https://www.lapps.co/) +* [https://lightningnetworkstores.com/](https://lightningnetworkstores.com/) + +Want your store to be added to this article? Check out our [Guide to Contributing](../wiki-basics/contributing.md) and get on it! + +## Buy Gift Cards + +Gift cards are cash-like, so buying gift cards on the Lightning Network is essentially a form of exchange. + +Opening a channel and then spending some of the money on gift cards is an excellent way to [bootstrap liquidity](bootstrapping-liquidity.md) for your Lightning wallet. + +### Fold + +![earning satsback on the Fold app](../.gitbook/assets/screenshot_20191129-170112.png) + +Buy gift cards with Lightning or a credit card and receive cashback in Lightning BTC. It's `satsback`! + +With the Fold app right on your phone, use the gift cards you buy to pay for stuff in person! + +If you don't sign up for an account and pay for all cards with Lightning BTC, Fold preserves your privacy. + +{% embed url="https://foldapp.com/" %} + +### Bitrefill + +Buy gift cards and vouchers with Lightning + +{% embed url="https://www.bitrefill.com/?hl=en" %} + +### Coincards + +Buy gift cards with Lightning + +{% embed url="https://coincards.ca/" %} + + + + + +## Buy Services + +Some services, especially those that value and preserve your privacy, have begun accepting Lightning payments! + +### TorGuard + +Buy a VPN subscription with Lightning + +{% embed url="https://torguard.net" %} + +### Bitclouds VPS + +Rent a virtual private server with Lightning! + +{% embed url="https://bitclouds.sh/" %} + + + + + +## Buy Stuff + +By stuff with Lightning! Especially bitcoin-related stuff. + +### Blockstream + +Lightning stickers and t shirts + +{% embed url="https://store.blockstream.com/" %} + +### Moonstuff + +Buy Bitcoin novelty items + +{% embed url="https://www.moonstuff.co/" %} + +### Bitcoinshirt.co + +Bitcoin shirts + +{% embed url="https://bitcoinshirt.co/" %} + +### Ludvig Manukyan + +Bitcoin Art + +{% embed url="https://ludvigart.com/" %} + +### LightningAuction + +Bid on Lightning... with lightning! + +{% embed url="https://lightningauction.net/" %} + +### NeverFiat + +Buy t-shirts and other goods + +{% embed url="https://neverfiat.com/" %} + +### YYBazaar + +Buy clothing and other accessories + +{% embed url="https://yybazaar.com/lightning-network/" %} + +### Cryptoids + +Bitcoin-specific merch + +{% embed url="https://www.cryptoidshop.com/" %} + +### Hipptee + +Crypto t shirts using Lightning + +{% embed url="https://hipptee.com/" %} + +### JoltFun + +Buy video games with Lightning + +{% embed url="https://joltfun.com/" %} + diff --git a/troubleshooting/README.md b/tutorials/troubleshooting/README.md similarity index 100% rename from troubleshooting/README.md rename to tutorials/troubleshooting/README.md diff --git a/troubleshooting/error-codes.md b/tutorials/troubleshooting/error-codes.md similarity index 95% rename from troubleshooting/error-codes.md rename to tutorials/troubleshooting/error-codes.md index 96c5239..7ae57fa 100644 --- a/troubleshooting/error-codes.md +++ b/tutorials/troubleshooting/error-codes.md @@ -15,7 +15,7 @@ category: lightning-troubleshooting ## Overview -**Error codes** can be encountered when sending a payment or interacting with the Lightning Network via an [implementation](../lightning-software/implementations-of-lightning-network.md). +**Error codes** can be encountered when sending a payment or interacting with the Lightning Network via an [implementation](../nodes/). ## Details diff --git a/troubleshooting/payment-failures.md b/tutorials/troubleshooting/payment-failures.md similarity index 100% rename from troubleshooting/payment-failures.md rename to tutorials/troubleshooting/payment-failures.md diff --git a/tutorials/troubleshooting/public-nodes.md b/tutorials/troubleshooting/public-nodes.md new file mode 100644 index 0000000..5959b5f --- /dev/null +++ b/tutorials/troubleshooting/public-nodes.md @@ -0,0 +1,46 @@ +--- +description: publicly-accessible LN nodes requesting incoming connections +--- + +# Public Nodes + +Also see this page for tips on bootstrapping your Lightning payment receiving capacity: + +{% page-ref page="../bootstrapping-liquidity.md" %} + +And consider adding your node to this inbound liquidity request board: + +{% embed url="https://singles.shock.network/" %} + +## Checking Connectivity + +If you are on mainnet, the easiest way to check if your node is publicly accessible is to fill out the form on LightningTo.Me: + +{% embed url="https://lightningto.me/" %} + +If your node is accessible, you will immediately receive an inbound channel for 2,000,000 satoshis. + +## Public IP Nodes + +When adding a node below, please include: + +* pubkey and address +* which blockchain +* node software type and version +* planned uptime +* any services hosted on this node \(Lightning apps, stores, tip sites, &etc\) + +#### lnd.ion.radar.tech + +03d5e17a3c213fe490e1b0c389f8cfcfcea08a29717d50a9f453735e0ab2a7c003@lnd.ion.radar.tech:9735 +Bitcoin testnet, LND v0.5.1 +100% uptime; hosts [https://ion.radar.tech](https://ion.radar.tech) onboarding site + +## Tor Nodes + +#### Random Laptop + +033129be67b54e3ff405335c189c66478ba06840da2515f34af709644fb4642c2c@lwa3ljckbeaqxjvy5l55duj5z3e5hhbj3ba4f6pkb3n2bxzly4gmqvqd.onion:9735 +Bitcoin testnet; LND v0.5.2 +moderate uptime; Tor testing only + diff --git a/tutorials/troubleshooting/static-channel-backups.md b/tutorials/troubleshooting/static-channel-backups.md new file mode 100644 index 0000000..4d5bd95 --- /dev/null +++ b/tutorials/troubleshooting/static-channel-backups.md @@ -0,0 +1,116 @@ +# Static Channel Backup + +## Overview + +Static channel backups is a way of backing up state channels. Users will be able to safely claim their on-chain _and_ _off-chain_ funds in case something goes wrong. + +### Problem + +> I accidentally deleted my lightning app and lost my channels. How can I safely recover my funds? + +Accidentally deleting a lighting app or moving it to another machine can be stressful since funds are both on-chain and off-chain. Recovering on-chain funds should be as simple as importing the seed phrase. Unfortunately, [using the seed phrase will not recover off-chain funds](https://wiki.ion.radar.tech/tech/channels/channel-backups). Recovering off-chain funds requires keeping track of the state of the channel but if the channel is outdated, then that can be seen as malicious. Below are ways to backup and recover on-chain and off-chain funds. + +### Solution 1 \(Not recommended\): Back Up channel.db + +A possible solution is to backup `channel.db` every time there's a routed payment. This method can be risky because the state of the channels may not be up to date. If a user unknowingly broadcasts an old state, then the other party can punish the user by taking all of their funds. + +### Solution 2: Static Channel Backups \(SCB\) + +_Note: SCB is available in lnd ^v0.6._ + +Instead of trying to maintain the latest channel state, the static channel backup package will attempt to notify remote peers to force close their channel. This will prevent users from accidentally broadcasting an old state and allow them to close out and receive their local balance. + +### How SCB It Works + +Instead of trying to maintain the latest channel state, the static channel backup package will attempt to notify remote peers to force close their channel. This will prevent users from accidentally broadcasting an old state and allow them to safely close out and receive their local balance. + +* User gets their 24 seed phrase +* User uses `lncli create` to input their seed phrase and recover their wallet + * This allows the user to access their on-chain funds + * Now it's time to access your off-chain funds +* The lnd `chanbackup` package will + * Initiate the data loss protection \(DLP\) protocol to mark channels as "recovered" + * Insert a `LinkNode` to attempt to connect to establish connections to all previous peers +* Once connected to a remote peer + * Remote peer will send their latest un-revoked commitment point to derive keys + * Remote peer will force close the channel +* User can now safely sweep the funds. This will transfer off-chain funds to the on-chain wallet \(backed up by the seed phrase\). + +### How to Backup/Recover: channel.backup + +There are several ways to backup the static channels. One way is to store a copy of `channel.backup` and your seed phrase. + +The `channel.backup` can be found in: + +`.lnd/data/chain/bitcoin/mainnet/channel.backup` + +There are [tools](https://gist.github.com/alexbosworth/2c5e185aedbdac45a03655b709e255a3) that will make a copy on change. + +If you accidentally delete your lightning app, create and restore your wallet using your existing seed phrase. This will recover your on-chain wallet. + +```text +$ lncli create + +Input wallet password: +Confirm wallet password: + +Do you have an existing cipher seed mnemonic you want to use? (Enter y/n): y + +Input your 24-word mnemonic separated by spaces: about memory oblige country brain news harsh recipe what label decide inject this enforce face sustain slice mansion rookie fox word win finger stove + +Input your cipher seed passphrase (press enter if your seed doesn't have a passphrase): +Input an optional address look-ahead used to scan for used keys (default 250): + +!!!YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!! + +---------------BEGIN LND CIPHER SEED--------------- + 1. about 2. memory 3. oblige 4. country + 5. brain 6. news 7. harsh 8. recipe + 9. what 10. label 11. decide 12. inject +13. this 14. enforce 15. face 16. sustain +17. slice 18. mansion 19. rookie 20. fox +21. word 22. win 23. finger 24. stove +---------------END LND CIPHER SEED----------------- + +!!!YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!! + +lnd successfully initialized! +``` + +Restore channels using `restorechanbackup`and the `channel.backup` file. + +``` +$ lncli restorechanbackup --multi_file /path/to/copied/channel.backup +``` + +This will notify remote peers to force close the channel. Off-chain funds will return to your on-chain wallet. You can now safely reopen channels. + +### How to Backup/Recover: ExportChanBackup + +Another way is to save the `exportchanbackup`. This will return: + +* `chan_points`: Are the on chain transaction hashes +* `multi_chan_backup`: Is used to backup the channels + +```text +$ lncli exportchanbackup --all +{ + "chan_points": [ + "bd517db739c55cbe13a8140a4dfdbb8e3b894b7396ee4e345ff15b0c535e8c92:0" + ], + "multi_chan_backup": "ed6de05fa60db305030c242b8bfd0c57f749814168791e3160d96a8b0be4d7ab25e72014b1a86f93519abd8f678cadae017d3532faa35f87ee7caa3e88906416c979a761ec4aa1fd429314e9d51cfbfb428b9247ef3eef85fe3f2c3512d4213830c483aec2900626a52d239eaabdc0e8c7a01ee0d6fbe11e38987ba2742efd284d527bb26d6b9db2aebcae9df67dc3639b213525420b6a534d0a3ac2bee6b371ff891d1f0d19085ec97184e25b3122afe338b3fda88a592607cc796ec5e7ee5ea9edd5c8fe0064793b7b551241681bc65a088ed5ab6638" +} +``` + +Create and restore your wallet using your existing seed phrase. + +Restore channels using `restorechanbackup`and the `multi_chan_backup` + +``` +$ lncli restorechanbackup --multi_backup ed6de05fa60db305030c242b8bfd0c57f749814168791e3160d96a8b0be4d7ab25e72014b1a86f93519abd8f678cadae017d3532faa35f87ee7caa3e88906416c979a761ec4aa1fd429314e9d51cfbfb428b9247ef3eef85fe3f2c3512d4213830c483aec2900626a52d239eaabdc0e8c7a01ee0d6fbe11e38987ba2742efd284d527bb26d6b9db2aebcae9df67dc3639b213525420b6a534d0a3ac2bee6b371ff891d1f0d19085ec97184e25b3122afe338b3fda88a592607cc796ec5e7ee5ea9edd5c8fe0064793b7b551241681bc65a088ed5ab6638 +``` + +### Resources + +[https://github.com/lightningnetwork/lnd/blob/master/docs/recovery.md](https://github.com/lightningnetwork/lnd/blob/master/docs/recovery.md) + diff --git a/troubleshooting/theft-on-lightning-network.md b/tutorials/troubleshooting/theft-on-lightning-network.md similarity index 100% rename from troubleshooting/theft-on-lightning-network.md rename to tutorials/troubleshooting/theft-on-lightning-network.md diff --git a/lightning-software/wallet/README.md b/tutorials/wallets/README.md similarity index 99% rename from lightning-software/wallet/README.md rename to tutorials/wallets/README.md index 48b1e70..d02ed0e 100644 --- a/lightning-software/wallet/README.md +++ b/tutorials/wallets/README.md @@ -11,7 +11,7 @@ discussions-to: GitHub URL category: lightning-software --- -# Wallet +# Lightning Wallets ## Overview diff --git a/lightning-software/wallet/eclair.md b/tutorials/wallets/eclair-mobile.md similarity index 93% rename from lightning-software/wallet/eclair.md rename to tutorials/wallets/eclair-mobile.md index ba28fad..29d275e 100644 --- a/lightning-software/wallet/eclair.md +++ b/tutorials/wallets/eclair-mobile.md @@ -11,7 +11,7 @@ discussions-to: GitHub URL category: lightning-software --- -# Eclair +# Eclair Mobile ## Overview @@ -25,7 +25,7 @@ category: lightning-software * Platforms: Android * Networks: BTC, tBTC -* Capabilities: Send +* Capabilities: Send / Receive \(Needs to be enabled in settings\) * LN Connection: Eclair * Bitcoin Connection: Electrum * Channel Backup: Google Drive diff --git a/lightning-software/wallet/shango.md b/tutorials/wallets/shango.md similarity index 100% rename from lightning-software/wallet/shango.md rename to tutorials/wallets/shango.md diff --git a/lightning-software/wallet/zap-desktop.md b/tutorials/wallets/zap-desktop.md similarity index 91% rename from lightning-software/wallet/zap-desktop.md rename to tutorials/wallets/zap-desktop.md index ddf868d..8597f58 100644 --- a/lightning-software/wallet/zap-desktop.md +++ b/tutorials/wallets/zap-desktop.md @@ -29,11 +29,11 @@ Zap supports autopilot configuration, remote node connection, BTCPay support, an ![Screenshot from Zap Desktop on macOS](../../.gitbook/assets/zap-screenshot2.png) -Zap walks users through the creation of a wallet on install. Users progress through a traditional user flow, creating a wallet and backing up the seed phrase. Zap also has [autopilot](../../lightning-channels/channel-opening.md#autopilot) functionality. +Zap walks users through the creation of a wallet on install. Users progress through a traditional user flow, creating a wallet and backing up the seed phrase. Zap also has [autopilot](../../tech/channels/channel-opening.md#autopilot) functionality. ### Tech Stack -Zap is built with Electron, React, and Redux on top of the [`lnd`](../lnd/) implementation of the Lightning Network. +Zap is built with Electron, React, and Redux on top of the [`lnd`](../nodes/lnd.md) implementation of the Lightning Network. ## Resources diff --git a/wiki-basics/content-license.md b/wiki-basics/content-license.md new file mode 100644 index 0000000..959b6a6 --- /dev/null +++ b/wiki-basics/content-license.md @@ -0,0 +1,55 @@ +# Platform & Content License + +## Content Storage + +The content in ION Wiki lives in GitHub: [https://github.com/RadarTech/ionwiki](https://github.com/RadarTech/ionwiki) + +Anyone can make a local copy! This is a significant advantage: + +* your contributions won't be lost if a Mediawiki database goes offline +* straightforward porting between platforms that support Git-backed content storage +* contribute through the GitBook UI or your interface of choice using GitHub pull requests + +## Choosing GitBook + +After evaluating a dozen potential platforms for this wiki, we selected GitBook. + +Advantages: + +* GitBook supports editing in Markdown. +* GitBook supports Git-backed content storage. +* GitBook has a modern design and mobile friendliness. +* GitBook supports simple sign-in with GitHub or Google accounts. +* GitBook has rapid and responsive support. +* Because the Lightning Network is an open source software project, GitBook has allowed us to invite contributors to this wiki without paying the usual [per-user fees](https://www.gitbook.com/pricing). + +Disadvantages: + +* GitBook is a hosted solution. +* GitBook is not free and open source software. +* GitBook does not have a plugin system—the features it ships with are the features you get. +* GitBook is not as well-known, so contributors are less likely to be familiar with it. +* GitBook has limited user and content management tools. + * e.g. users can't edit in the GitBook UI without signing up. + * e.g. edits by certain users can't require approval before going live. + * e.g. pages can't be protected from editing. + +In total, we believe that the advantages outweigh the disadvantages for this particular project. We will continue to evaluate other projects, like the upcoming [wiki.js v2](https://github.com/Requarks/wiki) beta, to see if they are a better fit. + +If you have questions, comments, or concerns about this choice, join the discussion in [Telegram chat](https://t.me/radarion). + +## Content License + +{% hint style="info" %} +[Read the full text of the CC-BY-4.0 license](https://github.com/RadarTech/ionwiki/blob/master/LICENSE) +{% endhint %} + +The content on Ion Wiki is licensed with **CC-BY-4.0, the Creative Commons 4.0 Attribution license**. In addition to the full text, read this [human-readable summary](https://creativecommons.org/licenses/by/4.0/) by Creative Commons. In summary: you can share and remix this content, even for commercial purposes, as long as you give appropriate credit and indicate if changes were made. + +We considered several other licenses, and several other Creative Commons variants, before settling on this license. Licenses we did **not** select include: + +* [CC-BY-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/), adds a "share-alike" clause. We don't restrict how derivative works are licensed. +* [CC-BY-NC-4.0](https://creativecommons.org/licenses/by-nc/4.0/), adds a "noncommercial" clause. We don't restrict how derivative works are used. + +If you have questions, comments, or concerns about this choice, join the discussion in [Telegram chat](https://t.me/radarion). + diff --git a/wiki-basics/contributing.md b/wiki-basics/contributing.md new file mode 100644 index 0000000..267d77f --- /dev/null +++ b/wiki-basics/contributing.md @@ -0,0 +1,46 @@ +# How To Contribute + +## Thank You! + +This wiki is made possible by the content contributed by Lightning Network enthusiasts. + +[**Top contributors on GitHub**](https://github.com/RadarTech/ionwiki/graphs/contributors)\*\*\*\* + +## Contribute With GitBook + +Contribute within seconds using the GitBook UI: + +1. Contact us via [Telegram](https://t.me/radarion), [Twitter](https://twitter.com/radar_ion), or [email](mailto:outreach@ion.radar.tech). Tell us what excites you about Lightning, and we'll give you an invite link! +2. [Sign into GitBook.](https://www.gitbook.com/login/radarrelay/wiki?no_sso=guest) Use your GitHub account, Google account, or email and password. +3. Click "Create A Draft". +4. Create new pages and edit existing ones. +5. Click "Save". +6. Click "Describe this draft" and add a description. +7. Click "Merge" to make your changes live, click "Archive" to stash your changes for later, or just leave your draft for someone else to review and merge. + +Discuss content, edits, and organization in the [Telegram chat](https://t.me/radarion), open [an issue on GitHub](https://github.com/RadarTech/ionwiki/issues), or email us at [outreach@ion.radar.tech](mailto:outreach@ion.radar.tech). + +## Contribute With GitHub + +If you'd prefer to write content in Markdown and submit pull requests on GitHub, the wiki content lives here: [https://github.com/RadarTech/ionwiki](https://github.com/RadarTech/ionwiki) + +A Markdown page template is available to get you started: [https://github.com/RadarTech/ionwiki/blob/master/template.md](https://github.com/RadarTech/ionwiki/blob/master/template.md) + +New to contributing to open source projects? Learn more: + +* [Open Source contribution guides](https://opensource.guide/) +* [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) +* [Make a Pull Request on GitHub](http://makeapullrequest.com/) +* [Writing Markdown on GitHub](https://help.github.com/categories/writing-on-github/) + +## Requested Content + +* Lightning for Litecoin +* C-Lightning and Eclair +* Information about devtools like WebLN, LN-service, &etc +* More wallets +* More Lightning applications +* &etc + +Discuss other content you'd like to see or contribute in the [Telegram chat](https://t.me/radarion), open [an issue on GitHub](https://github.com/RadarTech/ionwiki/issues), or email us at [outreach@ion.radar.tech](mailto:outreach@ion.radar.tech). +