Is there a pattern to a Monero private spend key? Do they all start with 3?
2 Answers
No. Private keys are created from 32 random bytes.
-
But the public addresses start with a 4 and 8 for sub addresses right?– Patoshi パトシ ♦Commented Jan 25, 2019 at 21:21
-
A public address is not a private key. In fact, a public address is not even simply a public key - it is a network byte, public spend key, public view key and a checksum concatenated and encoded in base58. Commented Jan 25, 2019 at 21:59
-
-
Yes, I omitted the reduction of the random scalar which leads to the likelihood of 0 as the penultimate character in the hex string, per your answer. Commented Jan 26, 2019 at 15:57
Monero secret keys can start with any hex digit.
Monero secret keys are random numbers that are less than 2^252 + 27742317777372353535851937790883648493.
This means that the most significant byte of a secret key must start with the hex digit 0 or 1.
Because Monero uses little endian representation, the most significant byte is the last byte in the sequence.
Therefore, in hex representation, the second to last digit in the hex string will always be 0 or 1.
There will only be 27742317777372353535851937790883648493 occurrences out of a possible 2^252 + 27742317777372353535851937790883648493 choices that the secret key will exceed 2^252. This is a 1 in 260865210881371562277766582181260781349 chance.
Therefore, the second to last digit in the hex string of a Monero secret key will almost certainly be 0 except in very rare circumstances.