-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lightning Can send 0, Can receive 0 - Insane unexplainable fee upon closing channel #8419
Comments
In lightning, the channel opener is responsible for paying the on-chain fees of closing the channel. To ensure that at any given time either party can close the channel, in any channel state, some part of the opener's balance is put aside to be used for the mining fees of closing the channel. Specifically, in addition to the normal "channel reserve" (typically 1% of capacity), the channel-opener cannot use some of its local balance that is used for paying the mining fee of the commitment transaction. The feerate used in this calculation is approx. twice the feerate of the channel that the two channel counterparties "negotiated" via the The feerate of the channel is supposed to be high enough to allow force-closing and getting it mined before any HTLC timelocks expire. For this, electrum uses Back of the envelope calculation, if the bitcoind fee estimate is 500 sat/vbyte, twice that due to the spike buffer is 1000 sat/vb; say the size of the commitment tx is 200 vbytes. That means the on-chain fee set aside from the local balance is ~200k sats, which is 2 mBTC. Basically your channel is just too small :( Clearly it is a shortcoming of the GUI atm that it does not clearly explain the difference between "can send" and "local balance".
The reason the code enforces a 2 mBTC minimum is precisely to try to avoid situations where much of the balance is locked up in future on-chain fees. When that hardcoded 2 mBTC value was picked, it was done as a compromise between how high fees likely might be and how small channels we should let users open for experimentation. In fact when fees were low, some users complained the 2 mBTC min limit is too high. Evidently, in the last few days it was too low.
The fee estimate used for cooperative closes is the same |
Thank you for your reply, however I still cannot understand why i wasn't able to send or receive anything through my funded channel? Also doesn't such insane fees defy the purpose of lightning aka "small transaction" payments? I've lost significantly more btc and time than if i just sent it on-chain. Also I didn't try to force-close the channel, but a cooperative cancellation (since i'm the only one in the channel) And not disclosing fee of 20€ (for nothing) before transaction is nothing short but a bad design that will cost people a lot of money. |
It is natural you were not able to receive. I went into quite some details in my previous reply as to why you were not able to send. But ok, consider again the Alice<->Bob channel. Say Alice has 0.9 BTC and Bob has 0.1 BTC. How much can Alice send? Certainly not more than 0.9 BTC. In fact, less than that. It is 0.9 BTC minus channel reserve minus onchain fees times two. Assuming the channel reserve is the usual 1%, and using an onchain feerate of 500 sat/vbyte, and an approx size of 200 vbytes for the commitment transaction that needs to be broadcast to close the channel, Alice can send up to With a channel capacity of 2 mBTC, the channel reserve is only ~2000 sats, but the onchain fees are still 2 mBTC. That is, Alice cannot send at all. And as I said before, Bob has a zero balance initially, so Alice cannot receive either. Basically the channel is so small that it is unusable when the mempool fees are this high. (EDIT: note that if you waited long enough for the mempool fees to go down, the onchain fees used in the calculation would have gone down, and "can send" would have increased.)
No, you are not the only one. In current lightning, every channel is between two parties. When doing a cooperative close, these two parties negotiate a feerate together. As I said, Electrum's target feerate for this, atm, is a 2-block ETA estimate, which can be significantly higher than mempool-based feerate-estimates, which you were looking at.
Yes, I agree. The GUI should tell the user at least an upper bound of how high the fees can be before starting the negotiation. |
https://medium.com/coinmonks/different-ways-to-close-a-lightening-payment-channel-a11bbe4ed486 so basically such creepy design was needed because apparently ln proto says -- Soo how high as a kite the obscure fee-spike-buff claw-back for force instead of coop? is this why perhaps i see a hundredd-greenbacks diff & i can't find my chans in the .space or 1ml index for some reason why? @SomberNight Ghos7 (i'magHostmyself) thanXx for the details & he is in em.. з.ы. oh well-helll we just need to find a spv serv which would faithfully report 0 estimate.. & lastbutnotleast there's a -- jujustice no less tx on top of it all.. |
I had a similar issue on android version. I made a channel from ~300k sat but it said that I can only send ~30k sat. But then I later opened the "close channel" menu and then exited the menu again. That somehow refreshed it and then I saw that I can send ~170k sat. I would like to know why did that help. And perhaps you should add some sort of refresh button. |
Somehow this fixed it |
Have you you resolved the issue
|
I'm honestly not sure what fixed it, maybe right clicking the opened LN channel and selecting force close and then cancelling, maybe just waiting a while, maybe refreshing Electrum, but later when I tried to send out, the error message (Something along the lines can't send, channel balance 0) didn't appear and I could send. |
Hi all,
I've used Electrum in the past, but I wanted to setup lightning wallet so i can transfer btc from exchange to Electrum without paying the high fees...
Firstly, I've had to fund the channel with 0.002BTC to open a channel, and I did. Since I don't know much about Lightning I wanted to experiment using all default settings in electrum which is creating a Electrum Trampoline channel. After paying pretty high fee (around 10€) I've finally created channel and it was open, kangaroo icon, (tried disabling gossip too), everything looked fine, except the next part: My channel capacity was 0.002btc but i could send 0 btc and receive 0 btc. After all that i've backed up the channel (not before). It's the latest version of Electrum downloaded from electrum.org.
Like I've said, i've tried reconnecting, disabling trampoline, waiting for lightning icon to go up to 100%... but still nothing. I've hopped onto reddit and saw that other people are experiencing the same issue, so i decided that it is too much hassle and tried to close the channel.
There was force close option, and close option, i picked the latter because it said that the fees are lower that way. Only to immediately find out that Electrum placed a fee of 507 sats/byte which was around 20€... I immediately looked onto mempool, and saw that all blocks (new and past blocks) are around 40 sats/byte (see screenshot below).
So not only that I've payed over 30€ in fees in total - but the channel didn't work no matter what I did (googled everything). Ok you can argue that maybe I've setup something wrong (even though I've followed the setup from popular bitcoin talk post as is), but what's with the insanely high fees? And why does Electrum pick the insanely high fee without noticing or asking me first?
I'm really disappointed, because I've lost so much money recently, and just when i thought "ok i will learn lightning to avoid loosing money" - I lost again! Really frustrating, current mempool blocks are around 40-50 sats not 508!
To explain photos
Please explain what's going on?
The text was updated successfully, but these errors were encountered: