Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: remotemass on February 13, 2013, 09:19:02 AM



Title: How many palindromes as private keys?
Post by: remotemass on February 13, 2013, 09:19:02 AM
I am wondering how many palindromes of 256 bits are there.
Private keys that are palindromes must be quite seldom.


Title: Re: How many palindromes as private keys?
Post by: picobit on February 13, 2013, 09:42:48 AM
I am wondering how many palindromes of 256 bits are there.
Private keys that are palindromes must be quite seldom.
2^128 = 3 * 10^38

And the chance that a random key is a palindrome is 1 divided by that number, that is zero for any practical purposes (the number of nanoseconds since the creation of the universe is only 2*10^19, i.e. 10000000000000000000 times smaller)

Of course you can create a palindromic private key easily, if you want to.


Title: Re: How many palindromes as private keys?
Post by: JoelKatz on February 13, 2013, 09:59:23 AM
The key insight is to see that there's a one-to-one correspondence between 128-bit strings and 256-bit palindromes.


Title: Re: How many palindromes as private keys?
Post by: misterbigg on February 14, 2013, 01:49:30 PM
Well, just to make things interesting how many case-insensitive palindromic encoded public keys are there?


Title: Re: How many palindromes as private keys?
Post by: DannyHamilton on February 14, 2013, 03:30:51 PM
Well, just to make things interesting how many case-insensitive palindromic encoded public keys are there?
Has it been proven that there is a one-to-one relationship between public keys and private keys in ECDSA with the secp256k1 curve?  If not, then there is no way to know the answer to your question, since there is no way to know what values are valid public keys without first calculating all of them.


Title: Re: How many palindromes as private keys?
Post by: misterbigg on February 14, 2013, 05:28:46 PM
Oh...right. Well how about private keys?


Title: Re: How many palindromes as private keys?
Post by: DannyHamilton on February 14, 2013, 05:44:26 PM
Oh...right. Well how about private keys?
That is going to depend on the format of the key I suppose.

Binary? (I think it would be 2128, right?)
Hex?
Base 10?
Base58Check Wallet Import Format?
Mini Private Key Format?
Base 62?
Base 64?
Extended Ascii (Base 256)?

 ;D

Guess I'm just being a PItA at this point.  I suspect that you mean Base58Check Wallet Import Format.


Title: Re: How many palindromes as private keys?
Post by: misterbigg on February 14, 2013, 05:51:31 PM
Yes on all counts


Title: Re: How many palindromes as private keys?
Post by: DannyHamilton on February 14, 2013, 06:04:10 PM
Ok, lets assume you are only referring to Wallet Import Format of uncompressed keys. If I properly recall the specifics of the forma that means the private key should be 51 characters long and always start with either 5H, 5J, or 5K.
The next 24 characters can each be any of 35 different characters.

I'd think that would work out to something like:
3 x 3524

Does that work out to something like 3 x 1048