Author

Topic: Electrum funds stuck in lightning. Unable to force close channel (Read 236 times)

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
-snip- I get these issues in Electrum 0df05dd (master as of today), but in my case the funding transaction doesn't appear in my wallet. What could that mean? How do I fix it?
The "funding transaction" isn't even available in the blockchain: 963e417c937bbd97d4e66ad3127f8168f24a4bf38cdaefc427c96922c2e5795d
I'm thinking that it may be an invalid channel in the first place, may be created in the wallet but the funding transaction was dropped from the mempools later on.

I got the funding transaction from your screenshot in GitHub.
sr. member
Activity: 506
Merit: 253



I get these issues in Electrum 0df05dd (master as of today), but in my case the funding transaction doesn't appear in my wallet. What could that mean? How do I fix it?

I opened GitHub issue #7583 8 days ago but haven't received any response yet.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
-snip-
AFAIK, that output's script should have another public key (for the other party's wallet) that can spend it without waiting for the set time.
The RSMC output of the commitment transaction can be spent immediately only using a combination of Electrum trampoline's and OP's revocation keys for that particular transaction. Once the timeout has expired, the output can be also spent using OP's private key. I explained it in detail here.
I think you're right, I've only checked the script in a commitment transaction, it has a RSMC output with this script (can be seen when spent):
Code:
IF
"public_key1"
ELSE
"timeout" CHECKSEQUENCEVERIFY DROP
"public_key2"
ENDIF
CHECKSIG

Okay so, "public_key1" is the "revocation key" (not electrum trampoline's public key)
which can only be spent by deriving its private key from "electrum trampoline's" "revocation_basepoint_secret" and his "per_commitment_secret".


What I'm concerned with is: his wallet might fail to spend the "to_local" output because of the issue.
In that case, if manually editing the wallet file didn't work, he can still coordinate with the owner of Electrum trampoline to recover his funds.
legendary
Activity: 1876
Merit: 3132
@ Rath_: nice catch, eagle eyes.  How could that have happened?  Was there an automatic RBF when he opened the channel?

No idea. RBF on the opening transaction adds a lot of complexity. That's why it's not available in Electrum. I believe that LND simply performs CPFP if there is a change output. C-lightning uses RBF only if both nodes follow the (experimental) dual-fund/v2 open protocol.

AFAIK, that output's script should have another public key (for the other party's wallet) that can spend it without waiting for the set time.

The RSMC output of the commitment transaction can be spent immediately only using a combination of Electrum trampoline's and OP's revocation keys for that particular transaction. Once the timeout has expired, the output can be also spent using OP's private key. I explained it in detail here.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
Looks like the channel was already forced-closed by the other party or your recent attempts because the output of: txn 138223... was already spent by txn 258a0b...
The output is P2WSH which likely has "OP_CSV" indicating that it's indeed a result of "force-close" channel.
(Based form the txns, your wallet is P2WPKH)

That's just minutes after your (OP's) last reply and before Rath_'s reply.

Normally, the wallet should automatically create a local transaction with a label: "our_ctx_to_local " to prepare to redeem your funds after the set time in the script.
If you can see a local transaction like that in the history, then it's all good.


Nothing?
You can try Rath_'s suggestion and the wallet might create that said transaction after a few restarts/hours.
(I've experienced something similar in testnet after manually editing a channel or I just imagined it)

If not and about a day has passed, you can create an issue in GitHub (link) and they may be able to return your funds since AFAIK, that output's script should have another public key (for the other party's wallet) that can spend it without waiting for the set time.
Good thing it's "electrum trampoline" which might be owned by one of the devs.
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
~

Just to add to what Rath_ said, if your wallet is protected by a password you'll have to decrypt it (remove password protection) before you can edit it.

@ Rath_: nice catch, eagle eyes.  How could that have happened?  Was there an automatic RBF when he opened the channel?
legendary
Activity: 1876
Merit: 3132
I have just realised something. Your funding outpoint for some reason contains a different (not valid) transaction ID rather than the actual funding transaction. I guess that you could get that channel to work by modifying it manually!

Close Electrum, go to %appdata%\Electrum\wallets and open your wallet file in some text editor. Find the following piece of text:

Code:
"funding_outpoint": {
"output_index": 0,
"txid": "963e417c937bbd97d4e66ad3127f8168f24a4bf38cdaefc427c96922c2e5795d"
},

Replace it with:

Code:
"funding_outpoint": {
"output_index": 0,
"txid": "13822376273207cb13b598f3a9f5b8cc957fae2041c45c0e190c0716948344cb"
},

Save the file and launch Electrum.
legendary
Activity: 1876
Merit: 3132
After i ran electrum again few hours later, the channel opening transaction was confirmed.

Are you sure about that? Double click on that channel, copy the funding outpoint and look it up in any block explorer. It looks as if the funding transaction has never been broadcast. Also, if Electrum trampoline knew about this channel, there would be a valid channel id.

Edit: Clarification: the short channel ID includes the blockheight at which the transaction was confirmed. So, if the funding transaction has never been broadcast/confirmed, there is no short channel id.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Can you see the funding transaction? Are you certain the funds have actually left your wallet - check the transaction history?
jr. member
Activity: 57
Merit: 25
Hi,

I recently tried to use lightning network for the first time. I created new channel then i think i left electrum before channel open transaction confirmed.

After i ran electrum again few hours later, the channel opening transaction was confirmed.
However the channel state is "reestablishing" for long time now




I tried to use force close channel but i get following error:



Any ideas what can be done to release the funds or make the channel working?
Jump to: