Bitcoin Forum
November 13, 2024, 03:02:26 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: HD wallet changes 0.17 => 0.19  (Read 275 times)
Mindborg (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 10


View Profile WWW
April 30, 2020, 06:37:08 PM
Merited by OmegaStarScream (2)
 #1

I just had a computer crash, and when I restored the computer I upgraded from I think Bitcoin 0.17 to Bitcoin 0.19.1. The wallet was gone, so I restored an old copy of the wallet. It's an HD wallet.

When the blockchain was synced, and I put in the wallet, the latest incoming transaction was not displayed. I generated several new addresses, but none of them had the latest transaction. I suspect that it's a new format on the addresses. Is there a way for me to generate the old address format in 0.19.1, should I download 0.17, or did I made a mistake so the transaction is lost?

Any help is appreciated.
BitMaxz
Legendary
*
Offline Offline

Activity: 3430
Merit: 3172


Playbet.io - Crypto Casino and Sportsbook


View Profile WWW
April 30, 2020, 07:32:51 PM
 #2

What backup do you have?
How did you restore your old wallet to your new wallet?

It should be work and shows the transaction history if you correctly put the right wallet.dat(backup) to the correct folder or destination.
Check the right path from here https://en.bitcoin.it/wiki/Data_directory


What OS you currently using?

Or the backup you have is the "dumpwallet" that you can get through console?

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████

.... ..Playbet.io..Casino & Sportsbook.....Grab up to  BTC + 800 Free Spins........
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
May 01, 2020, 12:32:44 AM
Last edit: November 15, 2023, 01:28:55 AM by HCP
 #3

I suspect that it's a new format on the addresses.
- What address type were you using on 0.17? Was it "1", "3" or "bc1"? Huh
- What address type are you seeing now on 0.19.1? Is it "1", "3" or "bc1"? Huh

If it has changed, then that is most likely the reason why... you can force Bitcoin Core to use the type you want in a couple of ways:

- On the "receive" tab, you can check the box to generate "bc1" (aka bech32) addresses.... if you UNcheck the box, it should generate "3" type addresses (nested SegWit):




- In the console ("Window -> Console" option in the menu), you can use the getnewaddress. The command is:
Code:
getnewaddress "label" "address_type"
- "label" can be whatever you like... even empty... but it needs to be specified if you want to use "address_type"
- "address_type" should be "legacy" (will generate "1" type address), "p2sh-segwit" (will generate "3" type address) or "bech32" (will generate "bc1" type address)

So... to generate a new "1"-type address with no label:
Code:
getnewaddress "" "legacy"

To generate a new "3"-type address with the label "my nested segwit":
Code:
getnewaddress "my nested segwit" "p2sh-segwit"



- You can also force Bitcoin Core to ALWAYS generate a specific type by using the -addresstype commandline argument or including the addresstype value in your bitcoin.conf file.

Quote
-addresstype     What type of addresses to use ("legacy", "p2sh-segwit", or "bech32", default: "p2sh-segwit")



█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Mindborg (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 10


View Profile WWW
May 01, 2020, 08:58:43 AM
Last edit: May 01, 2020, 07:46:55 PM by achow101
 #4

Thanks for the answers. The issue is not yet resolved though.

Quote
- What address type were you using on 0.17? Was it "1", "3" or "bc1"?
The transaction was to a 3-address.

Quote
- What address type are you seeing now on 0.19.1? Is it "1", "3" or "bc1"?
After your suggestion, I generate 3-addresses. Before that I generated "bc1".

I tried generating many addresses, but it does not generate the address the transaction was sent to. It's as if the HD wallet has taken a different path. I can see outgoing transactions, but not the incoming.



What backup do you have?
How did you restore your old wallet to your new wallet?

It should be work and shows the transaction history if you correctly put the right wallet.dat(backup) to the correct folder or destination.
Check the right path from here https://en.bitcoin.it/wiki/Data_directory


What OS you currently using?

Or the backup you have is the "dumpwallet" that you can get through console?

Backup:
The original HD wallet that was created, I took backup of. It was created in 2017.
I took backup of the wallet back then, and it created "1" addresses for long, but then generated "3" addresses for some time, and that's where I don't find the transaction.
It gets most of the transactions correct, but one transaction is missing. It does not generate the same address. I don't think the problem is with the folder destination, because then no transactions would show.

OS:
Linux, Ubuntu

Quote
Or the backup you have is the "dumpwallet" that you can get through console?
No, I copied the wallet.dat file and took backup of that.



I was thinking of a path dependence?

Is it possible that each set of addresses does not start from the same seed, but that the number of "1" addresses generated has an effect on the input for the "3" addresses for example?

Maybe I should try to download version 0.17?
How can I do that on my Ubuntu?
Mindborg (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 10


View Profile WWW
May 01, 2020, 10:14:44 AM
Last edit: May 01, 2020, 07:46:13 PM by achow101
 #5

I have confirmed that bitcoin is generating totally different addresses.

I installed 0.17 and then added the wallet to the path.
I had a screenshot of 0.19 addresses, and then I generated 0.17 addresses, and they are totally different.

And I still don't have access to the 3-address with the transaction.

Same wallet.dat file, totally different addresses.
This is not a bug, but a mega-bug.

Unless there's something I have ignored...



Here's what I think is happening:
When generating new address, wallet uses the previous address as input for the next. So depending on when you switch from one format to the other, there there's a different address generated next.

I mean, this is so basic. It is the ONE job of the HD wallet; create the same addresses over and over, with the only input being the wallet.dat, and avoid such path dependence.

Are there any programmers who can confirm this?

Does anyone know the code for generating new addresses?



I have made no changes to the passphrase no.

Does anyone know what inputs the software uses to generate addresses?
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6389


Self-proclaimed Genius


View Profile
May 01, 2020, 12:26:43 PM
 #6

I had a screenshot of 0.19 addresses, and then I generated 0.17 addresses, and they are totally different.
Has Bitcoin core been running ever since you pasted the old wallet.dat backup?
Because if it does, it's still using the previous wallet.dat even though it was pasted over, you need to restart Bitcoin Core for it to load.

No? you can try this, close core and temporarily add these to your config file in the data directory (create a bitcoin.conf file if you didn't have one).
Code:
addresstype=p2sh-segwit
changetype=p2sh-segwit
keypool=5000
(delete them later if this didn't worked)
That will force your wallet to create 4000 more "P2SH Wrapped SegWit" receiving and change addresses to your wallet's keypool.

Then open Bitcoin core, open console (Window->Console), and type getaddressinfo '3your-missing-addressxxxxxxxx'
If the value of "ismine" is "true", you've restored that address and it's beyond the default keypool (1000 receiving/change).
If 'false', then it might be a different wallet file, pasted in a different directory or core is configured with different data/wallet directory just like others suspected.

P.S.: The HD seed wont change unless the wallet was previously non-encrypted then a passphrase was set or there's a "very specific" corruption that changed the HD seed which is highly unlikely.

I have made no changes to the passphrase no.
Sorry for the previous post, the right question should be: have you encrypted that wallet after the backup?
But it's already answered by this quote.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
May 01, 2020, 07:55:29 PM
Merited by Abdussamad (2), ABCbits (2)
 #7

- What address type were you using on 0.17? Was it "1", "3" or "bc1"? Huh
- What address type are you seeing now on 0.19.1? Is it "1", "3" or "bc1"? Huh
The address type is irrelevant. Bitcoin Core (for now) operates on keys regardless of the type of addresses that you are fetching from it.

I have confirmed that bitcoin is generating totally different addresses.

I installed 0.17 and then added the wallet to the path.
I had a screenshot of 0.19 addresses, and then I generated 0.17 addresses, and they are totally different.
Are you certain that you had put the wallet for 0.19 in the correct place?

Unless there's something I have ignored...
You've definitely missed something or done something wrong because key and address generation did not change between these two versions.

Here's what I think is happening:
When generating new address, wallet uses the previous address as input for the next. So depending on when you switch from one format to the other, there there's a different address generated next.
No. That's not how it works.



The problem is most likely because you have placed the wallet.dat file in the wrong location and Bitcoin Core is using a newly generated default wallet.

Abdussamad
Legendary
*
Offline Offline

Activity: 3682
Merit: 1580



View Profile
May 01, 2020, 08:08:14 PM
 #8

you're supposed to place the wallet.dat file before it syncs because when it's syncing its looking for transactions relevant to your wallet. so you place the correct wallet.dat file first.

if you did it afterwards core would have complained and asked for time to go through the chain again but since it didn't it must be what achow said above - you've placed it in the wrong dir.
BitMaxz
Legendary
*
Offline Offline

Activity: 3430
Merit: 3172


Playbet.io - Crypto Casino and Sportsbook


View Profile WWW
May 01, 2020, 10:54:58 PM
 #9

I have confirmed that bitcoin is generating totally different addresses.

I installed 0.17 and then added the wallet to the path.
I had a screenshot of 0.19 addresses, and then I generated 0.17 addresses, and they are totally different.

And I still don't have access to the 3-address with the transaction.

Same wallet.dat file, totally different addresses.
This is not a bug, but a mega-bug.

Unless there's something I have ignored...

If it shows all transactions and old 3-addresses on 0.17 after you installed and compared it to 0.19. Why not dump or backup the private key or make a raw transaction to transfer them to a new wallet generated from 0.19? or make a new wallet on the different wallet and transfer all bitcoins from 0.17(for temporary until the issue found and solve).

This is only an alternative way just to take all of your balances from old bitcoin core wallet 0.17 it might be a bug on 0.19 so transferring them would be the best solution by making a raw transaction.

Also, make sure that you download the 0.19 from the trusted source below.

- https://bitcoin.org/en/download
- https://github.com/bitcoin/bitcoin/releases

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████

.... ..Playbet.io..Casino & Sportsbook.....Grab up to  BTC + 800 Free Spins........
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
Mindborg (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 10


View Profile WWW
May 02, 2020, 07:28:33 AM
Last edit: May 02, 2020, 07:46:02 AM by Mindborg
 #10


Then open Bitcoin core, open console (Window->Console), and type getaddressinfo '3your-missing-addressxxxxxxxx'
If the value of "ismine" is "true", you've restored that address and it's beyond the default keypool (1000 receiving/change).
If 'false', then it might be a different wallet file, pasted in a different directory or core is configured with different data/wallet directory just like others suspected.


THANK YOU!
The balance of the relevant address still does not show up in my wallet, I don't know why. The balance shows on the block explorers, but not in my list of transactions. But I ran getaddressinfo for the relevant address in 0.19, and at least I got up "ismine": true.
So I have the private key, that's my main concern. From there it's just a little hassle to get things to work.

Thank you again, I am so relieved now.

It says "hdkeypath": "m/0' /0' /103'" . What does that mean? I thought maybe it means it's derivative 103 from the master key?

nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6389


Self-proclaimed Genius


View Profile
May 02, 2020, 08:40:40 AM
Merited by HCP (2), ABCbits (1)
 #11

-snip-
-snip-
It says "hdkeypath": "m/0' /0' /103'" . What does that mean? I thought maybe it means it's derivative 103 from the master key?
Hmm, that's true, it's the "derivation path" of that particular key, '103' is the index.

The result is "true" so the issue can't be something major.
You can now also remove the settings you've added in the config file since it's just at 103 in the index.
Though I don't get why the balance isn't available yet, is core fully synced? Did it rescan after you replaced the wallet.dat? (if not, try to rescan, use rescanblockchain)

If you really need to send the balance now and -rescan didn't worked, import it to electrum (electrum.org) through "Import Bitcoin addresses or private keys",
paste the private key with "p2wpkh-p2sh:PrivateKey" and make a transaction there.
To get the key from Core, type walletpassphrase "your_passphrase" 60, then dumpprivkey "your_address".

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Mindborg (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 10


View Profile WWW
May 03, 2020, 06:19:44 AM
Merited by HCP (1)
 #12

Though I don't get why the balance isn't available yet, is core fully synced? Did it rescan after you replaced the wallet.dat? (if not, try to rescan, use rescanblockchain)


I tried the rescanblockchain command after I saw the private key, it fixed the issue. Thank you again.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!