Post
Topic
Board Development & Technical Discussion
Merits 2 from 2 users
Re: back to creating new alt coin
by
BlackHatCoiner
on 24/12/2021, 18:37:05 UTC
⭐ Merited by PawGo (1) ,JustAnOtherLoser (1)
Alright, so here's what you're going to do. Go on genesisgen on github, download genesis.c and build it. Once you have the executable, run name.exe <pubkey> <timestamp> <nBits>.

In <pubkey> you should add your public key in uncompressed format. In <timestamp> your message. In <nBits> the target. Leave it on 486604799 (1d00ffff) which is the lowest you can have with a difficulty of 1.

Once you mine the genesis block, the program will return you the coinbase script, the scriptPubKey, the merkle hash, the byteswapped merkle hash, the unix time and finally the genesis block's hash.

1. Change the genesisOutputScript to your scriptPubKey from #L54.
2. Change genesis.hashMerkleRoot to the byteswapped merkle hash in #L114.
3. Change consensus.hashGenesisBlock to your block's hash in #L113.
4. Change the first two values from the CreateGenesisBlock function to the unix time and nonce respectively in #L111.
5. Build Bitcoin Core.

I've made a tutorial here: How to create your own altcoin (v0.20.1). It should be the same for the latest version of Bitcoin Core.