Bitcoin Forum
November 13, 2024, 07:06:51 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Electrum wallet to Core wallet  (Read 96 times)
babelfish42 (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 5


View Profile
December 04, 2023, 06:50:04 AM
Merited by o_e_l_e_o (4), ABCbits (1)
 #1

Hello, I need to import a wallet that I have in Electrum into Bitcoin Core. 

I have exported the private key from electrum. But when I try importprivkey 'privatekeyfromelextrum'. I get only legacy wallets are supported by this command....

Thanks for your help!
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6393


Self-proclaimed Genius


View Profile
December 04, 2023, 07:03:18 AM
Merited by o_e_l_e_o (4), ABCbits (2), apogio (2)
 #2

Use importdescriptors command followed by the descriptor containing your WIF private key with checksum and timestamp.
For example (native SegWit):
Code:
importdescriptors "[{\"desc\": \"wpkh(privatekeyfromelextrum)#checksum\", \"timestamp\":0}]"

To get the correct checksum, use the command, getdescriptorinfo.
For example:
Code:
getdescriptorinfo "wpkh(privatekeyfromelextrum)"

If your address is legacy from old version of Electrum, replace "wpkh" with "pkh".

The importprivkey command will work if you create a non-descriptor wallet but Bitcoin Core will soon drop support for such wallet format
so it's better to learn those descriptor wallet-comaptible commands.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
DifDrama
Jr. Member
*
Offline Offline

Activity: 35
Merit: 33


View Profile
December 04, 2023, 09:09:44 AM
 #3

nc50lc has already provided a great answer to your question. I just wanted to add that the official Bitcoin Core documentation offers comprehensive insights into commands, usage, and wallet management. You can access it here: https://bitcoincore.org/en/doc/
babelfish42 (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 5


View Profile
December 04, 2023, 01:02:48 PM
Last edit: December 04, 2023, 01:13:40 PM by babelfish42
 #4

The private key appears to be a p2pkh.  Does that change anything?

This wallet was originally a Zelcore wallet that exports the private keys is WIF format.

Thank you!
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18747


View Profile
December 04, 2023, 01:19:16 PM
 #5

Private keys don't specify a script type, but if you want to recover a P2PKH address beginning with "1", then just change from wpkh to pkh in nc50lc's instructions above.

Run getdescriptorinfo to get the checksum, then importdescriptors with the calculated checksum.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!