Skip to content
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

Open
D3lBoy-00 opened this issue May 11, 2023 · 8 comments

Comments

@D3lBoy-00
Copy link

D3lBoy-00 commented May 11, 2023

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!

  • Please someone explain to me why didn't channel work/why couldn't I send/receive anything even though my channel was live and funded?
  • And what's the reason for almost 20€ (507 sats) closing fee, even though network fees are cca 40 sats?

To explain photos

  1. Taken last night, channel opened but not confirmed
  2. Taken few hours ago after closing a channel, before that it looked the same, only the status was "OPEN" and Can Send was 0 btc, Can receive 0 btc.
  3. As you can see no transactions were ever made (I covered the IDs because i don't know if that should be public)
  4. After channel was closed, you can see the fee of almost 507 sats, or 17.5€.... So funding the channel and closing the channel was around 30€ total, yet the channel didn't work.
  5. Actual block fee at the time

Please explain what's going on?

1
2
3
4
Bez naslova

@SomberNight
Copy link
Member

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

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 update_fee message (to handle unexpected mempool fee spikes, see "fee spike buffer").

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 bitcoin-cli estimatesmartfee 2 estimates (via the electrum server), which can often be significantly higher than mempool-based estimates (that you see on mempool.space).

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".
related #8413

Firstly, I've had to fund the channel with 0.002BTC to open a channel, and I did.

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.

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).

The fee estimate used for cooperative closes is the same bitcoin-cli estimatesmartfee 2. You are correct that it would be nice if the GUI allowed the user to select a feerate instead. (though it is not so simple as there is actually a negotiation between the two channel counterparties, it is not simply the client's choice)

@D3lBoy-00
Copy link
Author

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.
Disappointing

@SomberNight
Copy link
Member

SomberNight commented May 11, 2023

I still cannot understand why i wasn't able to send or receive anything through my funded channel?

It is natural you were not able to receive.
Consider Alice opening a channel to Bob, by sending 1 BTC to the funding multisig address. Initially, Alice has 1 BTC in the channel, and Bob has 0. At that point Bob cannot send to Alice, i.e. Alice cannot receive, as Bob does not have any money.
Let's say Alice sends 0.1 BTC to Bob. Now Alice has 0.9 BTC and Bob has 0.1 BTC. Now Bob has some coins he can send, hence now Alice can receive (up to 0.1 BTC minus channel reserve).

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 0.9-1/100-(2*500*200)/10**8=0.888 BTC. That is, Alice has a balance of 900 mBTC but cannot send more than 888 mBTC. In this example the channel reserve is 10 mBTC and the onchain fees are 2 mBTC.

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.)

Also I didn't try to force-close the channel, but a cooperative cancellation (since i'm the only one in the channel)

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.

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.

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.

@xeverse
Copy link

xeverse commented May 11, 2023

And why does Electrum pick the insanely high fee without noticing or asking me first?
yeah negotiate feerate but not with me-myself, no close confirm notif either; instantaneous suprise..

https://medium.com/coinmonks/different-ways-to-close-a-lightening-payment-channel-a11bbe4ed486
This transaction has a $0.67 fee, while the collaborative close (mentioned earlier) has a $0.06 fee.
Force closes have higher fees because they use a time-critical pre-signed transaction.

so basically such creepy design was needed because apparently ln proto says --
one can always be robbed of insane txfee (coz opener always pays for close) in case of
mempool Frenzy which has been happening lately because of force-close feature on the other-side..

Soo how high as a kite the obscure fee-spike-buff claw-back for force instead of coop?
has been in xelectrum we've been wondering now.. 10x? times 2x estimatesmart?

is this why perhaps i see a hundredd-greenbacks diff
these have been taken ghostage & in limbo state right now..

& 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..
or better run a ln-node coz electrum isn't quite the same since no incoming chans that
would require a full btc daemon node tho which sux. zeusln-lnbits-lnnode-btcnode..
& we chose xelectrum in the 1place coz of that very spv light proto & ln testnet..
so that neutrino must be somewhat similar to spv or something?

& lastbutnotleast there's a -- jujustice no less tx on top of it all..
https://bitcoinmagazine.com/technical/bitmex-research-confirms-lightning-justice-works
Let’s consider the never-ending transactional affair between Alice and Bob.
& we havent even touched these watchtowers yet..

@tomaspecl
Copy link

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.

@one2three4f
Copy link

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

@Ericrowlowland
Copy link

Ericrowlowland commented Sep 8, 2023 via email

@one2three4f
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@xeverse @tomaspecl @SomberNight @D3lBoy-00 @Ericrowlowland @one2three4f and others