Author

Topic: By what formula is the genesis-hash calculated? (Read 198 times)

member
Activity: 294
Merit: 11
Lord Shiva
February 17, 2018, 03:41:07 AM
#4
Thank you. I'll try to figure it out Smiley
member
Activity: 322
Merit: 54
Consensus is Constitution
This:

printf("calc new genesis block\n");
            printf("hashMerkleRoot %s\n", genesis.hashMerkleRoot.ToString().c_str());
            printf("bnProofOfWorkLimit 0x%x\n", bnProofOfWorkLimit.GetCompact());
            printf("genesis.nBits 0x%x\n", genesis.nBits);

            for (genesis.nNonce = 0; ; genesis.nNonce++) {
                hashGenesisBlock = genesis.GetHash();
                if (hashGenesisBlock <= bnProofOfWorkLimit.getuint256()) break;
            }

            printf("hashGenesisBlock %s\n", hashGenesisBlock.ToString().c_str());
            printf("genesis.nNonce %d\n", genesis.nNonce);
staff
Activity: 3458
Merit: 6793
Just writing some code
It's the hash of the genesis block. The genesis blocks parameters can be found in chainparams.cpp. It is then serialized and hashed.
member
Activity: 294
Merit: 11
Lord Shiva
Hello!

Tell me please: by what formula is the genesis-hash calculated?

Code:
uint256 hashGenesisBlock("0x12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2");

That is:

Code:
0x12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2

what? Smiley

(A+B)*C = 0x12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2?  Cool

I understand that this is a hash from something Smiley But from what?

Thank you.
Jump to: