I bought BTC in 2011 and renamed my wallet.dat to something else that I cannot remember. How can I find my wallet file on my computer? I'm prepared to use the command line and scripting.

  • What operating system are you using? – Nate Eldredge Nov 20 '13 at 22:21
  • I'm using Windows 7. – phan Nov 25 '13 at 15:00

Place to start - use the linux "file" command, which will show the following for a bitcoin wallet (at least in the client I use)

wallet.dat: Berkeley DB (Btree, version 9, native byte-order)

So - you could run something like:

find / -type f exec file '{U}' \; | grep "Berkeley DB"

That would be a start!

  • This worked for me: find / -type f | xargs file | grep "Berkeley DB (Btree, version 9, native byte-order)" – Gareth Davidson Nov 25 '13 at 4:29
  • My wallet file is on Windows 7. I don't use Linux. :( – phan Nov 25 '13 at 15:00
  • Well - you could install "cygwin" and execute the command there (it's more or less a linux environment for windows) - or you could figure out the header and paste it into the "content" part of the Windows search. Or you could boot from a linux LiveCD / LiveUSB! – Geoff Maciolek Nov 25 '13 at 22:39

In Windows 7 download and install Altap Salamander 2.54 (Google for it)

It's file manager (you can use any other file manager as well)

Then press Ctrl and key F to bring search window

Then set all options exactly as in this screen: http://s21.postimg.org/5qdx5cb1j/search.png

In Containing field enter: name"1 (each wallet has this text inside) and then click: Find Now

It takes a while to search entire disc C:

To speed up the process You can setup also Advanced options - see this screen: http://s21.postimg.org/xzb01t1wn/advanced.png

(I presume that Your wallet size is from 30KB to 10MB. If not change second value)

  • Thanks for your comment. I noticed your png file shows search results only ending in .dat. I believe I renamed my wallet file something innocuous like config.sys. In that scenario, will the Find function still find the wallet file, or does it depend on the extension ending in .dat? Also, if I find it I WILL tip you, not sure why you edited that comment out. :) You'd deserve it. – phan Nov 28 '13 at 3:56

Write a script (e.g. Perl, Python, Ruby... ) that opens every file on your computer and looks inside it to check the format. I'm not sure what that format is exactly. It may be as simple as a certain constant sequence of bytes at the beginning (a so-called "magic number").

  • How do I "check the format". I can write scripts but I have no idea how to do those 3 words, "check the format". – phan Nov 22 '13 at 16:37
  • First you have to find out what the wallet.dat format is... is there a "magic number" at the beginning that identifies it? Many file formats have such a magic number. If so, your script must open each file in binary reading mode and read the length of bytes that would be in the magic number and see if it matches the particular bytes for the wallet.dat magic number. You may be able to use PyWallet (en.bitcoin.it/wiki/Pywallet) as a helper from your script. Or at least you could look at the source for Pywallet to see if there are any clues about the existence of a magic number. – RentFree Nov 22 '13 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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