Bitcoin Forum
November 20, 2017, 11:42:52 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: What is the longest possible Bitcoin address? Are they all the same length?  (Read 6705 times)
gigabytecoin
Sr. Member
****
Offline Offline

Activity: 280


View Profile
June 29, 2011, 01:37:11 AM
 #1

I am working on creating a mysql database and don't want to waste any extra storage space.

So what should I make an entry for a bitcoin address?

CHAR X length? (is the address consistently one length?)

Or VARCHAR X length? (does the address change in length from user to user?)
1511221372
Hero Member
*
Offline Offline

Posts: 1511221372

View Profile Personal Message (Offline)

Ignore
1511221372
Reply with quote  #2

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

Posts: 1511221372

View Profile Personal Message (Offline)

Ignore
1511221372
Reply with quote  #2

1511221372
Report to moderator
1511221372
Hero Member
*
Offline Offline

Posts: 1511221372

View Profile Personal Message (Offline)

Ignore
1511221372
Reply with quote  #2

1511221372
Report to moderator
1511221372
Hero Member
*
Offline Offline

Posts: 1511221372

View Profile Personal Message (Offline)

Ignore
1511221372
Reply with quote  #2

1511221372
Report to moderator
EricJ2190
Full Member
***
Offline Offline

Activity: 134


View Profile
June 29, 2011, 01:46:19 AM
 #2

From the Wiki:
Quote
Addresses can contain all alphanumeric characters except 0, O, I, and l. Normal addresses currently always start with 1, though this might change in a future version. Testnet addresses usually start with m or n. Mainline addresses can be 25-34 characters in length, and testnet addresses can be 26-34 characters in length. Most addresses are 33 or 34 characters long, though.

You'll probably want to store them in a VARCHAR. Although, if you really want to save space, you can Base58 decode them and store them in binary without the checksum using only 20 bytes.
gigabytecoin
Sr. Member
****
Offline Offline

Activity: 280


View Profile
June 29, 2011, 01:56:57 AM
 #3

From the Wiki:
Quote
Addresses can contain all alphanumeric characters except 0, O, I, and l. Normal addresses currently always start with 1, though this might change in a future version. Testnet addresses usually start with m or n. Mainline addresses can be 25-34 characters in length, and testnet addresses can be 26-34 characters in length. Most addresses are 33 or 34 characters long, though.

You'll probably want to store them in a VARCHAR. Although, if you really want to save space, you can Base58 decode them and store them in binary without the checksum using only 20 bytes.

Hehe, thank you for the suggestions.

Thankfully my OCD isn't THAT out of whack Wink

Take care,
estenity
Hero Member
*****
Offline Offline

Activity: 648


View Profile
August 11, 2016, 07:46:22 PM
 #4

is it possible to transform an address with 33 characters to the same with 34 characters ? if yes, what is the modification ?
DannyHamilton
Legendary
*
Offline Offline

Activity: 1974



View Profile
August 11, 2016, 08:49:25 PM
 #5

is it possible to transform an address with 33 characters to the same with 34 characters?

Yes.

if yes, what is the modification ?

You can either add a space character at the beginning of the address, or (if you prefer) you can add a space character at the end of the address.

Why would you want to do this though?

estenity
Hero Member
*****
Offline Offline

Activity: 648


View Profile
August 11, 2016, 10:11:21 PM
 #6

because an internet site asks me to use a 34-character format.

thank you for response.
DannyHamilton
Legendary
*
Offline Offline

Activity: 1974



View Profile
August 11, 2016, 10:19:37 PM
 #7

because an internet site asks me to use a 34-character format.

thank you for response.

If the website is stripping off the whitespace, and isn't aware that bitcoin addresses aren't all 34 characters, then I'd avoid that website.  They clearly don't understand what they are doing well enough to do it properly and you are likely to have lots of problems in the future with things they don't do well.

cr1776
Legendary
*
Offline Offline

Activity: 1708


View Profile
August 11, 2016, 11:04:01 PM
 #8

because an internet site asks me to use a 34-character format.

thank you for response.

If the website is stripping off the whitespace, and isn't aware that bitcoin addresses aren't all 34 characters, then I'd avoid that website.  They clearly don't understand what they are doing well enough to do it properly and you are likely to have lots of problems in the future with things they don't do well.

Danny is correct.  If they don't have something that basic down, you should avoid them.

HOWEVER, if you absolutely have to use them, you can generate some new addresses and look for one that matches the 34 characters they are looking for.
estenity
Hero Member
*****
Offline Offline

Activity: 648


View Profile
August 11, 2016, 11:04:30 PM
 #9

because an internet site asks me to use a 34-character format.

thank you for response.

If the website is stripping off the whitespace, and isn't aware that bitcoin addresses aren't all 34 characters, then I'd avoid that website.  They clearly don't understand what they are doing well enough to do it properly and you are likely to have lots of problems in the future with things they don't do well.

correct. thank you very much indeed.
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!