From decker.christian at gmail.com Thu Feb 8 23:11:24 2018 From: decker.christian at gmail.com (Christian Decker) Date: Fri, 09 Feb 2018 00:11:24 +0100 Subject: [Lightning-dev] channel rebalancing support kind of exists already? In-Reply-To: <5-r0g7Pox46kFZU_pNSirAPIwcDNSbYytEvrP1GSKsc6azP7ZfjBl0-cfHPRCVaxUIuxrhe4TSk2Jzc9tJFIlUAojPzGljm6EsOvgSr0wVU=@protonmail.com> References: <5-r0g7Pox46kFZU_pNSirAPIwcDNSbYytEvrP1GSKsc6azP7ZfjBl0-cfHPRCVaxUIuxrhe4TSk2Jzc9tJFIlUAojPzGljm6EsOvgSr0wVU=@protonmail.com> Message-ID: <87vaf7vzz7.fsf@gmail.com> Technically you can do it with c-lightning today, if you create a circular route manually and then use the `sendpay` JSON-RPC command to send funds along that route it'll do just that. It's as simple as that. We don't have built-in support yet, I don't know if we ever will, since it is trivially implemented outside of the daemon itself. I also don't think we need to consider this use-case at all from a protocol point of view. Cheers, Christian ZmnSCPxj via Lightning-dev writes: > Good Morning Robert, > > Yes, this already is possible, but is not implemented by any implementation to my knowledge at this point. > > Note that "balance" is not necessarily a property you might desire for your channels. In your example, under the "unbalanced" case, Bob can pay a 1.5BTC invoice, but in the "balanced" case Bob can no longer pay that 1.5BTC invoice. Of course, once AMP is possible then this consideration is not an issue. > > Regards, > ZmnSCPxj > > Sent with [ProtonMail](https://protonmail.com) Secure Email. > > -------- Original Message -------- > On February 7, 2018 12:53 AM, Robert Olsson wrote: > >> Hello >> >> Let's say Bob opens a channel to Alice for 2BTC >> Carol then opens a channel to Bob for 2BTC. >> Alice and Carol are already connected to Others (and/or eachother even) >> The network and channel balances will look like this: >> >> Alice 0--2 Bob 0--2 Carol >> | | >> +----- OTHERS ------+ >> >> Bob for some reason wants the channels to be balanced, so he has some better redundancy and it looks better. >> >> So hypothetically Bob solves this by paying himself an invoice of 1BTC and making sure the route goes out thru Alice and comes back via Carol. Bob pays fees so he isn't ashamed if it disturbs the other balances in the network. Should he care? >> >> Alice 1--1 Bob 1--1 Carol >> | | >> +----- OTHERS ------+ >> >> Now Bob has two nice balanced channels, meaning he has better connectivity in both directions. >> >> Doesn't the protocol already support that kind of solutions, and all we need is a function in the CLI allowing Bob to pay to himself, and specify which two channels he would like to balance? >> >> Maybe even make it automatically balance. >> >> Is this a good idea of something to support, and/or Is there a risk the entire network will start doing this and it will start oscillating? >> >> Best regards >> Robert Olsson > _______________________________________________ > Lightning-dev mailing list > Lightning-dev at lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev