How to export private keys from Bitcoin core

In this tutorial, I'm going to show how you can export your private keys from Bitcoin core so you can later print them, or use them in another wallet.

⚠️
You should never share your private keys with anyone. If someone has access to your PKs, they can access and spend your funds.

I will be using Bitcoin core version 0.24.0 in this tutorial, but the same steps should be applicable to the other versions.

So, once we open our bitcoin core wallet, we should head to the Menu -> Window -> Console or you can also use (CTRL+T).This window will then appear:

By order, we execute the following commands:

walletpassphrase "password" 600
dumpprivkey paste_address_here

If your wallet is not encrypted, you can go ahead and ignore the first command.

Here's an example of how the console will look after executing the commands:

And voilà. You can now sweep or import the private keys to another wallet.

If you have multiple addresses, you can export all of them by running the following command:

dumpwallet "C:\Users\{your_user_name}\Desktop\test_export.txt"

You can change the path to whatever you want. If successful, it'll return the following:

You can then go to your desktop and access the exported file just like you would access any other txt file. The file contains a list of your addresses, with their private keys.

And that's it.

If you have any questions, feel free to drop them below.