getumbrel / umbrel-lightning

The official Lightning Node app for Umbrel, powered by LND.
https://umbrel.com
Other
16 stars 8 forks source link

Calculate and display net available satoshi balance on Lightning 'Send' payment screen #34

Open rstmsn opened 2 years ago

rstmsn commented 2 years ago

At present, the Lightning wallet balance displayed to the user is calculated by summing the gross total of all local channel balances. This total is inclusive of each open channels 'local reserve' amount. According to the protocol spec, the local/remote reserve amount is retained in the channel, to ensure both parties continue to have monetary stake in the channel, and thus are discouraged from cheating. As the local reserve amount cannot be spent, it is confusing to the end user who see's a Lightning balance of, for example, 80,000 satoshis, and who attempts to settle an invoice for 80,000, only to be told that they have 'insufficient balance'. If the user were to look more deeply, he would likely see that his local channel balance is indeed 80,000 satoshis, however his local channel reserve is, for sake of example, 12,000 satoshis. Therefore, his actual 'available to spend' balance is 68,000.

My suggestion here is that the Lightning 'Send' UI be updated to indicate to the user both their gross local balance (so the user does not overlook channel funds tied up in reserve), and their actual 'available to send' balance.

available_to_send = (local_balance - local_reserve)

2022-04-09 22 22 08