<p>Old addresses associated in the wallet will not cause harm.  Is there any specific reason you want to do this other than cleaning up the addresses associated in your wallet?  I would leave them where they are as you will normally always need new addresses for new transactions.</p>

<p>Or are you wanting to prune old addresses imported into a wallet.dat file that are now no longer in use?  In this instance I would be more tempted to find the addresses with funds in the on the wallet and import these into a new wallet.dat file and use this new wallet going forward.  </p>

<p>You can use Pywallet to prune old addresses out of the wallet but in the 14.0V of BTC i dont think there is a way.</p>

CC BY-SA 3.0
2017-03-15T13:20:54.903Z
I have a business case where I generate many addresses - up to 1 per second in busy hours. They are not all used for receiving transactions, but could potentially be for up to a couple of weeks. I could write some elaborate address recycle system, but that would be complicated. The problem is my wallet.dat is at 700MB+ and growing.
Svante
CC BY-SA 3.0
2017-03-15T14:26:03.443Z
https://bitcoin.stackexchange.com/questions/23828/delete-bitcoin-address-using-pywallet pywallet does seem to be your only real solution for deleting old addresses.  https://bitcointalk.org/index.php?topic=561137.0 and  https://bitcointalk.org/index.php?topic=911735.0 suggest that pywallet is your only solution.  Or you could start with a fresh wallet.dat by renaming the old wallet.dat file, but i dont think this would be suitable for your business case as you would loose the addresses from the original wallet.dat.  time to make a feature request to the bitcoin devs i think :)
Fuzzybear
CC BY-SA 3.0
2017-04-08T16:30:58.797Z
@Svante: You'll find a number of other questions on this site from customers who accidentally sent more coins to a previous merchant address, and are angry because the merchant isn't giving them back.  If you don't keep the old private keys somewhere, you'll be that merchant: customers, especially those who are new to Bitcoin, may not be able to comprehend that this is really their fault, nor to distinguish between "merchant can't" and "merchant won't".
Nate Eldredge
CC BY-SA 3.0
2017-03-09T14:45:46.290Z
2017-03-09T14:45:46.290Z
Fuzzybear
<p>Are there any easy way to prune <code>wallet.dat</code>? Like, deleting keys for addresses with no current balance and generated more than a month ago?</p>

<wallet.dat>
How do I prune/clean wallet.dat for old unused addresses
Svante
# How do I prune/clean wallet.dat for old unused addresses

(Asked by: username_0 on 2017-03-09)

Are there any easy way to prune `wallet.dat`? Like, deleting keys for addresses with no current balance and generated more than a month ago?

**Tags:** wallet.dat


---

## 1 answers

### Answer by username_1 on 2017-03-09. Score: 1

Old addresses associated in the wallet will not cause harm. Is there any specific reason you want to do this other than cleaning up the addresses associated in your wallet? I would leave them where they are as you will normally always need new addresses for new transactions.

Or are you wanting to prune old addresses imported into a wallet.dat file that are now no longer in use? In this instance I would be more tempted to find the addresses with funds in the on the wallet and import these into a new wallet.dat file and use this new wallet going forward.

You can use Pywallet to prune old addresses out of the wallet but in the 14.0V of BTC i dont think there is a way.

> **Comments:**
> **username_0**: I have a business case where I generate many addresses - up to 1 per second in busy hours. They are not all used for receiving transactions, but could potentially be for up to a couple of weeks. I could write some elaborate address recycle system, but that would be complicated. The problem is my wallet.dat is at 700MB+ and growing.  
> **username_1**: https://bitcoin.stackexchange.com/questions/23828/delete-bitcoin-address-using-pywallet pywallet does seem to be your only real solution for deleting old addresses.  https://bitcointalk.org/index.php?topic=561137.0 and  https://bitcointalk.org/index.php?topic=911735.0 suggest that pywallet is your only solution.  Or you could start with a fresh wallet.dat by renaming the old wallet.dat file, but i dont think this would be suitable for your business case as you would loose the addresses from the original wallet.dat.  time to make a feature request to the bitcoin devs i think :)  
> **username_2**: @username_0: You'll find a number of other questions on this site from customers who accidentally sent more coins to a previous merchant address, and are angry because the merchant isn't giving them back.  If you don't keep the old private keys somewhere, you'll be that merchant: customers, especially those who are new to Bitcoin, may not be able to comprehend that this is really their fault, nor to distinguish between "merchant can't" and "merchant won't".  

---

