Does anyone know, how to reproduce Satoshi's seed, which was used to initialize his random number generator, when he tried to mine "bnNonce" in the prenet coinbase transaction in 2008?
Source code:
https://bitcointalk.org/index.php?topic=382374.msg4108762#msg4108762bool BitcoinMiner()
{
printf("BitcoinMiner started\n");
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_LOWEST);
CBlock blockPrev;
while (fGenerateBitcoins)
{
CheckForShutdown(3);
//
// Create coinbase tx
//
CTransaction txNew;
txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull();
CBigNum bnNonce; // this nonce is so multiple processes working for the same keyUser
BN_rand_range(&bnNonce, &CBigNum(INT_MAX)); // don't cover the same ground
txNew.vin[0].scriptSig << bnNonce;
txNew.vout.resize(1);
txNew.vout[0].scriptPubKey << OP_CODESEPARATOR << keyUser.GetPubKey() << OP_CHECKSIG;
txNew.vout[0].posNext.SetNull();
Here, we can see "695dbf0e" as "bnNonce". It is supposed to be random, but it is only some 32-bit number, so there are not so many values to check. And also, it comes from "BigNumber" library, which is also used for other purposes. So, is the same randomness used to generate the private key for "04 d451b0d7e567c615719a630b9f44632a0f34f5e7101f9942fe0b39996151cef1 0a809c443df2fab7cd7e58a3538cd8afd08ccfaa49b637de4b1b383f088ad131", or is it somehow separated? Because if it is connected, then potentially, this private key can be recovered.
Also, if the source of randomness is just some timestamp from 2008, then it could reveal, when exactly this public key was created.
Edit: It seems "OpenSSL 0.9.8h 28 May 2008" was in use, or maybe even some older version. And it contains these pseudo-random values, which can give a hint, if called functions were pseudorandom for prenet, just to test things, or if the real randomness was used:
static int fbytes_counter = 0;
static const char *numbers[8] = {
"651056770906015076056810763456358567190100156695615665659",
"6140507067065001063065065565667405560006161556565665656654",
"8763001015071075675010661307616710783570106710677817767166"
"71676178726717",
"7000000175690566466555057817571571075705015757757057795755"
"55657156756655",
"1275552191113212300012030439187146164646146646466749494799",
"1542725565216523985789236956265265265235675811949404040041",
"1456427555219115346513212300075341203043918714616464614664"
"64667494947990",
"1712787255652165239672857892369562652652652356758119494040"
"40041670216363"};
int fbytes(unsigned char *buf, int num)
{
int ret;
BIGNUM *tmp = NULL;
if (fbytes_counter >= 8)
return 0;
tmp = BN_new();
if (!tmp)
return 0;
if (!BN_dec2bn(&tmp, numbers[fbytes_counter]))
{
BN_free(tmp);
return 0;
}
fbytes_counter ++;
ret = BN_bn2bin(tmp, buf);
if (ret == 0 || ret != num)
ret = 0;
else
ret = 1;
if (tmp)
BN_free(tmp);
return ret;
}
Still trying to figure it out, if things are random or pseudorandom. Starting from pseudorandom should be easier, because it should give the exact same numbers.