I bring you this script to help you extract your private keys from a wallet.dat (descriptor) and the ability to export them to Electrum-compatible format.
For this, you need to have Bitcoin Core installed, but only to extract the descriptors, you don't need to download the blockchain. I strongly recommend making a backup of your wallet.dat at all times and working using the backup.
1- We open Bitcoin Core, load the wallet (if you haven't done so already), and open the console with window-console or Ctrl+T.
2- We execute the command listdescriptors true to extract the descriptors.
3- We copy the master private key, known as the 'xpriv'.
4- We open our script easy_wallet_backup.py
5- We load our wallet.dat file, select 'Dump Descriptor,' and paste the 'xprv' in the following line.
6- If we click 'Go' the addresses present in the wallet.dat file along with their respective private keys will be listed.
7- If we want them to be listed in Electrum-compatible format, we click the 'Export2Electrum' button. These can then be saved using the 'Save Result' button or copied as a list to be accepted by Electrum via the 'Import Private Keys' option"
Clarification: When using Export2Electrum, addresses not supported by Electrum, such as Taproot addresses, are omitted.
Alternative options:
With the
Extended PrivKey (xpriv), you can generate a series of addresses derived from it. The .dat file is not necessary, as these addresses follow standard hierarchical derivations.
Or you can simply list the addresses in the wallet.dat file.
github:
https://github.com/Mcdouglas-X/easy-wallet-backupDisclaimer:
Handle your private data with caution, in isolated environments. Always work on backups of your file. I am not responsible for human errors; use at your own discretion.