From 8714a583d29b4744bb613bedc7f3961cebf220e6 Mon Sep 17 00:00:00 2001 From: nickfarrow Date: Mon, 10 Oct 2022 01:40:14 +1100 Subject: [PATCH] update readme --- README.md | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index dd82e6b..f8e1997 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,47 @@ # L[ightningPayJ]oin: Automated External Lightning Channel Funding -This server leverages Pay-to-Endpoint to negotiate channel funding on your lightning node from an external wallet supporting BIP78. Previously, external funding could only be done by [signing PSBTs manually](https://github.com/lightningnetwork/lnd/blob/master/docs/psbt.md). A node running this software can open a new scheduled lightning channel upon payment receipt from e.g. BTCPayServer with a normal QR scan transfer flow. +Loin leverages Pay-to-Endpoint (payjoin) to negotiate a channel open for your lightning node, initiated by any BIP78 supporting wallet. Previously, custom PSBT channel funding could only be done by [signing PSBTs manually](https://github.com/lightningnetwork/lnd/blob/master/docs/psbt.md). A node running Loin can open a new lightning channel for every received payment, provided the payer supports bip78. E.g. BTCPayServer or Blue wallet, following the normal QR scan transfer flow. Read the article about [Lightning Powered PayJoin](https://chaincase.app/words/lightning-payjoin?ref=github) to hear all the benefits! ## ⚠️ WARNING: ULTRA-EXPERIMENTAL SOFTWARE ❗️ **This project is pre-alpha quality and lacks basic checks. It is NOT fully BIP78-compliant** ❗️ -Any unexpecected node setup or message will likely cause permanent loss of funds. +Any unexpecected node version will likely cause permanent loss of funds. For the love of god, do NOT use it on mainnet just yet! If you don't want to wait long, help with reviews and PRs -## Benefits +### Expected fee savings -Read the article about [Lightning Powered PayJoin](https://chaincase.app/words/lightning-payjoin?ref=github). +In the traditional path for opening a lightning channel, you first must fund the LND wallet and then make a second transaction to fund the opening of the channel, a total of two transactions. +Loin however does this all in a single transaction, saving 106 vB (68 vB input + 22 vB script pubkey + 8 vB output amount + 4 vB version + 4vB timelock). -### Expected fee savings +If you wanted to fund a number of channels, say 10 channels, this would traditionally take 11 transactions. Loin can do this in a single transaction - saving 1060 vB. -The classic scenario of sending to LND wallet and then opening a channel involves two transactions. -With this software's PayJoin it involves just one transaction, saving 106 vB (68 vB input + 22 vB script pubkey + 8 vB output amount + 4 vB version + 4vB timelock). -Sending to a node and then opening 10 channels can turn 11 transactions into one, saving 1060 vB. -If someone were to pay you and you already scheduled to open channel openings, you would save too. -You will also save a shedload of time you would otherwise spend waiting for confirmations. +You can also schedule channel opens, such that when someone goes to pay you lightning channel funding transactions piggyback along with their payment. Again not only saving fees and also saving you a shedload of time since you don't have to wait for confirmations inbetween each successive channel open. (There's `--spend-unconfirmed`, but that has its own drawbacks) ### Expected privacy implications -If you open a channel with a usual LN wallet, common input heuristic makes a good assumption that the change belongs to the funder. -This tool breaks that assumption. It could now be a payer's change. -This tool may produce many changes. Because it breaks analytic assumptions regarding bitcoin transactions in general, many transactions on the network have a larger set of possible interpretations. +If you open a lightning channel the usual way, common input heuristic makes a good assumption that the change from this funding transaction belongs to the funder. +The payjoin provided by Loin breaks that assumption, where this change could now be the payer's change instead. + +Just as with any other PayJoin, it becomes unclear whether all inputs of a transaction belong to a single funder or whether there are indeed multiple parties funding the transaction. + +Because this tool breaks analytic assumptions regarding bitcoin transactions in general, using it will add transactions to the network which have a large set of possible interpretations and thus better privacy. -Just as with any other PayJoin, it's unclear whether all inputs belong to the funder or some of them don't. +### Future research +Sadly, I don't think the payer can also safely open a lightning channel using change from the transaction, but I have some ideas how it could be achieved in the future. -Sadly, I don't think the payer can safely open a channel from change(s) but I have some ideas how it could be achieved in the future. -If the channels were truly private it'd make analysis even more confusing (incorrectly assume it's one node). +If lightning channels were truly private, then this tool could make chain analytics even more confusing since heurestics may incorrectly assume a transaction funds a single node instead of two or even several. -Post-Taproot-LN it will be impossible to distinguish CoinJoin from batch open of several same-sized private channels. -Actually, CoinJoin and batch opening of several same-sized private channels could be one transaction. -Good luck analyzing that! +With Post-Taproot-LN it will be impossible to distinguish a CoinJoin from a batch open of several same-sized private channels. Actually, CoinJoin and batch opening of several same-sized private channels could be one transaction. Good luck analyzing that! ### UX implications -All this is possible without loin by [manually exchanging PSBTs](https://github.com/lightningnetwork/lnd/blob/master/docs/psbt.md). -BIP78 turns that tedious back and forth into scanning/clicking one link followed by confirmation in the wallet. -In other words, your grandmother will be able to somewhat privately open a bunch of channels for you, if she has a BIP78-capable wallet. +All of this is possible without loin by [manually exchanging PSBTs](https://github.com/lightningnetwork/lnd/blob/master/docs/psbt.md). +BIP78 turns that tedious back and forth into scanning/clicking one link, followed by confirmation in the wallet. +In other words, your grandmother will be able to somewhat privately open a bunch of channels for you, using her BIP78-capable wallet on her iPad. ## Limitations and future plans @@ -63,8 +61,8 @@ In other words, your grandmother will be able to somewhat privately open a bunch 0. You need Rust version 1.48 or higher to compile this. 1. You need LND v14.2 or higher 2. `cargo build [--features=test_paths]`. The test_paths feature will serve the `static/index.html` ui contained in this folder rather than one in `/usr/share/loin/static` in production. -3. Setup reverse HTTP proxy with HTTPS forwarding to some port - e.g. 3000. - You can do this in a few lines using [selfhost in Cryptoanarchy Debian Repository](https://github.com/debian-cryptoanarchy/cryptoanarchy-deb-repo-builder/blob/master/docs/user-level.md#selfhost). or [on MacOS](https://www.storyblok.com/faq/setup-dev-server-https-proxy) +3. Setup a reverse HTTP proxy with HTTPS forwarding to some port - e.g. 3000. + You can do this in a few lines using [local-ssl-proxy](https://www.storyblok.com/faq/setup-dev-server-https-proxy). 4. create a configuration file based on `config_spec.toml`. This is mine based on a [polar](https://lightningpolar.com/) lightning network simulator setup. `CONFIGURATION_FILE=loin.conf`: ```configuration