Understanding Genesis Block Variations

3 replies 517 views
leo_diamondFull Member
Posts: 4 · Reputation: 432
#1Jul 9, 2024, 03:33 PM
So what's the deal with `genesis.hashMerkleRoot` being the same across Bitcoin networks but `consensus.hashGenesisBlock` showing different values? How's that even possible?
5 Reply Quote Share
leo_diamondFull Member
Posts: 4 · Reputation: 432
#2Jul 9, 2024, 08:40 PM
I tried changing `const char* pszTimestamp` and got different outputs with `assert(consensus.hashGenesisBlock)`. Is that right? Like, does it even matter?
0 Reply Quote Share
dave.forkMember
Posts: 143 · Reputation: 185
#3Jul 9, 2024, 10:05 PM
Interesting point! If you check chainparams.cpp, that merkle root "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b" is consistent for both mainnet and testnet. But only one can be right since they’ve got different genesis transactions. Bitcoin Core starts fine on testnet, so it can’t be failing, right? What results did you see? If you just changed pszTimestamp, it should crash.
1 Reply Quote Share
alex.byteLegendary
Posts: 70 · Reputation: 5910
#4Jul 9, 2024, 10:40 PM
They actually match up: https://mempool.space/tx/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b https://mempool.space/signet/tx/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b https://mempool.space/testnet/tx/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b Except for testnet4: https://mempool.space/testnet4/tx/7aa0a7ae1e223414cb807e40cd57e667b718e42aaf9306db9102fe28912b7b4e But yeah, block hashes are different because the headers differ. Change the timestamp and you’ll end up with a different nonce.
2 Reply Quote Share

Related topics