How do I find a pubkey and the nbits value to generate a genesis block?

2

1

I am hoping to create a new cryptocurrency from a Bitcoin fork, mostly for learning, and a little bit of fun. I roughly followed this answer to get as far as I am, but the genesis generator requires a pubkey and an nBits param, and I have no idea how to get these.

Any advice or resources pertaining to those parameters or cryptocurrency creation in general would be great.

Jordan LaPrise

Posted 2016-05-11T17:56:10.393

Reputation: 123

Did you try googling the terms? E.g. first hit for nbits. pubkey is a public key corresponding to any private key under your control.

– Murch – 2016-05-12T16:05:33.557

Answers

1

Detailed explanation of the nBits encoding https://bitcoin.org/en/developer-reference#target-nbits

In a very real sense, exact choice of the pubkey does not matter How do I compute merkle root for genesis block?

Genesis block coinbase cannot be spent Why can’t the genesis block coinbase be spent?

Tearo Dactyl

Posted 2016-05-11T17:56:10.393

Reputation: 102

1

The public key doesn't matter, no coins are created in the genesis block.

nBits decides the blocks difficulty, affecting how long it will take to mine. You also have to modify your daemons code to allow this difficulty.

karimkorun

Posted 2016-05-11T17:56:10.393

Reputation: 849

Could you expand more on nBits, maybe give a little bit of insight as to how to select it, also explain what you mean when you say modify my daemons code. – Jordan LaPrise – 2016-05-12T17:16:08.507

1@karimkorun: It's still useful to have the corresponding private key in case you ever want to sign a message to prove that you created it. ;) – Murch – 2016-05-12T20:20:29.550

The coins are in the Genesis Block coinbase, all 50 of them. But they cannot be spent, as documented elsewhere. – Walter K – 2017-05-06T07:58:59.133

1

You can see the actual numbers that are hard coded in the bitcoin core source code

CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN)

where the function signature is

static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)

Chris Stewart

Posted 2016-05-11T17:56:10.393

Reputation: 975