Post
Topic
Board Bitcoin Technical Support
Merits 10 from 4 users
Re: Issue importing wallet from private key on bitcoin core version 25
by
nc50lc
on 23/11/2023, 13:01:07 UTC
⭐ Merited by o_e_l_e_o (4) ,ETFbitcoin (3) ,hosseinimr93 (2) ,BitMaxz (1)
These are the command I'm using on the wallet console:
Code:
importprivkey "MY KEY"
Code:
dumpprivkey "ADDRESS"
You still can import but with a different command: use importdescriptors instead.
For a single WIF private key for a Native SegWit address, the command may look like this:
Code:
importdescriptors "[{\"desc\": \"wpkh(WIF_PRIV_KEY)#z0cazjry\", \"timestamp\": 0}]"
Use: help importdescriptors to know how to use the command.
Here's how to construct descriptors: https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md
And to get the checksum (#z0cazjry in the example), use: getdescriptorinfo "descriptor"


For dumpprivkey, I believe that it's intentionally removed because of the design of BIP44, BIP49, BIP84 and BIP86 standards which now use non-hardened addresses.
Previously, there's no serious issue with exporting a single private key from a legacy HD wallet with hardened addresses since there's no way to compute the parent extended private key from its pair extended public key and a child (exported) private key.
Now, since the 'address_index' as well as the 'chain_index' (change) paths aren't hardened, that issue is now possible if an attacker gets his hand on those data.

There's a workaround export your privKey but be warned of the issue above:  https://bitcointalk.org/index.php?topic=5449245.msg62109703#msg62109703