1
I'm trying to learn every bit of the process of converting a private key to WIF (Wallet Import Format).
I've been following the steps on this page and have made it all the way to the last step (Step 7 - "Convert the result from a byte string into a base58 string using Base58Check encoding") and that's where I'm stuck.
I need to use this process:
code_string = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
x = convert_bytes_to_big_integer(hash_result)
output_string = ""
while(x > 0)
{
(x, remainder) = divide(x, 58)
output_string.append(code_string[remainder])
}
repeat(number_of_leading_zero_bytes_in_hash)
{
output_string.append(code_string[0]);
}
output_string.reverse();
That process is from the Bitcoin wiki.
I'm pretty sure I've managed to decipher all of it except for this part:
x = convert_bytes_to_big_integer(hash_result)
It looks like its telling me to convert the bytes of a hash result into a "big integer", but I'm not sure what hash result it's referring to (I think maybe this one?: 800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D) and I don't know how to convert its bytes to a "big integer" (keep in mind that I'm trying to learn and therefore need to do all of the math myself instead of simply having an existing programming command or web tool do it for me).
And to a lesser extent this part:
repeat(number_of_leading_zero_bytes_in_hash)
I'm not sure what "hash" it's referring to.
I've spent many hours trying to figure all this out and have done a lot of searching and tried many possible interpretations so please don't think I'm just looking for someone to do the work for me.
Thank you.
What a great answer. Thanks so much! Got it all figured out now, and even have my own handy dandy Bitcoin wallet generator! – Eric Glass – 2017-09-29T09:31:29.407