<p>The problem is that you changed the testnet parameters too, not just the mainnet parameters. However I doubt that you regenerated the testnet genesis block, or if you did, you did not set the assert correctly. You set the assert in the testnet chain parameters to be the mainnet genesis block hash and merkle root. But that is obviously wrong; testnet is not the same as mainnet. To fix this, you should either revert the change, or generate a new testnet genesis block and set those asserts accordingly.</p>

CC BY-SA 3.0
2017-11-14T06:33:16.513Z
If I revert the testnet params back to their original values. I still get an assert error `bitcoin-qt: chainparams.cpp:227: CTestNetParams::CTestNetParams(): Assertion `consensus.hashGenesisBlock == uint256S("0x000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943")' failed.
Aborted (core dumped)`
Dev Oskii
CC BY-SA 3.0
2017-11-14T05:23:01.083Z
2017-11-14T05:23:01.083Z
Ava Chow
<h3>I am trying to create my own genesis block using the bitcoin source code but my new hashes are not being accepted by the assert statements.</h3>

<p><strong><em>Step 1:</em></strong> </p>

<p>I have changed the <code>pszTimestamp</code> variable in <code>chainparams.cpp</code> to generate my own genesis hash.</p>

<p>I have added into the code some print statements to check the genesis hash and merkle root as they are generated from my new <code>pszTimestamp</code>. </p>

<p>The hashes I have generated are:</p>

<p><em>MERKLE ROOT</em>:<code>9f46bcd8a56be2b6b022acbcc859b201534c21801b1b73685a69de17ad37665e</code></p>

<p><em>GENESIS HASH:</em><code>cc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648</code></p>

<p><strong><em>Step 2:</em></strong></p>

<p>I have changed the <code>assert</code> statements below to assert the new hashes on <code>line 131</code> and <code>line 230</code> of <code>chainparams.cpp</code></p>

<p><strong>The Genesis Block</strong> 
<code>assert(consensus.hashGenesisBlock==uint256S("0xcc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648"));</code></p>

<p><strong>The Merkle Root</strong> 
<code>assert(genesis.hashMerkleRoot==int256S("0x9f46bcd8a56be2b6b022acbcc859b201534c1801b1b73685a69de17ad37665e"));</code></p>

<h3>However...</h3>

<p>These assert statements still fail. <strong>Why?</strong></p>

<p>I have included the error message below:</p>

<p><code>bitcoin-qt: chainparams.cpp:230: CTestNetParams::CTestNetParams(): Assertion `consensus.hashGenesisBlock == uint256S("0xcc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648")' failed.
Aborted (core dumped)</code></p>

CC BY-SA 4.0
2018-11-15T21:48:42.213Z
Downvoted. We have many questions regarding programming issues when creating a new altcoin. I don't believe such questions benefit a general audience, and this is a Q&A site, not a place for support. Furthermore, as a learning experience, contributing to an existing project is far more valuable.
Pieter Wuille
CC BY-SA 4.0
2020-03-28T07:57:51.297Z
The question has over 1000 views now so obviously others are facing the issue...
Dev Oskii
<bitcoin-core><genesis-block>
why did assert fail when creating my own genesis block?
Dev Oskii
# why did assert fail when creating my own genesis block?

(Asked by: username_0 on 2017-11-14)

### I am trying to create my own genesis block using the bitcoin source code but my new hashes are not being accepted by the assert statements.

***Step 1:***

I have changed the `pszTimestamp` variable in `chainparams.cpp` to generate my own genesis hash.

I have added into the code some print statements to check the genesis hash and merkle root as they are generated from my new `pszTimestamp`.

The hashes I have generated are:

*MERKLE ROOT*:`9f46bcd8a56be2b6b022acbcc859b201534c21801b1b73685a69de17ad37665e`

*GENESIS HASH:*`cc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648`

***Step 2:***

I have changed the `assert` statements below to assert the new hashes on `line 131` and `line 230` of `chainparams.cpp`

**The Genesis Block**
`assert(consensus.hashGenesisBlock==uint256S("0xcc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648"));`

**The Merkle Root**
`assert(genesis.hashMerkleRoot==int256S("0x9f46bcd8a56be2b6b022acbcc859b201534c1801b1b73685a69de17ad37665e"));`

### However...

These assert statements still fail. **Why?**

I have included the error message below:

`bitcoin-qt: chainparams.cpp:230: CTestNetParams::CTestNetParams(): Assertion `consensus.hashGenesisBlock == uint256S("0xcc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648")' failed.
Aborted (core dumped)`

**Tags:** bitcoin-core, genesis-block

> **Comments:**
> **username_1**: Downvoted. We have many questions regarding programming issues when creating a new altcoin. I don't believe such questions benefit a general audience, and this is a Q&A site, not a place for support. Furthermore, as a learning experience, contributing to an existing project is far more valuable.  
> **username_0**: The question has over 1000 views now so obviously others are facing the issue...  

---

## 1 answers

### Answer by username_2 on 2017-11-14. Score: 1 | Accepted answer

The problem is that you changed the testnet parameters too, not just the mainnet parameters. However I doubt that you regenerated the testnet genesis block, or if you did, you did not set the assert correctly. You set the assert in the testnet chain parameters to be the mainnet genesis block hash and merkle root. But that is obviously wrong; testnet is not the same as mainnet. To fix this, you should either revert the change, or generate a new testnet genesis block and set those asserts accordingly.

> **Comments:**
> **username_0**: If I revert the testnet params back to their original values. I still get an assert error `bitcoin-qt: chainparams.cpp:227: CTestNetParams::CTestNetParams(): Assertion `consensus.hashGenesisBlock == uint256S("0x000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943")' failed. Aborted (core dumped)`  

---

