I put together this guide to help folks get back funds that might've been lost in change addresses from their old wallet.dat backups.
You don’t even have to move any funds to test whether this works. Just set up a wallet (call it 'wallet A'), back it up, create a bunch of new addresses for a 'wallet B'. Restore 'wallet A' on another device and you should see the private keys for ‘wallet B’. Recovery done! 🥳
Recovering Change Addresses from Old Wallet Backups
8 replies 420 views
wizard_2016Full Member
Posts: 127 · Reputation: 575
#2Dec 1, 2022, 10:56 AM
Seems like a big oversight if change addresses aren’t recovered automatically from backups. That's like a major flaw in Bitcoin Core, right?
Quick questions: you mention needing public keys, but I don’t see them in the instructions. By 'public key' did you mean 'address' instead?
How exactly do you dig up those public keys or addresses in an explorer?
I think there’s a misunderstanding. What do you mean with that 'works for Bitcoin-like UTXO QT wallets only' bit? UTXO refers to unspent transactions. If we’re discussing a wallet, it should be Bitcoin QT or Core.
You might wanna correct that PDF because it could confuse people. Also, why would you need to import a public key for just recovering change addresses? They should be in wallet.dat already.
Public key = wallet address in this context, right? The guide does use them in step 4 for clarity.
You want the public keys to check your balance on those change addresses. To find them, just look on your coin's explorer and see the change addresses after transactions from your original wallet (you know that one in Wallet ‘A’).
You seem to be off track with your scenario. If you have Wallet B and can dump keys, you wouldn't need this method.
matrix2021Full Member
Posts: 92 · Reputation: 612
#5Dec 3, 2022, 08:25 AM
This guide is a mess, no need to call importaddress for every change address; they’re already or will be in the wallet once you do a keypoolrefill. All that’s gonna happen is you confuse users, since any change detected will show as watchonly until the private key is generated.
Just rescan your wallet backup. A lot of times it rescans automatically if it sees it’s not up to date.
That’s a different situation; I'm talking about having an old wallet backup and that not applying here.
I had a similar issue with some altcoin where rescan and salvage didn't help retain the right addresses. But importing addresses before keypoolrefill did work for me, so it’s not like a total crapshoot.
If it’s not your thing, no worries, just don’t use it.
matrix2021Full Member
Posts: 92 · Reputation: 612
#7Dec 3, 2022, 02:32 PM
Nah, I’m talking about a backup of an HD wallet made anytime.
Honestly, I’ve either reviewed or written parts of Bitcoin Core wallet code. Your guide feels like a bunch of magic things just work without understanding why.
If rescan fails, I’d expect a keypoolrefill plus rescan would do it. Plus, importing change addresses could mess up change detection.
For sure, I haven’t faced issues with Bitcoin Core or Litecoin.
But one time with this lesser-known altcoin, Shibacoin, I lost all funds on my change addresses after a wallet broke. Repeated rescans and keypoolrefills didn’t do a thing.
Importing the change address where the funds were seen in the explorer helped me recover it.
matrix2021Full Member
Posts: 92 · Reputation: 612
#9Dec 3, 2022, 07:05 PM
The way to tell if an address is a change address ties back to missing info in the address book. If you import a change address, it sets that data, which means it won't be seen as change anymore.
This can lead to transactions looking confusing, since change will pop up as new incoming outputs instead of just being considered that.
Related topics
- Need help migrating my old wallet.dat to the latest version 4
- CipherSeed: How to Secure Your Crypto Wallet Backups 5
- Need help recovering my lost wallet file $7500 reward 24
- HD Wallet vs Descriptor Wallet: What's the Deal? 3
- New Wallet Regulations for Crypto Purchases Over $10K in the US 15
- Creating a Brain Wallet Generator with Bash 15