Author

Topic: Why private keys are base58 encoded? (Read 2895 times)

legendary
Activity: 1072
Merit: 1181
July 15, 2011, 09:34:59 AM
#6
I chose something similar to addresses because the code was available, it had a checksum against typo's, and 51 characters seemed reasonable enough to bother with implementing something else (base64 being 48 characters with the same level of checksums).
sr. member
Activity: 252
Merit: 250
July 15, 2011, 09:20:26 AM
#5
Thanks you (everybody) for your 2 cents!
hero member
Activity: 812
Merit: 1022
No Maps for These Territories
July 15, 2011, 08:47:54 AM
#4
The idea is that base58 is easier for humans to type in, for example from a scratch card...
pc
sr. member
Activity: 253
Merit: 250
July 15, 2011, 08:35:27 AM
#3
Even if a private key should never be sent out publicly, it's conceivable that one might want to have a physical copy somewhere printed or written out, like in a safe or something. In that case, it may be useful to have the same base58 encoding to make sure people don't confuse 1 and l and the like.

So, I suspect that encoding it like addresses was just as easy as any other encoding, and lets one do the same writing-down that addresses have.
hero member
Activity: 672
Merit: 500
BitLotto - best odds + best payouts + cheat-proof
July 14, 2011, 06:11:52 PM
#2
Probably mostly so it is coded like the address. It looks cool.
The first byte of key is 0x80 so begins with 5.
sr. member
Activity: 252
Merit: 250
July 14, 2011, 06:00:18 PM
#1
Playing around generation of vanity addresses, I've discovered that private keys are stored as base58 numbers, with the character "5" at the beginning.

But... why?

The reason why public keys are distributed in base58, I can understand: base58 is a kind of base64 without some conflicting characters that could be confused and taken as phising target.

But, private keys never should be cast out. So, base64 seems to be perfect for the goal, because it is the easiest way to "textify" binaries, the most compact and most universal.

For example, the private key:

Code:
5JEiDZ747ZRjB22ie48Gq1ADUZuU2Fjw2xJE5D4LCXcK8E81zAh

In base64 (excluding the starting "5"):

Code:
I3fcciKvYeoG/mTtUnTbX1XAW4WGqrWz1Z2g7/IC1Mz/B4++G

Any clues for this strange election?
Jump to: