Bitcoin Forum
December 03, 2016, 12:30:49 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: address length 32 vs 33  (Read 887 times)
payb.tc
Hero Member
*****
Offline Offline

Activity: 812



View Profile
October 24, 2011, 02:11:56 AM
 #1

could someone please explain why some addresses are 33 chars in length? i'm having trouble finding the info right now.

thank you.
1480725049
Hero Member
*
Offline Offline

Posts: 1480725049

View Profile Personal Message (Offline)

Ignore
1480725049
Reply with quote  #2

1480725049
Report to moderator
1480725049
Hero Member
*
Offline Offline

Posts: 1480725049

View Profile Personal Message (Offline)

Ignore
1480725049
Reply with quote  #2

1480725049
Report to moderator
1480725049
Hero Member
*
Offline Offline

Posts: 1480725049

View Profile Personal Message (Offline)

Ignore
1480725049
Reply with quote  #2

1480725049
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Xenland
Legendary
*
Offline Offline

Activity: 980


I'm not just any shaman, I'm a Sha256man


View Profile
October 24, 2011, 03:03:08 AM
 #2

Can you provide a 32 char address and a 33char address that we could analyze?
BitterTea
Sr. Member
****
Offline Offline

Activity: 294



View Profile
October 24, 2011, 03:10:29 AM
 #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.
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1344


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
October 24, 2011, 03:25:33 AM
 #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.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper wallets instead.
theymos
Administrator
Legendary
*
expert
Offline Offline

Activity: 2492


View Profile
October 24, 2011, 03:26:08 AM
 #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

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
payb.tc
Hero Member
*****
Offline Offline

Activity: 812



View Profile
October 24, 2011, 04: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://bitcointalk.org/index.php?topic=27285.msg590514#msg590514
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!