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?
Asked
Active
Viewed 1,560 times
0
Virgula
- 103
- 2
1 Answers
1
I would use the dumpwallet approach 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
MCCCS
- 10,097
- 5
- 27
- 55
-
I have bitcoin-core installed, but I can't find dumpwallet executable. I'm working on windows – Virgula Jan 31 '21 at 16:02
-
Once you run Core find the "console" menu item from which you can call dumpwallet – MCCCS Jan 31 '21 at 16:18
-
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 Jan 31 '21 at 16:27
-
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 Jan 31 '21 at 17:21
-
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 Jan 31 '21 at 21:54
-
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 Jan 31 '21 at 22:06
-
@Virgula Here is it: https://gist.github.com/DesWurstes/ce0e1727a53e4b1f6e808e2ef5801ece – MCCCS Feb 01 '21 at 09:44
-
@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 Feb 01 '21 at 14:48
-
@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 Feb 01 '21 at 14:51