I have a question concerning Java and sha-256.
I try to do these steps discribed here to create a WIF key: https://en.bitcoin.it/wiki/Wallet_import_format
- step:
String string = "0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D";
- step (ad 80 in front):
string = "80" + string;
- perform sha-256:
- here is my mistake. I can perform sha-256 on step 2 but the result is wrong. The reason seems to be perform the hash on a String and not on binary. I get:
e2e4146a36e9c455cf95a4f259f162c353cd419cc3fd0e69ae36d7d1b6cd2c09
But I should get:
8147786C4D15106333BF278D71DADAF1079EF2D2440A4DDE37D747DED5403592
I dont get how to convert it to binary. Can someone help me?
Its the same problem as here (Correct way to convert a 256-bit private key to WIF?) but I dont understand the answer. I also cant reply to the thread because I dont have enough reputation.
Thank you :)