Recovering Change Addresses from Old Wallet Backups

8 replies 420 views
0xMatrixNewbie
Posts: 142 · Reputation: 7
#1Nov 30, 2022, 10:28 PM
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! 🥳
5 Reply Quote Share
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?
0 Reply Quote Share
whale420Senior Member
Posts: 727 · Reputation: 853
#3Dec 1, 2022, 02:15 PM
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.
2 Reply Quote Share
0xMatrixNewbie
Posts: 142 · Reputation: 7
#4Dec 1, 2022, 07:52 PM
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.
0 Reply Quote Share
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.
1 Reply Quote Share
0xMatrixNewbie
Posts: 142 · Reputation: 7
#6Dec 3, 2022, 11:21 AM
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.
3 Reply Quote Share
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.
1 Reply Quote Share
0xMatrixNewbie
Posts: 142 · Reputation: 7
#8Dec 3, 2022, 02:51 PM
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.
0 Reply Quote Share
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.
0 Reply Quote Share

Related topics