Bitcoin Forum
May 23, 2018, 05:20:29 PM *
News: Latest stable version of Bitcoin Core: 0.16.0  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: address length 32 vs 33  (Read 1010 times)
payb.tc
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



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.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1527096030
Hero Member
*
Offline Offline

Posts: 1527096030

View Profile Personal Message (Offline)

Ignore
1527096030
Reply with quote  #2

1527096030
Report to moderator
1527096030
Hero Member
*
Offline Offline

Posts: 1527096030

View Profile Personal Message (Offline)

Ignore
1527096030
Reply with quote  #2

1527096030
Report to moderator
Xenland
Legendary
*
Offline Offline

Activity: 980
Merit: 1000


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
Merit: 250



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: 1386
Merit: 1039


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 or hardware wallets instead.
theymos
Administrator
Legendary
*
expert
Offline Offline

Activity: 3038
Merit: 3122


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

HOWEYCOINS   ▮      Excitement and         ⭐  ● TWITTER  ● FACEBOOK   ⭐       
  ▮    guaranteed returns                 ●TELEGRAM                         
  ▮  of the travel industry
    ⭐  ●Ann Thread ●Instagram   ⭐ 
✅    U.S.Sec    ➡️
✅  approved!  ➡️
payb.tc
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



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!