Post
Topic
Board Bitcoin Technical Support
Re: Issue importing wallet from private key on bitcoin core version 25
by
digital_mine
on 23/11/2023, 23:22:05 UTC
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 of a Native SegWit address, the command should 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 the data mentioned above.

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

If I can't get my keys, the point is the same: NOT MY KEYS NOT MY COINS.
You're still in control your keys in your wallet which is stored in your device.
There's no second/third-party custodian that hodls it for you.

Thanks, it looks like it works.