Bitcoin Forum
May 07, 2024, 04:44:34 AM *
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.
1715057074
Hero Member
*
Offline Offline

Posts: 1715057074

View Profile Personal Message (Offline)

Ignore
1715057074
Reply with quote  #2

1715057074
Report to moderator
1715057074
Hero Member
*
Offline Offline

Posts: 1715057074

View Profile Personal Message (Offline)

Ignore
1715057074
Reply with quote  #2

1715057074
Report to moderator
1715057074
Hero Member
*
Offline Offline

Posts: 1715057074

View Profile Personal Message (Offline)

Ignore
1715057074
Reply with quote  #2

1715057074
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, but full nodes are more resource-heavy, and they must do a lengthy initial syncing process. As a result, lightweight clients with somewhat less security are commonly used.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715057074
Hero Member
*
Offline Offline

Posts: 1715057074

View Profile Personal Message (Offline)

Ignore
1715057074
Reply with quote  #2

1715057074
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6587


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!