Post
Topic
Board Bitcoin Technical Support
Re: Export list of private keys from BitcoinCore
by
satscraper
on 09/03/2024, 13:26:20 UTC
How to do this in 2024?  I'm using BC 26.0.0 and the console window gives this error that only legacy wallets are supported by this command.

Code:

walletpassphrase(…)

null

dumpwallet Test

Only legacy wallets are supported by this command (code -4)


And no indication is given as to how to do it for "newer" or non-legacy wallets.  So in addition to backing up wallet.dat, how do I export the private keys?



Legacy refer to wallets based on key-based architecture. As to BC 26.0.0 it creates wallets  the skeleton of which is descriptor based. That is why you got that "code -4 " message when run dumpwallet comand/  To get list of private keys  run


Code:
listdescriptors true

[url=https://bitcoincore.org/en/doc/26.0.0/rpc/wallet/listdescriptors/]where [/url]true is boolean value for ( private ) argument  of this function

 

Setting "true" is  mandatory  value for ( private )  argument as on default it equals to  "false" which results in descriptor for public keys rather than private one.