# How does circular rebalance on LN work?

How does circular rebalance on LN work? (note: circular rebalance is term used in RTL, I use lnd). Let me describe the situation that happened to me:

I have two channels, one with Alice, one with Bob.

The situation before circular rebalance from my point of view:

``````Me    (200) sats outbound -----[400]----- (200) sats inbound         Alice
Me    (200) sats outbound -----[200]----- (0)   sats inbound         Bob
``````

Then I initiated a circular rebalance of 100 sats on the the second channel with Bob and I was asked to choose "receive from peer" where I chose Alice

The situation after the circular rebalance from my point of view (supposing no routing fees):

``````Me    (300) sats outbound -----[400]----- (100) sats inbound         Alice
Me    (200) sats outbound -----[300]----- (100) sats inbound         Bob
``````

My overall outbound capacity increased by 100 sats while overall inbound capacity stayed at 200 sats. Did I just make 100 sats? Did I cheat Alice?

Solution (It was my misunderstanding, I'm answering here because Rene's answer is really good and I want to keep it):

Basically, my outbound capacity decreased on the channel with Bob by the expected amount but the commit_fee on that channel rose by 100 and since I thought that my outbound capacity + commit fee are my disposable funds I thought of them as a overall outbound capacity which is not obviously the case.

What actually happened: The situation before circular rebalance from my point of view:

``````Me    (200) sats outbound {100} commit fee -----[500]----- (200) sats inbound         Alice
Me    (400) sats outbound {100} commit fee -----[500]----- (0)   sats inbound         Bob
``````

The situation after the circular rebalance from my point of view (supposing no routing fees):

``````Me    (300) sats outbound {100} commit fee-----[500]----- (100) sats inbound         Alice
Me    (300) sats outbound {200} commit fee-----[500]----- (100) sats inbound         Bob
``````

if your channel's are initially as you described (just depicted here again with better readability using total cpacity of the channel in brackets in the middle of the channel and the respective local balance on the side of the peer)

``````You -(200) --------[400] -------- (200) - Alice
You -(200) --------[200] ---------- (0) - Bob
``````

And you create a circular rebalance of 100 sats the result schould (in an ideal world ignoring routing fees) look as follows:

``````You -(300) --------[400] -------- (100) - Alice
You -(100) --------[200] -------- (100) - Bob
``````

Thus your total local balance should have stayed the same as the total capacity of the channels should not have changed. Of course you pay the routing fees for such an operation so in reality the result might look a little bit more like

``````You -(298) --------[400] -------- (102) - Alice
You -(100) --------[200] -------- (100) - Bob
``````

This means that you had sent out 100 set to Bot Bob and others have probably decreased the amount to forwards a little bit so that you will only receive for example 98 on your channel with alice.

The situation that you discribe in which you magically have 500 sats instead of 400 can / should not happened with a rebalancing operations. Are you sure that:

1. noone sent you 100 sats on the channel with Alice at the same time
2. You did not earn 100 sats of routing fees on that channel with alice at the same time?

Thus I would kindly ask you to reproduce the operation..

• I reproduced the case and you are right. I did not gain 100 sats to my outbound capacity. My confusion arose from the fact that I added the commit_fee to my outbound capacity. So outbound capacity + commit_fee != channel capacity? Commented Sep 30, 2020 at 12:00
• Basically, my outbound capacity decreased on the channel with Bob by 100 sats but the commit_fee on that channel rose by 100 and since I thought that my outbound capacity + commit fee are my disposable funds I thought of them as a overall outbound capacity which is not obviously the case. Commented Sep 30, 2020 at 12:11
• bitcoin.stackexchange.com/questions/83305/… helps you to get a better understanding of capacity and balance (aka outbound capacity). The commitment fee is explained at: bitcoin.stackexchange.com/questions/89232/… it can be high and changes. So in general you should have something like capacity = commitfee + local Balance (outgoing capacity) + remote Balance (aka: incoming capacity). Though the fee is only taken from your balance if you opened the channel Commented Sep 30, 2020 at 12:27
• Specific and unregular thing about it is that my channel with Bob after the rebalancing is like this: capacity + circular rebalance amount = commitfee + local Balance (outgoing capacity) + remote Balance (aka: incoming capacity) Commented Sep 30, 2020 at 12:52