Author

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

hero member
Activity: 812
Merit: 1000
October 24, 2011, 12:18:53 AM
#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: 5166
Merit: 12850
October 23, 2011, 11: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: 1136
The Casascius 1oz 10BTC Silver Round (w/ Gold B)
October 23, 2011, 11: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: 250
October 23, 2011, 11: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, 11: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, 10: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: