Author

Topic: address length 32 vs 33 (Read 1127 times)

hero member
Activity: 812
Merit: 1000
October 23, 2011, 11:18:53 PM
#6
cheers, very well explained.

i was doing some experimentation on payb.tc and turns out i didn't need to know after all... but interesting none-the-less!

edit: here's what i added to the site (just for fun mostly)... https://bitcointalksearch.org/topic/m.590514
administrator
Activity: 5222
Merit: 13032
October 23, 2011, 10:26:08 PM
#5
According to this, they can actually be 25-34 characters long.

I think the range of sizes comes from the Base58 conversion and/or from the endian-ness conversions. This is just off the top of my head, so I could be incorrect.

Right. It's due to the Base58 conversion, and especially the way Bitcoin handles zeroes.

25-character addresses aren't really possible, but this is only due to "bad luck" in the hashes that SHA-256 produces. Here's a 26-character address, the shortest length that is actually possible:
11111111111111111111BZbvjr
vip
Activity: 1386
Merit: 1140
The Casascius 1oz 10BTC Silver Round (w/ Gold B)
October 23, 2011, 10:25:33 PM
#4
Here is why.  It has to do with how they are formed.

A Bitcoin address encodes a 160-bit hash of a public key.  That 160-bit hash could start with several zero bits.  When it does, you get the shorter codes.

If the first sixteen bits are greater than 0AF8 hex (approximately), the address is going to be 33 characters.  If less than 0AF8, it'll typically be 32 characters.  A character is saved because some zero bits are implied by the character's absence.  So about 4.3% of the time, you'll get a short address.  It is perfectly valid.

See Base58Check in the Wiki for details.

The address also contains check digits, so there is no concern about whether leaving out a character from an address will likely be another valid address.
sr. member
Activity: 294
Merit: 252
October 23, 2011, 10:10:29 PM
#3
According to this, they can actually be 25-34 characters long.

I think the range of sizes comes from the Base58 conversion and/or from the endian-ness conversions. This is just off the top of my head, so I could be incorrect.
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
October 23, 2011, 10:03:08 PM
#2
Can you provide a 32 char address and a 33char address that we could analyze?
hero member
Activity: 812
Merit: 1000
October 23, 2011, 09:11:56 PM
#1
could someone please explain why some addresses are 33 chars in length? i'm having trouble finding the info right now.

thank you.
Jump to: