Author

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

member
Activity: 252
Merit: 11
Lord Shiva
February 17, 2018, 04: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: 3374
Merit: 6530
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: 252
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: