<p>I would use the <a href="https://bitcoin.stackexchange.com/a/101319/38618"><code>dumpwallet</code> approach</a> using Core, then use a script to remove everything but the WIF private keys and import them to Electrum which can import a <em>list</em> of private keys</p>

CC BY-SA 4.0
2021-01-31T16:02:27.233Z
I have bitcoin-core installed, but I can't find dumpwallet executable. I'm working on windows
Virgula
CC BY-SA 4.0
2021-01-31T16:18:04.073Z
Once you run Core find the "console" menu item from which you can call dumpwallet
MCCCS
CC BY-SA 4.0
2021-01-31T16:27:22.963Z
Ok I have found it, but I can't import the dumped wallet on electrum, maybe there are no valid addresses because if I try to type `dumpprivkey` it says: `Invalid Bitcoin address (code -5)`. On electrum, I do: import btc addresses or private keys, then I select the file which contains a lot of strings (but I don't know if they represent valid addresses) and I cannot move forward after that: https://i.imgur.com/5JRM4qX.png
Virgula
CC BY-SA 4.0
2021-01-31T17:21:24.287Z
OK, that file contains private keys. Private keys are all words that start with `K`, `L` or `5`. You need to copy paste those and only those, not comments, not anything else to Electrum. You may also skip the private keys that have `reserve=1`, those are unused. I'm going to write a script that takes the output and filters the private keys and I'll post them here in ~48 hours, so if there are too many addresses without `reserve=1`, please wait one to two days
MCCCS
CC BY-SA 4.0
2021-01-31T21:54:22.570Z
I could have coded it by myself but if you have already done the work and want to share it I'll appreciate, thank you.
Virgula
CC BY-SA 4.0
2021-01-31T22:06:42.077Z
alternatively, you should be able to import only the "extended private masterkey" into your wallet software as an HD Wallet seed, and your wallet software *should* be able to re-derive the private keys from there & tell you which (if any) of the wallets still contain btc.
Robherc KV5ROB
CC BY-SA 4.0
2021-02-01T09:44:46.837Z
@Virgula Here is it: https://gist.github.com/DesWurstes/ce0e1727a53e4b1f6e808e2ef5801ece
MCCCS
CC BY-SA 4.0
2021-02-01T14:48:18.527Z
@MCCCS Ok I have tried your script and keys have been imported on electrum. Unfortunately the address that I was looking for is not shown in electrum btc list, so I assume that is a wrong version of wallet.dat file. But can I know why if you create a new wallet it automatically creates not a single BTC address but a lot of them? I mean, shouldn't I have been able to create one whenever I need instead to have a list of already created addresses?
Virgula
CC BY-SA 4.0
2021-02-01T14:51:53.130Z
@Virgula Yes, lots of them. It could generate it when needed, however, that's just not how it chooses to work. `reserve=1` addresses are unused, as expected. Core prefers to generate the default 50 next addresses whenever it can, and updates again when one of them is used.
MCCCS
CC BY-SA 4.0
2021-01-31T15:49:46.583Z
2021-01-31T15:49:46.583Z
MCCCS
<p>I have a file: wallet.dat where should be saved one or more private keys of my old wallet linked to one/more public btc addresses. I also had more than a wallet, so I don't really know if there are some created address with an amount of money in that file or not. Of course, I don't want to download 500 gbs of transactions since 2009 using Qt-Coin and my idea was to extract private keys in order to import them on another wallet like <code>blockchain.com</code>.
I managed to use some open source tool (wt_extract_keys.py <a href="https://github.com/akx/walletool" rel="nofollow noreferrer">https://github.com/akx/walletool</a>) to extract private keys, one seemed to work but the format of private keys seems to be not compatible because <code>blockchain.com</code> requires a private key in a <code>wif</code> format and what I got is a very big private non-compressed key.
So how can I get the private key/s with the right format this if it's possible? What do you suggest?</p>

<bitcoin-core><private-key><blockchain.info><wallet.dat>
Bitcoin-Qt client wallet.dat extract private key to import on another service
Virgula
# Bitcoin-Qt client wallet.dat extract private key to import on another service

(Asked by: username_0 on 2021-01-31)

I have a file: wallet.dat where should be saved one or more private keys of my old wallet linked to one/more public btc addresses. I also had more than a wallet, so I don't really know if there are some created address with an amount of money in that file or not. Of course, I don't want to download 500 gbs of transactions since 2009 using Qt-Coin and my idea was to extract private keys in order to import them on another wallet like `blockchain.com`.
I managed to use some open source tool (wt\_extract\_keys.py <https://github.com/akx/walletool>) to extract private keys, one seemed to work but the format of private keys seems to be not compatible because `blockchain.com` requires a private key in a `wif` format and what I got is a very big private non-compressed key.
So how can I get the private key/s with the right format this if it's possible? What do you suggest?

**Tags:** bitcoin-core, private-key, blockchain.info, wallet.dat


---

## 1 answers

### Answer by username_1 on 2021-01-31. Score: 1 | Accepted answer

I would use the [`dumpwallet` approach](https://bitcoin.stackexchange.com/a/101319/38618) using Core, then use a script to remove everything but the WIF private keys and import them to Electrum which can import a *list* of private keys

> **Comments:**
> **username_0**: I have bitcoin-core installed, but I can't find dumpwallet executable. I'm working on windows  
> **username_1**: Once you run Core find the "console" menu item from which you can call dumpwallet  
> **username_0**: Ok I have found it, but I can't import the dumped wallet on electrum, maybe there are no valid addresses because if I try to type `dumpprivkey` it says: `Invalid Bitcoin address (code -5)`. On electrum, I do: import btc addresses or private keys, then I select the file which contains a lot of strings (but I don't know if they represent valid addresses) and I cannot move forward after that: https://i.imgur.com/5JRM4qX.png  
> **username_1**: OK, that file contains private keys. Private keys are all words that start with `K`, `L` or `5`. You need to copy paste those and only those, not comments, not anything else to Electrum. You may also skip the private keys that have `reserve=1`, those are unused. I'm going to write a script that takes the output and filters the private keys and I'll post them here in ~48 hours, so if there are too many addresses without `reserve=1`, please wait one to two days  
> **username_0**: I could have coded it by myself but if you have already done the work and want to share it I'll appreciate, thank you.  
> **username_2**: alternatively, you should be able to import only the "extended private masterkey" into your wallet software as an HD Wallet seed, and your wallet software *should* be able to re-derive the private keys from there & tell you which (if any) of the wallets still contain btc.  
> **username_1**: @username_0 Here is it: https://gist.github.com/DesWurstes/ce0e1727a53e4b1f6e808e2ef5801ece  
> **username_0**: @username_1 Ok I have tried your script and keys have been imported on electrum. Unfortunately the address that I was looking for is not shown in electrum btc list, so I assume that is a wrong version of wallet.dat file. But can I know why if you create a new wallet it automatically creates not a single BTC address but a lot of them? I mean, shouldn't I have been able to create one whenever I need instead to have a list of already created addresses?  
> **username_1**: @username_0 Yes, lots of them. It could generate it when needed, however, that's just not how it chooses to work. `reserve=1` addresses are unused, as expected. Core prefers to generate the default 50 next addresses whenever it can, and updates again when one of them is used.  

---

