<p>how to To create a genesis block</p>

<p><code>Main.h</code></p>

<p>Delete Both Main Merkle &amp; Genesis Merkle (example)<br>
Main genesis block</p>

<pre><code>static const uint256 hashGenesisBlock("0x000004611c87517dfd29fe7f34bd6da2e1ad3d305ac12afe80a3229069390f68");
</code></pre>

<p>To</p>

<pre><code>static const uint256 hashGenesisBlock("");
</code></pre>

<hr>

<p>and inside <code>Main.h</code> too<br>
Testnet Genesis</p>

<pre><code>static const uint256 hashGenesisBlockTestNet("0x000004611c87517dfd29fe7f34bd6da2e1ad3d305ac12afe80a3229069390f68");
</code></pre>

<p>To</p>

<pre><code>static const uint256 hashGenesisBlockTestNet("");
</code></pre>

<hr>

<p>inside <code>Main.cpp</code> 
Change this to your Timestamp wanted<br>
(Example)</p>

<pre><code>const char* pszTimestamp = "Blockchain.info Block #312427 2014-07-25 14:15:16";
</code></pre>

<hr>

<p>inside: <code>Main.cpp</code><br>
Change these both to your Epoch Time wanted  //Unixtime check google</p>

<pre><code>txNew.nTime = 1406297716;  (example) (example) 
block.nTime    = 1406297716;  (example) (example) (example)
</code></pre>

<hr>

<p>inside: <code>Main.cpp</code>
Change these to 0                 </p>

<pre><code>block.nNonce   = !fTestNet ? 190271 : 190271;   (example) (example) (example)
</code></pre>

<hr>

<p>inside: <code>Main.cpp</code>
Change this to say true</p>

<pre><code>if (false &amp;&amp; (block.GetHash() != hashGenesisBlock))
</code></pre>

<p>into </p>

<pre><code>if (true &amp;&amp; (block.GetHash() != hashGenesisBlock))
</code></pre>

<hr>

<p>inside: <code>Main.cpp</code>
Delete the Merkle root</p>

<pre><code>assert(block.hashMerkleRoot == uint256("0xc9c8f6250a60dc79038b9ae68ff747488ac80d4a2db0b194cf49628495448d21"));
</code></pre>

<p>To</p>

<pre><code>assert(block.hashMerkleRoot == uint256(""));
</code></pre>

<hr>

<p>Now Compile the Wallet, and let it crash. 
as next you find on the debug file the Merkle Root/Hash
replace it into the blank space from you step before.
but make sure that you have to add to the beginning 0x
just compare and undo the steps with the new infos.</p>

<hr>

<p>Save the Main.cpp with the New <code>hashMerkleRoot</code> added by you.
and recompile. then start again and let the wallet crash 
one more time like before.  visit again the debug log 
and replace other infos.</p>

<p>you find in the debug <code>block.nNonce</code>  you remind that you remove that before. 
and the Genesis/Block Hash .. you remind you delete this as first.
copy and paste into the free space inside the Main.h and add 0x on the beginning too.</p>

<hr>

<p>That's it. Save all files and compile one more time.
and you are a Coin Developer :-)</p>

CC BY-SA 3.0
2017-10-27T15:22:21.767Z
I have followed this example and got stuck with the following error -> ERROR: CTxDB::LoadBlockIndex() : Failed stake modifier checkpoint height=0 <- described in details in a separate question ->  https://bitcoin.stackexchange.com/questions/61384/altcoin-debug-log-shows-error-ctxdbloadblockindex-failed-stake-modifier-c - appreciate your help.
m1k3y3
CC BY-SA 3.0
2016-05-29T08:24:50.363Z
2017-10-25T18:11:45.473Z
2017-10-25T18:11:45.473Z
user36103
<p>Quick and dirty solution?  Use their own initial hash.</p>

CC BY-SA 3.0
2015-12-11T01:55:24.610Z
Will this mean that the client might accidentally download the other blockchain?
nathanhleung
CC BY-SA 3.0
2015-09-25T04:50:02.600Z
2015-09-25T04:50:02.600Z
linhares
<p>You can get original blockchain (curracy that you fork) and read genesis block. Then you can see what happens there and maybe you will find bug in the code faster.</p>

CC BY-SA 3.0
2015-08-19T15:32:37.933Z
2015-08-19T15:32:37.933Z
Sebastian Xawery Wiśniowiecki
<p>I've been trying to fork the cryptocurrency Clams for about a week now. All of my code is correct to the coin's specifications, but I've been stuck on the creation of the blockchain. The developers have removed the code involving the genesis block and there doesn't seem to be any way for me to generate the PoS genesis block. If anyone has any experience with PoS coins, I would appreciate any advice incredibly. Thank you.</p>

