August 26, 2022

LI-6800

This day was long and boring... At least it was spent in an air conditioned room... I've listened to a lot of podcasts while I was doing this experiment...



August 18, 2022

Lightning Network Local and Remote Reserve Balance

Another lesson learned today... If you don't have much experience with Lightning Network, you may find this behavior strange, and think that something is broken...

Imagine you have two nodes, and you open a channel from one node to the other, say 100000 sats... You have 100000 local and 0 remote... Then to test if everything is okay you send 1000 sats through the channel, and it works instantly and with 0 fee... Excellent, you think to yourself, and you try to move those 1000 sats back...

"failure reason": "FAILURE_REASON_NO_ROUTE"

What? It's connected directly... What do you mean, stupid program?..
You type payinvoice again, this time you set the output channel directly...

"failure reason": "FAILURE_REASON_INSUFFICIENT_BALANCE"

Ummm, what?.. Then you type listchannels, find the channel, and look closely...

"local_chan_reserve_sat": "1000"
"remote_chan_reserve_sat": "1000"

Yes, it will not let you do a transaction if it results in either of the ends of the channel to fall below the reserved amount (1% of the channel capacity)...

You send another 1000 sats, and try to get 1000 sats back... That should work, right?..

"failure reason": "FAILURE_REASON_INSUFFICIENT_BALANCE"

Ah, right, it also will not let the channel go below the commitment fee (that depends on current on-chain fees)... At the time it was 2005 sats...

Okay, you send 1100 sats in the same direction, it is now [96900 local - 3100 remote] and try to pay that 1000 sats invoice from the remote node again... And it finally succeeds because the resulting balance (2100) was above both the reserved amount (1000) and the commit fee (2005)...

Now the question is: what if I want to close a channel with all the funds on one side, and no leftover balance on the other side?.. Is there a way to do it?.. Is it possible to make the channel [100000 local - 0 remote] again?.. According to Lightning protocol - no...

Not until eltoo is implemented: https://www.youtube.com/watch?v=cVML_uQxvwg
It will also make watchtowers much simpler and cheaper, but that's another story…

Chicory

 


August 16, 2022

Desire to have a reference sheet for my fursona

You know what I think… I really want to officially develop a fursona and get a reference sheet…
I've been a generic nondescript cougar for so long… Where do I start?..


August 14, 2022

LND balance oscillates all the time

It took me a while to notice… I was refreshing the Lightning Terminal window to see if I get new routed payments through the node, and then I saw that the balance was going down steadily a couple hundred sats at a time… At first I thought "What the hell? Why does my balance steadily go down? Is there a bug that leads to me losing sats?"… Then it went up again…

Hmmmmm???

Live and learn… Apparently, LND keeps track of the average on-chain fees and adjusts the reserved amount of sats in each channel to be able to force close them in case of emergency… It works as intended, it's not a bug and it's not hacked… The state of the mempool changes with each new block mined, therefore the reserved amount changes as well… I think I even saw a "fee estimation method" setting in LND… And the more channels you have open the bigger the visible changes in your total balance will be…

I was worried for no reason…