<p>Sometimes the wallet file must be rewritten from scratch entirely (in particular when encrypthing it), to prevent unencrypted material to remain in old never-overwritten areas of the file. To do this, bitcoin writes a new file (wallet.dat.rewrite) and then renames it to wallet.dat. If this process is interrupted, it's possible that the wallet.dat.rewrite file remains. You can delete it safely.</p>

CC BY-SA 3.0
2012-06-20T17:49:30.903Z
Actually you *should* delete it, since it possibly contains your unencrypted private keys, and could maybe be used by a thief to gain access to your bitcoins without knowing your wallet password.
Chris Moore
CC BY-SA 3.0
2012-06-20T19:48:52.593Z
No, it is the file to which the rewritten version is written. It is not a copy of the old file.
Pieter Wuille
CC BY-SA 3.0
2012-06-21T00:16:05.350Z
Fair enough then.  :)  So is it possible that OP's wallet.dat file is still unencrypted since wallet.dat.rewrite wasn't renamed over top of it?
Chris Moore
CC BY-SA 3.0
2012-06-20T11:57:39.530Z
2012-06-20T11:57:39.530Z
Pieter Wuille
<p>In my %APPDATA%\Bitcoin folder (in Windows 7) I have a file called wallet.dat.rewrite</p>

<p>It was apparently last modified on 12th May 2011.</p>

<p>I don't think it's a file I created manually, so what is it?</p>

<wallet><bitcoin-core>
What is the file wallet.dat.rewrite?
Highly Irregular
# What is the file wallet.dat.rewrite?

(Asked by: username_0 on 2012-06-20)

In my %APPDATA%\Bitcoin folder (in Windows 7) I have a file called wallet.dat.rewrite

It was apparently last modified on 12th May 2011.

I don't think it's a file I created manually, so what is it?

**Tags:** wallet, bitcoin-core


---

## 1 answers

### Answer by username_1 on 2012-06-20. Score: 2 | Accepted answer

Sometimes the wallet file must be rewritten from scratch entirely (in particular when encrypthing it), to prevent unencrypted material to remain in old never-overwritten areas of the file. To do this, bitcoin writes a new file (wallet.dat.rewrite) and then renames it to wallet.dat. If this process is interrupted, it's possible that the wallet.dat.rewrite file remains. You can delete it safely.

> **Comments:**
> **username_2**: Actually you *should* delete it, since it possibly contains your unencrypted private keys, and could maybe be used by a thief to gain access to your bitcoins without knowing your wallet password.  
> **username_1**: No, it is the file to which the rewritten version is written. It is not a copy of the old file.  
> **username_2**: Fair enough then.  :)  So is it possible that OP's wallet.dat file is still unencrypted since wallet.dat.rewrite wasn't renamed over top of it?  

---

