0

I managed to create a private Ethereum network using the following genesis.json

{
    "config": {
        "chainId": 15,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "difficulty": "200000000",
    "gasLimit": "2100000",
    "alloc": {
        "1A77F77E1e523f9f68D97A89b0502f136fB7F942": { "balance": "300000000000000000000000000000000000000" }
    }
}

Because I already alloc the coins to this above wallet, I don't want any new coins generated in this network. With this genesis configuration will miners be able to generate new coins? or else miners will only mine for transaction validations?

How can we differentiate those two ways from the genesis block?

1

How can we differentiate those two ways from the genesis block?

You can't in Geth, at least not by setting anything in the genesis file.

With this genesis configuration will miners be able to generate new coins?

Yes. Again, there's no way to turn off the mining reward in the genesis block directly if you're running a Geth (go-ethereum) client.

I don't want any new coins generated in this network

A couple of options I can think of off the top of my head:

  • Look into using Parity, which supports a blockReward field in its genesis files.
  • If you're going to use Parity, check if a different consensus algorithm would be suitable for your project. (Parity supports Pluggable Consensus.)
  • If you desperately want to use the Geth client, and don't mind rebuiding from source, change the ByzantiumBlockReward value, which is 3, not 5, in consensus.go.

Code to change:

var (
    FrontierBlockReward    *big.Int = big.NewInt(5e+18) // Block reward in wei for successfully mining a block
    ByzantiumBlockReward   *big.Int = big.NewInt(3e+18) // Block reward in wei for successfully mining a block upward from Byzantium
    maxUncles                       = 2                 // Maximum number of uncles allowed in a single block
    allowedFutureBlockTime          = 15 * time.Second  // Max time from current time allowed for blocks, before they're considered future blocks
)
  • Thanks for giving me the information about consensus.go. That's exactly what I wanted & I don't mind building from the source. One last question, what is the different between FrontierBlockReward & ByzantiumBlockReward values? Because I had to make both values 0 in order to remove new Block mining reward – DilumN Mar 28 '18 at 4:03
0

Yes, miners will be able to generate new coins, they will get 5 coins on each block.

They will also mine transaction fees from all transactions that have been processed in the block they have found.

You don't have to differentiate anything, the genesis block is created once at the beginning, it will never be mined by any miner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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