Bitcoin Forum
May 11, 2024, 03:12:18 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: By what formula is the genesis-hash calculated?  (Read 181 times)
Many Coins (OP)
Member
**
Offline Offline

Activity: 266
Merit: 11

Lord Shiva


View Profile
February 16, 2018, 06:36:09 PM
 #1

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.
1715440338
Hero Member
*
Offline Offline

Posts: 1715440338

View Profile Personal Message (Offline)

Ignore
1715440338
Reply with quote  #2

1715440338
Report to moderator
1715440338
Hero Member
*
Offline Offline

Posts: 1715440338

View Profile Personal Message (Offline)

Ignore
1715440338
Reply with quote  #2

1715440338
Report to moderator
1715440338
Hero Member
*
Offline Offline

Posts: 1715440338

View Profile Personal Message (Offline)

Ignore
1715440338
Reply with quote  #2

1715440338
Report to moderator
"Governments are good at cutting off the heads of a centrally controlled networks like Napster, but pure P2P networks like Gnutella and Tor seem to be holding their own." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
February 16, 2018, 09:07:51 PM
 #2

It's the hash of the genesis block. The genesis blocks parameters can be found in chainparams.cpp. It is then serialized and hashed.

ir.hn
Member
**
Offline Offline

Activity: 322
Merit: 54

Consensus is Constitution


View Profile
February 17, 2018, 04:44:58 AM
 #3

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);

Many Coins (OP)
Member
**
Offline Offline

Activity: 266
Merit: 11

Lord Shiva


View Profile
February 17, 2018, 08:41:07 AM
 #4

Thank you. I'll try to figure it out Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!