Bitcoin Forum
May 04, 2024, 08:16:36 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What is the longest possible Bitcoin address? Are they all the same length?  (Read 7290 times)
gigabytecoin (OP)
Sr. Member
****
Offline Offline

Activity: 280
Merit: 252


View Profile
June 29, 2011, 01:37:11 AM
Merited by ABCbits (2)
 #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?)
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
EricJ2190
Full Member
***
Offline Offline

Activity: 134
Merit: 102


View Profile
June 29, 2011, 01:46:19 AM
Merited by ABCbits (2)
 #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 (OP)
Sr. Member
****
Offline Offline

Activity: 280
Merit: 252


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: 1918
Merit: 535


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: 3388
Merit: 4616



View Profile
August 11, 2016, 08:49:25 PM
Merited by ABCbits (1)
 #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: 1918
Merit: 535


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: 3388
Merit: 4616



View Profile
August 11, 2016, 10:19:37 PM
Merited by ABCbits (1)
 #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: 4032
Merit: 1299


View Profile
August 11, 2016, 11:04:01 PM
Merited by ABCbits (1)
 #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: 1918
Merit: 535


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!