freicoin / freicoin-old

Bitcoin integration/staging tree
http://www.bitcoin.org
MIT License
26 stars 8 forks source link

Address serialization #18

Open maaku opened 12 years ago

maaku commented 12 years ago

Bitcoin uses a custom “base58” format for serialization. This is a rather bizarre, non-standard serialization format invented by Satoshi, and has some serious drawbacks. Most notably it is case-sensitive. This is a poor choice for a lowest-common-denominator serialization format because there are suprisingly many cases where case sensitivity is an issue. Some teletype machines are case insensitive, for example, and there are plenty of mainframe financial systems that for reasons of compatibility and heritage transform their input losing case sensitivity in the process. But even if you chose to ignore these archaic systems, case sensitivity is cumbersome to voice over an audio channel and more difficult for machine readers to parse.

Fortunately, there is a widely used standard that addresses these problems. It's base32, using the 26 case-insensitive letters of the English version of the Roman alphabet plus the numbers 2 through 9 (0 and 1 dropped due to their visual similarity to O and l). A bitcoin/freicoin address in base32 might look like the following:

ACOBDBNFYXU7YVDBFAEJO7XI6VELEJMNGECATZPM

I would recommend breaking it up with hyphens every eight characters:

ACOBDBNF-YXU7YVDB-FAEJO7XI-6VELEJMN-GECATZPM

And if the capital letters rub you the wrong way, you free to write lowercase without changing the meaning:

freicoin:acobdbnf-yxu7yvdb-faejo7xi-6velejmn-gecatzpm

The result is something that is easily read over the phone (using the phonetic alphabet), or printed out and scanned by a machine reader, or transmitted through a database that does not preserve capitalization.

EDIT: Then again, there's some significant downsides to breaking visual compatibility with bitcoin addresses. I'm more putting this out there to see what others think...

jtimon commented 12 years ago

The drawback of base32 is that it has longer addresses, right? Not a serious drawback. Maybe what you say about making them visually different from bitcoin addresses. I don't know what I prefer, but honestly I'm not much concerned with people reading addresses over the phone neither.

maaku commented 12 years ago

They'd be approximately 18% longer (40 characters instead of ~34). Another disadvantage of base58 from the machine processing perspective is that they're not a consistent length.

Having had a few days to think about it though, I think the disadvantage of having to re-write all the existing bitcoin infrastructure to work with base32 could be a hindrance early on. Perhaps the best path forward is to turn this into a BIP and get simultaneous adoption with bitcoin.

jtimon commented 12 years ago

Not consistent length, Mhhmm. Yes, that BIP idea makes sense. I'm sure there will be more discussion there.

maaku commented 12 years ago

Marked as Someday/Maybe.