Bitcoin Forum
December 08, 2016, 06:15:37 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Why private keys are base58 encoded?  (Read 2555 times)
Shevek
Sr. Member
****
Offline Offline

Activity: 252



View Profile
July 14, 2011, 11: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?

Proposals for improving bitcoin are like asses: everybody has one
1SheveKuPHpzpLqSvPSavik9wnC51voBa
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481220937
Hero Member
*
Offline Offline

Posts: 1481220937

View Profile Personal Message (Offline)

Ignore
1481220937
Reply with quote  #2

1481220937
Report to moderator
bitlotto
Hero Member
*****
Offline Offline

Activity: 672


BitLotto - best odds + best payouts + cheat-proof


View Profile WWW
July 14, 2011, 11: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.

*Next Draw Feb 1*  BitLotto: monthly raffle (0.25 BTC per ticket) Completely transparent and impossible to manipulate who wins. TOR
TOR2WEB
Donations to: 1JQdiQsjhV2uJ4Y8HFtdqteJsZhv835a8J are appreciated.
pc
Sr. Member
****
Offline Offline

Activity: 253


View Profile
July 15, 2011, 01:35:27 PM
 #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.
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 798

No Maps for These Territories


View Profile
July 15, 2011, 01:47:54 PM
 #4

The idea is that base58 is easier for humans to type in, for example from a scratch card...

Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
Shevek
Sr. Member
****
Offline Offline

Activity: 252



View Profile
July 15, 2011, 02:20:26 PM
 #5

Thanks you (everybody) for your 2 cents!

Proposals for improving bitcoin are like asses: everybody has one
1SheveKuPHpzpLqSvPSavik9wnC51voBa
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1036


View Profile WWW
July 15, 2011, 02:34:59 PM
 #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).

aka sipa, core dev team

Tips and donations: 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!