Take the 2-minute tour ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

I have somewhere in my hard disks some copies of old wallets which I need to analyse.

My idea was importing them into blockchain.info, but to do that apparently you need to dump them with pywallet.py, which is one of the worst pieces of software I've recently put my hands on.

Is there an alternative?

I.e. either one software which given (via command line) the full path of the file, will dump something that blockchain.info can import, or something that at least given a wallet (again, full path via command line) will dump all the private keys.

PS: this has to work for encrypted wallets too, asking the password either at runtime (would be better) or at the command line.

share|improve this question
2  
Sorry can't answer but am also interested to know what other options are available for wallet management. I might suggest changing the title of the question to something else as I thought this was going to be about how to find the wallet.dat file on your computer. Maybe "Wallet/address software management options?" or something like that. Would have edited myself but wasn't sure what to change it to. –  kirian Apr 6 '13 at 21:26
add comment

5 Answers

  1. "As I thought, it doesn't work that way. It wants a full directory with the databases, an alone wallet.dat is not enough. – Lohoris yesterday" Not at all... Wallet.dat is the only file that pywallet reads
  2. If you notice a bug, it's rather nice to report it to the dev instead of bashing him
  3. Same thing for new flags you might want: ask for them instead of complain about their absence

https://bitcointalk.org/index.php?topic=34028.180 I can also provide an email address if you don't have a bitcointalk account

share|improve this answer
    
Oh, sorry, I assumed it was unmantained. I'll properly report at github later, then. –  Lohoris Apr 15 '13 at 0:07
add comment

I hate to be that guy, but you should really take another look at pywallet. Your problems may be specific to Joric's pywallet, which hasn't been updated in awhile. There is a better-maintained fork of pywallet by JackJack.
If this was the version of it that you already experienced, you could always try the web interface by running:./pywallet.py --web and then navigating to localhost:8989/ in a web browser.
You did however request a command line way of doing it, which with jackjack's pywallet would look like this:
./pywallet.py --dumpwallet --datadir=DATADIR --wallet=WALLETFILE --passphrase=PASSPHRASE
The --passphrase option may have been the issue you ran into with pywallet, since it is necessary for dealing with encrypted wallets, but it isn't in the readme (not really sure why that is).
Anyway, pywallet really does seem to be your best bet for what you're trying to do. If you are having issues using it, feel free to include information about these issues.

share|improve this answer
1  
--wallet and --datadir do not work: they expect you to provide a full data dir, while I just have the wallet.dat file. (and yes I'm using JackJack's version) –  Lohoris Apr 12 '13 at 10:15
    
I was just able to dump a wallet.dat file using ./pywallet.py --dumpwallet --datadir=/mywalletfilefolder where mywallerfilefolder had a wallet.dat in it. Is it possibly the encryption that is the issue? What output do you get when you try? –  7anner Apr 12 '13 at 20:22
    
Apparently I just assumed pywallet for some reason requred a full data dir. Instead it is just so dumb to require two different parameters for the directory and for the wallet name. –  Lohoris Apr 13 '13 at 14:31
    
As I thought, it doesn't work that way. It wants a full directory with the databases, an alone wallet.dat is not enough. –  Lohoris Apr 13 '13 at 16:04
    
huh. I didn't need any other files to do it. –  7anner Apr 15 '13 at 21:56
add comment

As suggested by the other response. You can use pywallet just fine. Since you require the dumping of many wallets and would like a CLI solution, then a simple bash script + pywallet will do just fine.

This is not by any means tested (i.e. backup all the wallets involved), but should do just fine:

Bash

#!/bin/bash

echo "Enter directory with all the wallet *.dat files live:"
read walletdir
echo "Enter passphrases for all the encrypted wallets in directory:"
read passphrase

for i in $walletdir/*.dat; do
    pywallet.py --dumpwallet --datadir=$walletdir --wallet=$i --passphrase=$passphrase
done

Batch (Not my strong side)

@echo off
set /p walletdir=Wallet directory?:
set /p passphrase=Passphrase?:

for /r %%i in (*) do pywallet.py --dumpwallet --datadir=%walletdir% --wallet=%%i --passphrase=%passphrase%

Also if you'd like to isolate any information within the JSON dump itself you can surely do that too. I'm not exactly sure the anticipated output of --dumpwallet as I am not a user of pywallet, but I believe you can edit the pywallet.py code to change

print json.dumps(json_db, sort_keys=True, indent=4)

to

print "\n".join(private_keys)

In conclusion doing those 2 things will print out a long list of all the private keys to all the addresses to all the wallet files.

Disclaimer - Once again, I have not tested any of this

share|improve this answer
    
See my answer to 7anner: pywallet is stupid and can't process a wallet.dat file if it isn't located into a directory with the bitcoin database. –  Lohoris Apr 13 '13 at 16:05
add comment

Beside that I don't understand your problem with PyWaller, like Eyal suggests, you can use the standard Bitcoin software for this as well, although this method will be a little more time-consuming.

I suggest doing the following for every wallet.dat file you have:

  1. Backup your current wallet.dat file.
  2. Copy the old wallet.dat to your Bitcoin directory.
  3. Open up a terminal and run the bitcoind daemon:

    bitcoind -daemon

  4. Retrieve a list of all the addresses in the wallet:

    bitcoind listaddressgroupings

  5. For every address you want the private key from, dump it:

    bitcoind dumpprivkey <bitcoinaddress>

  6. Stop the daemon before changing the wallet.dat file:

    bitcoind stop

This should give you all the private keys you need and you can import them to any wallet you would like.

share|improve this answer
1  
This is terribly time consuming, that's exactly what I'm trying not to do. –  Lohoris Apr 11 '13 at 15:50
    
How many wallet files do you have then? If you want to save time, you can always use PyWallet... –  Steven Roose Apr 11 '13 at 20:13
1  
No, because pywallet doesn't take a full path as an input, i.e. I would have to move the wallet.dat anyway, which is what I'm trying to avoid in the first place. Please notice it pretends to be able to give a path, but it doesn't really work: he wants a path for a whole .bitcoind directory, while I just have the wallet.dat. –  Lohoris Apr 12 '13 at 10:14
    
With a little change to the code you could have changed that... –  Steven Roose Apr 15 '13 at 9:45
    
I tried, it's a complete mess, never seen anything like that. –  Lohoris Apr 15 '13 at 9:49
add comment

If it's fewer than 10 wallets, just copy them into bitcoin-qt's configuration directory one-at-a-time and transfer all the bitcoins to a new wallet. It would take you about 10 minutes to do it.

share|improve this answer
1  
This totally isn't helpful: obviously I could do it by hand, the whole point of this question is to avoid doing that. –  Lohoris Apr 12 '13 at 10:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.