I can't create the private key of a legacy address on bitcoin core. When I do the command it writes me that it can only be done to legacy addresses. And my address is legacy. What should I do. Thank you

  • Hello Carmen, what are you trying to do that you need to export a private key for? Perhaps if you ask about your original problem instead of your solution attempt for that problem, we could help you better.
    – Murch
    Nov 29, 2023 at 16:38
  • why is the private key, which allows you to have full control over moving your wallet/addresses between bitcoin clients so elusive to obtain? @Murch
    – Jon Grah
    Mar 9 at 5:53
  • Because Bitcoin Core moved to a more comprehensive export format, ouput script descriptors a few years ago.
    – Murch
    Mar 9 at 13:10

1 Answer 1


I believe you're confusing legacy addresses with legacy wallets. They're distinct and unrelated things.

  • Legacy addresses are pre-segwit addresses (P2PKH most commonly), and are contrasted with segwit and taproot addresses.
  • Legacy wallets are wallet files in the BDB file format, created by old versions of Bitcoin Core (and can still be opened by new versions, for now). They're contrasted with descriptor wallets, which use the SQLite file format, which are created by newer versions of Bitcoin Core.

You can create legacy addresses using descriptor wallets, and you can create segwit (but not taproot) addresses using legacy wallets.

What I suspect is going on here is that you're trying to perform the dumpprivkey on a legacy address in a descriptor wallet. And that doesn't work, because dumpprivkey only works on legacy wallets (regardless of address type). Exporting private key is dangerous, and especially so for descriptor wallets (where an attacker can typically compute all your private keys from just one). If you must, you can export the private master key using listdescriptors, though I suspect this will not be what you want.

To help you find an alternative, I encourage you to amend your answer to explain exactly what you're trying to achieve (or point out if my interpretation of events is incorrect). Perhaps a solution exists that doesn't involve exporting private keys, as that is generally a bad idea unless you really know what you are doing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.