# Local and remote in a channel going together

For example:
I open 3 channels (A, B and C) and put on each channel 100.000 sat
D opens a channel with me also 100.000 sat.

So… my additional local balance is local 300.000 and remote 100.000 in total 400.000 sat

Example 1)
I spend 50.000 sat for a nice coffee
After this my local balance is 250.000 sat and my remote is 150.000 sat. Total 400.000 sat.
when I will close all channels at this point I will receive 250.000 sat back, because I spent 50.000 from my 300.000 to a coffeeshop. thats clear!

Example 2)
D, who opened a channel with me spends 70.000 sat to someone else. (My Channel C transferred the Bitcoins to a third party.)
channel A,B are unchanged (100.000 local and 0 remote)
But channel D is now 70.000 local and 30.000 remote
My Channel C changed to 30.000 local and 70.000 remote.
All in all 230.000 local and 170.000 remote. in total 400.000 sat.
How much will I receive at this time when I close all channels at this time? I didn’t spent any Bitcoin by my self. Do I get 300.000 sat ?

Can anyone explain this ?

If D sent you 70k your C channel wouldn’t change. So your actual balance in the second example should be 370k local and 30k remote if I understood your example correctly. Because in the second example you only received 70k sats and didn’t send anything right?
So in that case you should receive 370k after closing all your channels.

If you would open a channel C that is funded on both sides with 100k sats, then the channel would have 200k in total, 100k local and 100k remote.
Then someone sends you 70k sats on that channel the balance would be 170k local and 30k remote.

Hi Alko89, my description was not good.

D, who opened a channel with me spends 70.000 sat to someone else. My Channel C transferred the Bitcoins to a third party.

That means:
Channel D is now 70.000 local and 30.000 remote
My Channel C changed to 30.000 local and 70.000 remote, because I transfer 70.000 to a third party.

So What do I get when I close all channels? Thats not clear for me.

Ahh I see. So he transfered 70k sat to someone else via your channel C using his channel D.
You would be left with the same amount. You have 100k sats funded in channel C (to someone else) and he has 100k sats funded to you in channel D .
When he wants to pay 70k sats the node will check for a route to the destination. the node will find a route from 1 node -> D channel -> C channel -> 2. node. So first the node will send 70k to you through channel D and you will forward these funds to channel C.
The remaining balance would be:
D channel would have 70k local and 30k remote
C channel would have 30k local and 70k remote
A and B channels wouldn’t change and each would have 100k sats
Your local balance doesn’t change it just gets rebalanced to different channels. After the tx you would still have 300k sats.