1

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?

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.

| improve this answer | |
  • 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 Mar 15 '17 at 13:20
  • bitcoin.stackexchange.com/questions/23828/… pywallet does seem to be your only real solution for deleting old addresses. bitcointalk.org/index.php?topic=561137.0 and 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 Mar 15 '17 at 14:26
  • 1
    @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 Apr 8 '17 at 16:30

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.