Bitcoin Forum

Other => Beginners & Help => Topic started by: Little Mouse on June 23, 2020, 04:16:45 AM



Title: Bitcoin address with 31 characters
Post by: Little Mouse on June 23, 2020, 04:16:45 AM
Usually, most addresses are formed with 34 characters but today from this post- https://bitcointalk.org/index.php?topic=5257277.msg54667420#msg54667420, I knew that there is one address with 31 characters. After that, I searched on web and got that an address can be even 26 characters.
When an address can be shorter and how is it possible to generate a shorter address?


Title: Re: Bitcoin address with 31 characters
Post by: jackg on June 23, 2020, 04:34:30 AM
I think it's just that the 0s at the start are compressed into nothing like you do with numbers.

It's more logical to write 5462 than 00005462 unless you're using a screen or memory system that specifically implies its usage.

It's probably possible to get a 1 character base 58 ripemd hash too which is potentially still secure (I haven't looked into anything other than sha1 and 2)....


Title: Re: Bitcoin address with 31 characters
Post by: witcher_sense on June 23, 2020, 04:38:47 AM
https://bitcoin.stackexchange.com/questions/36944/what-are-the-minimum-and-maximum-lengths-of-a-mainnet-bitcoin-address

Quote
Private key and public key has a fixed size. Private keys are always 32 bytes, and public keys are always 65 bytes. However the bitcoin addresses are generated from the public key using Base58 encoding
Base58 generates a 35 characters address but as mentioned in the link and leading zero bytes are expressed as a single "1".

Code:
repeat(number_of_leading_zero_bytes_in_hash)
   {
   output_string.append(code_string[0]);
   }
Depending on the number of leading zeros, the minimum number can be different. Theoretically it even can be as small as 20 characters so you cant define the minimum length for the bitcoin addresses.

how is it possible to generate a shorter address?

I think this is not possible to predict an outcome of the function since elliptic curve cryptograpghy is one way calculation. If it would be possible to calculate a specific length address, it could be possible to find a corresponding private key, which makes the whole process useless and senseless. So, you first have to check every private key to find public key and only then a specific address.


Title: Re: Bitcoin address with 31 characters
Post by: nc50lc on June 23, 2020, 04:48:59 AM
Basically, you need to bruteforce a Private key and Public key pair that will generate a SHA256 Hash then RIPEMD160 hash of that hash that have lots of trailing '0' at start.
And it shouldn't be a P2SH address because the data to be encoded into base58 will start with '05' instead of '0'.

Example: if you luckily get a RIPEMD160 hash like: 000000000000000536DD9030ECAC2E9D57457EBB that begins with 15 zeroes,
It will result to a valid address: 111111113qqRYCfHaQTXy58agJLihjB which is 31 characters long.


Title: Re: Bitcoin address with 31 characters
Post by: pooya87 on June 23, 2020, 04:49:37 AM
I think it's just that the 0s at the start are compressed into nothing like you do with numbers.

It's more logical to write 5462 than 00005462 unless you're using a screen or memory system that specifically implies its usage.

It's probably possible to get a 1 character base 58 ripemd hash too which is potentially still secure (I haven't looked into anything other than sha1 and 2)....

hashes are not numbers, they are bytes. so there is a big difference between 5462 and 00005462 if it is hash. even if your hash result was all zeros it still is 160 bits or 20 bytes of zero and when passed to an encoder the entire 20 bytes is passed and when base58 encoding sees zeros at the start it replaces them with 1s. other encodings do similar things, for example base16 replaces it with 00, bech32 replaces it with q and so on.