|
Title: ImportPrivKey Into Bitcoin Core Wallet Post by: Paleus on November 17, 2025, 02:26:41 AM How do I import a private key into a totally new iteration of Bitcoin Core? The private key I have is in plain text format (52 character hexadecimal string).
The command I am using is: importprivkey [52 character private key] The error the console is returning is: Only legacy wallets are supported by this command (error -4) What command should I use instead of importprivkey if that command isn't supported by the current version of Bitcoin Core? Thank you in advance for any assistance. Title: Re: ImportPrivKey Into Bitcoin Core Wallet Post by: noorman0 on November 17, 2025, 03:34:39 AM Yep the wallet format in Bitcoin Core has changed. The new Core defaults to using wallet descriptors.
Code: importdescriptors '[{"desc":"combo(Your_WIF-Key_here)#Checksum","timestamp":"now"}]'More details (https://bitcointalk.org/index.php?topic=5498210) Title: Re: ImportPrivKey Into Bitcoin Core Wallet Post by: nc50lc on November 17, 2025, 04:31:12 AM In the command above, you may set the "timestamp" to 0 or any unix timestamp to automatically trigger a rescan starting from that timestamp.
The value 0 will scan all of the blocks. If you use "now", it will just import it without rescanning, you may use rescanblockchain command if you need to rescan for related transactions. Title: Re: ImportPrivKey Into Bitcoin Core Wallet Post by: Paleus on November 17, 2025, 05:13:45 AM I just came across this thread: https://bitcointalk.org/index.php?topic=5475186.0 and it seems I am not the only one encountering this error.
I am, quite frankly, disappointed because this is the first technical problem I've ever encountered in my years of using bitcoin. Something as fundamental as importing/exporting private keys should not be a technical hurdle ... The different versions since Bitcoin Core v21 and beyond as not as compatible as they could be. I followed the instructions and inputted the recommended commands (importdescriptors). I am now running 'rescanblockchain 0' so that it can rescan the whole blockchain. Mod note: consecutive posts merged Title: Re: ImportPrivKey Into Bitcoin Core Wallet Post by: nc50lc on November 17, 2025, 05:43:43 AM I am, quite frankly, disappointed because this is the first technical problem I've ever encountered in my years of using bitcoin. Something as fundamental as importing/exporting private keys should not be a technical hurdle ... The different versions since Bitcoin Core v21 and beyond as not as compatible as they could be. You're not the only one, I saw a few threads with similar reactions to the new import/export format.It's less about the depreciation of the old command but the difference in the old and new command's learning curve which is a bit steep. The old importprivkey was quite straightforward and simple, while importdescriptors use JSON array and JSON objects which is quite a challenge even with examples in Bitcoin Core's help command. Title: Re: ImportPrivKey Into Bitcoin Core Wallet Post by: Paleus on November 17, 2025, 05:47:44 AM rescanblockchain 0 (currently 1% complete ...)
Hoping my balance will appear in the wallet after importing the private key ... Title: Re: ImportPrivKey Into Bitcoin Core Wallet Post by: BitMaxz on November 17, 2025, 04:36:48 PM rescanblockchain 0 (currently 1% complete ...) Hoping my balance will appear in the wallet after importing the private key ... I think it is much faster to check the balance if you just use the now option because you can take the address immediately and check it manually on any online blockchain explorer. Using it would take too long before you could see your balance, unlike the "now" option. You can take the public address and manually check the balance in any explorer. |