I am playing around with a private blockchain, and I realize that I don't understand how the "genesis block" is different fromthe first block. I assume it has to get mined like any other, yes? Otherwise, why have a "gasLimit" in the genesis section of a chain spec?

Is it simply the first transaction I manually engage in? Like, if I fire up a few nodes and transfer some testETH between them, is that exchange the "genesis block"?

I have to ask this because the block does not seem to automatically happen if there are no transactions. I do have a miner on the network from the moment I start Parity but until I transact something, no blocks are visible in the explorer I am running.

up vote 3 down vote accepted

I think it's mostly a nomenclature debate. I think the Bitcoin wiki sums it up pretty well (and it's the same case with Ethereum, at least in terms of naming):

A genesis block is the first block of a block chain. Modern versions of Bitcoin (or Ethereum) number it as block 0, though very early versions counted it as block 1. The genesis block is almost always hardcoded into the software of the applications that utilize its block chain. It is a special case in that it does not reference a previous block...

Now to your questions:

Like, if I fire up a few nodes and transfer some testETH between them, is that exchange the "genesis block"?

No, as soon as you 'transfer', it's not a part of the genesis block anymore.

Is it simply the first transaction I manually engage in?

Technically, it (genesis block) is the block referred to by the first transaction(s) you make (which will, of course, happen in the first block).

I assume it has to get mined like any other, yes?

No, it is not mined. It is essentially the 'system', or more precisely, the EVM state as soon as a node with a new chain (or a copy of a new chain) starts with. The mining will happen from then on, and most likely, other transactions will refer back to it (as in your case of sending testEth.)

I have to ask this because the block does not seem to automatically happen if there are no transactions.

This is interesting. Did you try checking from the console the current block height? I suspect there might be an issue with your explorer. Otherwise, it seems very much a specific configuration of your test node. Because, there doesn't have to be a transaction for a new block to be mined. The miner(s) will keep mining to meet the new block mine interval time criteria. I run a test node with Geth, and the blocks are mined irrespective of the transactions being there or not; this is basically what a miner is supposed to do and is the ideal behavior of a miner.

UPDATES: More details/ rationale on why the genesis block is not mined.: The essential definition of mining in the context of the Ethereum network is two fold:

  1. Processing and validating the transactions (also including the smart contracts)

  2. Mining the block for consensus using proof-of-work/ ethash.

Now the genesis.json file, as I previously answered, sets the state of the node. There are no actual transactions, and hence no mining. There is nothing actually being transferred in the description of genesis.json, it is a mere description of wallets.

The question of the gasLimit limit field is just an initial point of reference to start with. It might (and it does) change as per the behavior of the network participants in the Ethereum mainnet. In case of private chains, you would tweak it as per your needs. But it has nothing to do with the 'mining of the genesis block'. Even if you set it very low, say something that would allow only five transactions, and put hundred addresses and their corresponding balances in genesis.json, the genesis block would flow as smoothly as any gas (sorry for the bad pun).

I rely on the yellow paper for my source of definitions.

  • @Daveldito thank you for your answers but the real question was " I assume it has to get mined like any other, yes? Otherwise, why have a "gasLimit" in the genesis section of a chain spec?" So that is what is important to mark this as answered if I'm being strict about it which I think is usually best for SE. – stone212 Oct 2 at 8:24
  • @stone212, I already answered that part. I have added a further update. Hope that clears things up. – DaveIdito Oct 3 at 0:12

The genesis block is just the initial state of the system when the chain is begun.

EDIT:

The genesis block is hardcoded into the system. When your node starts it is fed a pre-written genesis block. There is a particular one for the Ethereum public network but you could technically write one up and start a chain from that which people do often when building private networks for testing.

  • I don't understand what that means, in relation to my question. – stone212 Oct 11 '17 at 5:11
  • @jojoyh For example, what could the gasLimit for the genesis block mean in that case? – stone212 Oct 15 '17 at 5:37
  • The gas limit param in the genesis block is just telling this chain this is the maximum amount of gas a transaction can burn. – jojeyh Oct 15 '17 at 21:16
  • I could correct that comment but it would be off-topic. Anyway I still don't understand how your answer relates to the question so I won't mark it as correct until that changes – stone212 Oct 17 '17 at 3:17

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.