Post
Topic
Board Altcoin Discussion
Re: Dumping private key from hex
by
achow101
on 02/10/2017, 02:40:02 UTC
ok here what i did . sound like there some confusion here let's clear it out .

i created a new doge wallet DTBZuzsFoXxNu1gUPiwL7Yu64atUcsk7Tm .
Then dumpprivkey DTBZuzsFoXxNu1gUPiwL7Yu64atUcsk7Tm -- > QNoGCcEp6R86Ag5SNPoxVGkXMAx3L2Dedv6BkKJzCEoPSJzE8oLV
Then went here : https://walletgenerator.net/
This site show private key hex as : 0578AA4071328241247763B63134918892FFDA1E3C1DFE402F0A01D623B3FB97
opened hex editor searching for the string :
i found the string , as i said above all doge wallet private key has a start hex of 3081D30201010420   .

3081D30201010420 0578AA4071328241247763B63134918892FFDA1E3C1DFE402F0A01D623B3FB97


now when i do a base58 decode of the private key (QNoGCcEp6R86Ag5SNPoxVGkXMAx3L2Dedv6BkKJzCEoPSJzE8oLV)  here is what i get :

9E 0578AA4071328241247763B63134918892FFDA1E3C1DFE402F0A01D623B3FB97 (0134CC212A)


Here is the same procedure for another wallet :
New wallet : D6Rka31SFm8PnN2Cs9QWj5YcfzRpkXx6fw
Then dumpprivkey D6Rka31SFm8PnN2Cs9QWj5YcfzRpkXx6fw -- > QQToBX1SQBSuZo8ijsTLyL7cx9gn9QjK8s7XCBHXy8AUF2om1tNs
Then went here : https://walletgenerator.net/
This site show private key hex as : 3721D639228B9215C6BFF746CA163391CDBADB8566FC8FECB74871E8FAA24FE7
opened hex editor searching for the string :
i found the string , as i said above all doge wallet private key has a start hex of 3081D30201010420   .

3081D30201010420  3721D639228B9215C6BFF746CA163391CDBADB8566FC8FECB74871E8FAA24FE7

now when i do a base58 decode of the private key (QNoGCcEp6R86Ag5SNPoxVGkXMAx3L2Dedv6BkKJzCEoPSJzE8oLV)  here is what i get :
9E 3721D639228B9215C6BFF746CA163391CDBADB8566FC8FECB74871E8FAA24FE7 (015B6ADEE0)


I hope that you get the point all that i need now is to generate this (015B6ADEE0 or 0134CC212A ) for my own wallet .
I see. And where did the 2B come from?

Anyways, I see the problem. The 01 is actually part of the payload (i.e. the private key). It is a flag byte that signals that the private key should be used with a compressed public key. So the bytes you actually hash is
Code:
9E3721D639228B9215C6BFF746CA163391CDBADB8566FC8FECB74871E8FAA24FE701
Hashing those as bytes with sha256d (you can use a tool like http://www.fileformat.info/tool/hash.htm) yields the following hash:
Code:
5b6adee01d509671a81c129ab5395c906df775bb0520a633e862a62c76458f20
The first 4 bytes of that hash matches the checksum that you need: 5b6adee0