<p>the wallet.dat file is a database to store the keys. It has a length of several Megabytes, and tends to grow with the number of tx/keys. Make a copy of it onto a USB drive, and put it aside! If you are on a unixoide system, have a look at the tool "hexdump". You could copy the first 5 kilobytes (dd if=xxx.dat of=/tmp/mytest bs=1024 count=5), and then use "hexdump -C /tmp/mytest". If it looks like this:</p>

<pre><code>00000000  00 00 00 00 01 00 00 00  00 00 00 00 62 31 05 00  |............b1..|
00000010  09 00 00 00 00 10 00 00  00 09 00 00 00 00 00 00  |................|
00000020  3f 2b 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |?+..............|
00000030  20 00 00 00 36 2a 93 00  02 00 00 01 1d f3 cd 88  | ...6*..........|
00000040  18 03 00 00 00 00 00 00  00 00 00 00 02 00 00 00  |................|
00000050  00 00 00 00 20 00 00 00  01 00 00 00 00 00 00 00  |.... ...........|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00001000  00 00 00 00 01 00 00 00  01 00 00 00 00 00 00 00  |................|
00001010  00 00 00 00 02 00 f0 0f  01 05 f8 0f f0 0f 00 00  |................|
00001020  01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00001030  20 00 00 00 36 2a 93 00  02 00 00 01 1d f3 cd 88  | ...6*..........|
00001040  18 03 00 00 00 00 00 00  00 00 00 00 02 00 00 00  |................|
00001050  00 00 00 00 20 00 00 00  01 00 00 00 00 00 00 00  |.... ...........|
00001060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00001ff0  04 00 01 00 00 00 02 00  04 00 01 6d 61 69 6e 00  |...........main.|
00002000  00 00 00 00 01 00 00 00  02 00 00 00 62 31 05 00  |............b1..|
00002010  09 00 00 00 00 10 00 00  00 09 00 00 00 00 00 00  |................|
00002020  02 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00002030  20 00 00 00 36 2a 93 00  02 00 00 01 1d f3 cd 88  | ...6*..........|
00002040  18 03 00 00 00 00 00 00  00 00 00 00 02 00 00 00  |................|
00002050  00 00 00 00 20 00 00 00  03 00 00 00 00 00 00 00  |.... ...........|
00002060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00002200  c7 76 7b 67 ff 4d fe 20  f0 4f ef 1f 98 be f0 7c  |.v{g.M. .O.....||
</code></pre>

<p>then indeed there is a high possibility for your wallet file.
If you are on windows, there are freeware tools to hexdump or hexedit files, you may not even need the command line. </p>

CC BY-SA 4.0
2018-11-22T20:50:02.733Z
hexdump has a `-n length` option which can save you having to use dd to make a truncated copy.
RedGrittyBrick
CC BY-SA 3.0
2017-11-29T19:56:54.737Z
2017-11-29T19:56:54.737Z
pebwindkraft
<p>This question is very similar to <a href="https://bitcoin.stackexchange.com/q/53600/66256">this one</a> ("Identifying wallet file among soup of recovered .dat files"), but slightly different.</p>

<p>I ran photorec and ended up with a bunch of files. Per <a href="https://bitcoin.stackexchange.com/a/53601/66256">this answer</a>, I ran <code>file</code> and found one that had the exact description mentioned: <code>Berkeley DB (Btree, version 9, native byte-order)</code></p>

<p>Can I easily tell if this is a bitcoin wallet file or just some DB file used by another application? It sounds like photorec can't find the EOF for these files, so mine is probably larger than the original file was. Are there any tools that might help me here?</p>

CC BY-SA 3.0
2017-11-29T19:52:02.137Z
I think it's not possible since bitcoin wallet files created from keys and addresses. so there's nothing static.
even though we find some method, it might give non-accurate result.
Tailer
CC BY-SA 4.0
2018-09-20T14:23:06.510Z
You can open BerkeleyDB files as shown in [this answer](https://askubuntu.com/a/452072).
MCCCS
<wallet-recovery>
How to tell if a file is a Bitcoin wallet?
Anthony R.
# How to tell if a file is a Bitcoin wallet?

(Asked by: username_0 on 2017-11-29)

This question is very similar to [this one](https://bitcoin.stackexchange.com/q/53600/66256) ("Identifying wallet file among soup of recovered .dat files"), but slightly different.

I ran photorec and ended up with a bunch of files. Per [this answer](https://bitcoin.stackexchange.com/a/53601/66256), I ran `file` and found one that had the exact description mentioned: `Berkeley DB (Btree, version 9, native byte-order)`

Can I easily tell if this is a bitcoin wallet file or just some DB file used by another application? It sounds like photorec can't find the EOF for these files, so mine is probably larger than the original file was. Are there any tools that might help me here?

**Tags:** wallet-recovery

> **Comments:**
> **username_1**: I think it's not possible since bitcoin wallet files created from keys and addresses. so there's nothing static. even though we find some method, it might give non-accurate result.  
> **username_2**: You can open BerkeleyDB files as shown in [this answer](https://askubuntu.com/a/452072).  

---

## 1 answers

### Answer by username_3 on 2017-11-29. Score: 1

the wallet.dat file is a database to store the keys. It has a length of several Megabytes, and tends to grow with the number of tx/keys. Make a copy of it onto a USB drive, and put it aside! If you are on a unixoide system, have a look at the tool "hexdump". You could copy the first 5 kilobytes (dd if=xxx.dat of=/tmp/mytest bs=1024 count=5), and then use "hexdump -C /tmp/mytest". If it looks like this:

```
00000000  00 00 00 00 01 00 00 00  00 00 00 00 62 31 05 00  |............b1..|
00000010  09 00 00 00 00 10 00 00  00 09 00 00 00 00 00 00  |................|
00000020  3f 2b 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |?+..............|
00000030  20 00 00 00 36 2a 93 00  02 00 00 01 1d f3 cd 88  | ...6*..........|
00000040  18 03 00 00 00 00 00 00  00 00 00 00 02 00 00 00  |................|
00000050  00 00 00 00 20 00 00 00  01 00 00 00 00 00 00 00  |.... ...........|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00001000  00 00 00 00 01 00 00 00  01 00 00 00 00 00 00 00  |................|
00001010  00 00 00 00 02 00 f0 0f  01 05 f8 0f f0 0f 00 00  |................|
00001020  01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00001030  20 00 00 00 36 2a 93 00  02 00 00 01 1d f3 cd 88  | ...6*..........|
00001040  18 03 00 00 00 00 00 00  00 00 00 00 02 00 00 00  |................|
00001050  00 00 00 00 20 00 00 00  01 00 00 00 00 00 00 00  |.... ...........|
00001060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00001ff0  04 00 01 00 00 00 02 00  04 00 01 6d 61 69 6e 00  |...........main.|
00002000  00 00 00 00 01 00 00 00  02 00 00 00 62 31 05 00  |............b1..|
00002010  09 00 00 00 00 10 00 00  00 09 00 00 00 00 00 00  |................|
00002020  02 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00002030  20 00 00 00 36 2a 93 00  02 00 00 01 1d f3 cd 88  | ...6*..........|
00002040  18 03 00 00 00 00 00 00  00 00 00 00 02 00 00 00  |................|
00002050  00 00 00 00 20 00 00 00  03 00 00 00 00 00 00 00  |.... ...........|
00002060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00002200  c7 76 7b 67 ff 4d fe 20  f0 4f ef 1f 98 be f0 7c  |.v{g.M. .O.....||

```

then indeed there is a high possibility for your wallet file.
If you are on windows, there are freeware tools to hexdump or hexedit files, you may not even need the command line.

> **Comments:**
> **username_4**: hexdump has a `-n length` option which can save you having to use dd to make a truncated copy.  

---

