Post
Topic
Board Development & Technical Discussion
Re: converting 52bit private keys to Base58 format
by
fbueller
on 05/11/2015, 15:41:25 UTC
Note: they're not '52bit'. They're all 256-bit.

Maybe you're talking about the length of the WIF - 52 characters - but since base58 encodes more data per character, that's why it's not a 32 byte (== 256bit) binary string.

As you know, the same private key can be encoded differently to indicate that it's public key should be compressed when generating the address.

You just base58_decode(), and add or remove the \x01 byte after the private key, and re-encode to get the WIF for other address.