Last year on 2024.6.23, the Chain Education article 《Is it True? Bitcoin Core No Longer Supports Private Key Import?》 introduced the method and specific instructions for importing a manually created BTC private key into the latest descriptor wallet. Some friends asked follow-up questions, so this article provides a brief supplement.
Question One: Does the descriptor wallet support importing BIP39 seed phrase?
Answer: No.
Although the descriptor wallet supports BIP32 hierarchical deterministic wallets, it does not support BIP39 seed phrases.
This is one reason why the Chain Education does not recommend using seed phrases to create a cold wallet for storing BTC in the 《Liu's Chain Education Beginner's Course》, but instead directly creates and copies down the private key. Even with seed phrases, different software and hardware wallets may implement them according to different specifications, which could result in a seed phrase created in software A being unable to import into software B, or importing it generates completely different addresses, making it impossible to find your stored BTC.
Question Two: How to create a descriptor wallet that supports private keys?
Answer: The latest version of Bitcoin Core will not automatically initialize your wallet. You need to create the wallet using commands. Creating with private keys disabled will create a watch-only wallet, while creating without disabling private keys creates a standard wallet. Specific command is as follows:
$ bitcoin-cli -named createwallet wallet_name="testwallet" descriptors=true disable_private_keys=false
Please note that disable_private_keys=false in the above command explicitly indicates not to disable private keys.
To increase security, it's best to encrypt the wallet.
$ bitcoin-cli -rpcwallet=testwallet encryptwallet "your local encryption password"
Question Three: So, how do you export the private key of an address in a descriptor wallet?
Answer: Very simple! Just display the descriptor. Specific command:
$ bitcoin-cli listdescriptors true{ "wallet_name": "testwallet", "descriptors": [ { "desc": "pkh(5KQ2upQdz2wPfYCT2MfXdgmqZKZtFPDmzm8ubXimR76pYMANUdM)#8rrz94h2", "timestamp": 1753270055, "active": false },...The result shown above is the private key descriptor imported in the 2024.6.23 Chain Education article 《Is it True? Bitcoin Core No Longer Supports Private Key Import?》. As you can see, Bitcoin Core neither encrypts nor hides the descriptor you import, but fully displays it.
Please note the true parameter after the listdescriptors command, which indicates displaying the private key descriptor. If this parameter is not added, only the public key descriptor will be displayed, and you won't see the private key.
After seeing the private key descriptor, we can verify it using the getdescriptorinfo introduced in the 2024.6.23 Chain Education article:
$ bitcoin-cli getdescriptorinfo "pkh(5KQ2upQdz2wPfYCT2MfXdgmqZKZtFPDmzm8ubXimR76pYMANUdM)"{ "descriptor": "pkh(04e510bfa12225bbc2044a1847eda44a26e8a842cbf45c11d74ade893e506fc9e209c7c0044c5321ea22edf9dc1d8e45bed3663ed7c637eb564a7dd0a23ca8e45c)#afvrzgrk", "checksum": "8rrz94h2", "isrange": false, "issolvable": true, "hasprivatekeys": true}The result is not very intuitive, and you can't see the BTC address corresponding to the private key descriptor. We still need to use the following command to view the corresponding address:
$ bitcoin-cli deriveaddresses "pkh(04e510bfa12225bbc2044a1847eda44a26e8a842cbf45c11d74ade893e506fc9e209c7c0044c5321ea22edf9dc1d8e45bed3663ed7c637eb564a7dd0a23ca8e45c)#afvrzgrk"[ "13cuZK94jvtCBPDoXd86MiiFTyMnQWkCS6"]
Note that the parameter after the deriveaddresses command is the public key descriptor from the previous command's result.
At this point, we can be sufficiently confident about the private key descriptor initially obtained from the descriptor list and its corresponding address.
Isn't it simple? Ah, actually, it's not! So the Chain Education is lazy and actually uses Electrum. This was already mentioned in previous articles about manually creating private keys.
Additionally, the demonstration commands were actually performed using Bitcoin Knots. Knots is a branch version of Core that adds some filtering and slimming functions, which helps save resources needed to run a node.
What, you want to ask about HD wallet addresses and private keys? This article is already too long. We'll leave this more complex and difficult topic for another time!



