Post
Topic
Board Bitcoin Technical Support
Merits 1 from 1 user
Re: Help Unable to export private key
by
nc50lc
on 11/02/2025, 06:18:44 UTC
⭐ Merited by apogio (1)
The export of the private key failed and this prompt appears
First of all, what will you do with the private key once you've exported it?
Because depending on the use-case,
e.g.: if you don't want to sync Bitcoin core but needs access to your bitcoins: You just have to export the correct (private) descriptor and import that to a wallet that supports descriptors like Sparrow.

If you really need to export individual private key for some reason, you can follow these instructions:
Here's the procedure (requires https://github.com/iancoleman/bip39):
  • Start Bitcoin Core, preferably on an offline machine and enter the command getaddressinfo "bc1address" and take note of the address' "parent_desc" and "ischange" values.
  • Next, enter the command listdescriptors true and find the (private) descriptor with the matching script type
    of your address' parent descriptor. (your address' should be "wpkh")
    But there'll be at least two desc with that script type, so based from your address' "ischange" value of 'true' or 'false', pick the descriptor with "internal" of the same value.
  • From the correct descriptor, copy it's master private key which is the long "xprv" key. Do not include the script type and '(' before and '/' after it.
  • Now open your iancoleman's BIP39 tool in an offline machine and paste your xprv key in "BIP32 Root Key".
  • Scroll down a bit and select the correct script type: BIP44 for legacy, BIP49 for Nested-SegWit and BIP84 for Native Segwit.
  • The default should be already correct for receiving addresses (internal: false), else, change the internal/external path from '0' to '1'.
  • Scroll-down to the derived addresses and it should be there along with its private key.
  • If your address' "address_index" is more than 20, you should derive more addresses in BIP39 tool by using the button: "Show ___ more rows" below the address list for it to show.
Regarding the external and internal index, that refers if you want to find your receiving or change addresses.

Take note that this isn't something that you should be doing on an online machine,
Because if any of those private key is compromised, your entire wallet's funds could be compromised as well.