What is the difference between wallet balance, local balance and remote balance in the Lighting Network? I am having a hard time understanding the difference between the different &quot;balances&quot; in the Lighting Network. For example, I am running an LND node and I have the following balances:
$ lncli walletbalance
{
    &quot;total_balance&quot;: &quot;13841305&quot;,
    &quot;confirmed_balance&quot;: &quot;13841305&quot;,
    &quot;unconfirmed_balance&quot;: &quot;0&quot;
}
 
$ lncli listchannels | jq -r '.channels[].local_balance' | awk '{sum+=$1} END {print sum}'
4201392
 
$ lncli listchannels | jq -r '.channels[].remote_balance' | awk '{sum+=$1} END {print sum}'
23804004

What is the difference between the local balance and the wallet balance?
If my node forwards a transaction, where do the fees go, in the wallet, or in local?
In each of your channels, you have a local balance. This is the balance that is yours in that channel. The counterparty of the channel has the remote balance. All lightning transactions change these balances with each one resulting in their sum being the same and matching the channel capacity. As all transactions in that channel just end up changing the balances, routing fees paid to you go into your local balance.
Your wallet balance is the total amount of funds that you control that are not in a channel. It's the sum of the UTXOs that you control.