CC BY-SA 3.0
2015-08-19T06:40:09.457Z
How do you know all of your code is correct?
Wizard Of Ozzie
CC BY-SA 3.0
2015-08-19T08:31:19.260Z
What would it mean to have a valid PoS genesis block? What would you even be proving stake of?
Nick ODell
<proof-of-stake><genesis-block><altcoin-development>
How can one create a Genesis Block for a new Proof of Stake Cryptocurrency?
CyberCriminal
# How can one create a Genesis Block for a new Proof of Stake Cryptocurrency?

(Asked by: username_0 on 2015-08-19)

I've been trying to fork the cryptocurrency Clams for about a week now. All of my code is correct to the coin's specifications, but I've been stuck on the creation of the blockchain. The developers have removed the code involving the genesis block and there doesn't seem to be any way for me to generate the PoS genesis block. If anyone has any experience with PoS coins, I would appreciate any advice incredibly. Thank you.

**Tags:** proof-of-stake, genesis-block, altcoin-development

> **Comments:**
> **username_1**: How do you know all of your code is correct?  
> **username_2**: What would it mean to have a valid PoS genesis block? What would you even be proving stake of?  

---

## 3 answers

### Answer by username_3 on 2016-05-29. Score: 1

how to To create a genesis block

`Main.h`

Delete Both Main Merkle & Genesis Merkle (example)  
Main genesis block

```
static const uint256 hashGenesisBlock("0x000004611c87517dfd29fe7f34bd6da2e1ad3d305ac12afe80a3229069390f68");

```

To

```
static const uint256 hashGenesisBlock("");

```

---

and inside `Main.h` too  
Testnet Genesis

```
static const uint256 hashGenesisBlockTestNet("0x000004611c87517dfd29fe7f34bd6da2e1ad3d305ac12afe80a3229069390f68");

```

To

```
static const uint256 hashGenesisBlockTestNet("");

```

---

inside `Main.cpp`
Change this to your Timestamp wanted  
(Example)

```
const char* pszTimestamp = "Blockchain.info Block #312427 2014-07-25 14:15:16";

```

---

inside: `Main.cpp`  
Change these both to your Epoch Time wanted //Unixtime check google

```
txNew.nTime = 1406297716;  (example) (example) 
block.nTime    = 1406297716;  (example) (example) (example)

```

---

inside: `Main.cpp`
Change these to 0

```
block.nNonce   = !fTestNet ? 190271 : 190271;   (example) (example) (example)

```

---

inside: `Main.cpp`
Change this to say true

```
if (false && (block.GetHash() != hashGenesisBlock))

```

into

```
if (true && (block.GetHash() != hashGenesisBlock))

```

---

inside: `Main.cpp`
Delete the Merkle root

```
assert(block.hashMerkleRoot == uint256("0xc9c8f6250a60dc79038b9ae68ff747488ac80d4a2db0b194cf49628495448d21"));

```

To

```
assert(block.hashMerkleRoot == uint256(""));

```

---

Now Compile the Wallet, and let it crash.
as next you find on the debug file the Merkle Root/Hash
replace it into the blank space from you step before.
but make sure that you have to add to the beginning 0x
just compare and undo the steps with the new infos.

---

Save the Main.cpp with the New `hashMerkleRoot` added by you.
and recompile. then start again and let the wallet crash
one more time like before. visit again the debug log
and replace other infos.

you find in the debug `block.nNonce` you remind that you remove that before.
and the Genesis/Block Hash .. you remind you delete this as first.
copy and paste into the free space inside the Main.h and add 0x on the beginning too.

---

That's it. Save all files and compile one more time.
and you are a Coin Developer :-)

> **Comments:**
> **username_4**: I have followed this example and got stuck with the following error -> ERROR: CTxDB::LoadBlockIndex() : Failed stake modifier checkpoint height=0 <- described in details in a separate question ->  https://bitcoin.stackexchange.com/questions/61384/altcoin-debug-log-shows-error-ctxdbloadblockindex-failed-stake-modifier-c - appreciate your help.  

---

### Answer by username_5 on 2015-09-25. Score: 1

Quick and dirty solution? Use their own initial hash.

> **Comments:**
> **username_6**: Will this mean that the client might accidentally download the other blockchain?  

---

### Answer by username_7 on 2015-08-19. Score: 0

You can get original blockchain (curracy that you fork) and read genesis block. Then you can see what happens there and maybe you will find bug in the code faster.


---

