Bitcoin Forum

Bitcoin => Electrum => Topic started by: Geremia on December 16, 2023, 06:35:20 PM



Title: Import a Bitcoin Core private key into Electrum wallet that supports Lightning?
Post by: Geremia on December 16, 2023, 06:35:20 PM
Why can't I import a Bitcoin Core private key into an Electrum wallet that supports Lightning?
Running importprivkey in the Electrum console, I get:
Quote
Error: This type of wallet cannot import private keys. Try to create a new wallet with that key.
When I create a new Electrum wallet with the private keys, why is Lightning disabled for that wallet?


Title: Re: Import a Bitcoin Core private key into Electrum wallet that supports Lightning?
Post by: Charles-Tim on December 16, 2023, 06:49:22 PM
You can generate a seed phrase, keys and addresses on Electrum and send your coins that you want to use to open a channel there. If you think the fee is too expensive, use ViaBTC free accelerator. If you can not use ViaBTC accelerator, you can let us know your txid. Make sure the transaction size is not more than 500 byte (not 500 vbytes).


Title: Re: Import a Bitcoin Core private key into Electrum wallet that supports Lightning?
Post by: nc50lc on December 17, 2023, 07:21:15 AM
Why can't I import a Bitcoin Core private key into an Electrum wallet that supports Lightning?
Running importprivkey in the Electrum console, I get:
Quote
Error: This type of wallet cannot import private keys. Try to create a new wallet with that key.
It used to be possible in the older version but the devs decided to disallow it in v2.0.
Refer to this commit: https://github.com/spesmilo/electrum/commit/4ce699bf2570a4478c1f467f676c46e42f63f2b4 (https://github.com/spesmilo/electrum/commit/4ce699bf2570a4478c1f467f676c46e42f63f2b4)

That's probably because it breaks the purpose of the seed phrase backup since the imported keys wont be recoverable from it.
And managing the HD derived keys and the imported keys was a mess.


Title: Re: Import a Bitcoin Core private key into Electrum wallet that supports Lightning?
Post by: tbct_mt2 on December 20, 2023, 11:12:33 AM
Did you try to sweep your Bitcoin Core private key to Electrum wallet?

Sweeping your private keys into Electrum (https://bitcoinelectrum.com/sweeping-your-private-keys-into-electrum/)
Transferring coins from Bitcoin-Qt to Electrum (https://en.bitcoin.it/wiki/Transferring_coins_from_Bitcoin-Qt_to_Electrum)

When you have your coins in Electrum, you will have to open your Lightning Network channel.
Electrum Lightning Network walkthrough (https://bitcointalk.org/index.php?topic=5259973.0)

More topics on Lightning Network
[Table] All Lightning Network Threads In One Place (https://bitcointalk.org/index.php?topic=5345664.0)


Title: Re: Import a Bitcoin Core private key into Electrum wallet that supports Lightning?
Post by: nc50lc on December 20, 2023, 11:40:41 AM
I just found out that OP also posted this in Electrum's GitHub repo as a new issue which is closed without getting any sufficient answer.
Link: https://github.com/spesmilo/electrum/issues/8751 (https://github.com/spesmilo/electrum/issues/8751)

When I create a new Electrum wallet with the private keys, why is Lightning disabled for that wallet?
I'm uncertain on this answer so I only answered one question in my previous reply (CMIIAW):
Electrum's lightning wallet requires a master private key where the private keys to be used in your lightning transactions' HTLC (Hashed Timelock Contract).
It can't rely on imported keys since it'll eventually run out of available unused keys after few transactions and reusing those isn't an option because it's unsafe to reuse used keys in old HTLC.