Genesis JSON
This page describes the details of genesis.json
file.
Genesis JSON File Structure
The genesis.json
file structure is described in the following table.
config
nonce
(deprecated) This field is derived from the Ethereum, but not used in Klaytn.
timestamp
The unix time when a block is created.
extraData
The data combined field for signer vanity and RLP-encoded istanbul extra data that contains validator list, proposer seal, and commit seals.
gasLimit
The maximum gas amount that used in a block.
difficulty
(deprecated) This field is derived from the Ethereum, but not used in Klaytn.
mixhash
(deprecated) This field is derived from the Ethereum, but not used in Klaytn.
coinbase
An address to which miner receives the reward. This field is only used for Clique consensus engine.
alloc
The predefined accounts.
number
The block number field.
gasUsed
The amount of the gas which used for a block.
parentHash
The hash value of the previous block.
Config
The config
field stores the information related to the chain.
chainId
It identifies the current chain and is used for prevention from the replay attack.
istanbulCompatibleBlock
A block number to which istanbul change is applied.
istanbul, clique
The type of consensus engine.
unitPrice
Unit price.
deriveShaImpl
Defines a method to generate transaction hash and receipt hash.
governance
extraData
The field extraData
is a concatenation of the proposer vanity and the RLP-encoded istanbul extra data:
The proposer vanity is 32-byte data which contains arbitrary proposer vanity data.
The rest of the data is RLP-encoded istanbul extra data containing:
Validators: the list of validators in ascending order.
Seal: the proposer signature of the header. For
genesis.json
, it is a byte array initialized with 650x0
.CommittedSeal: the list of commitment signature seals as consensus proof. For
genesis.json
, it is an empty array.
Example
Vanity
32-byte hex string
0x0000000000000000000000000000000000000000000000000000000000000000
Validators
[]address
[0x48009b4e20ec72aadf306577cbe2eaf54b0ebb16,0x089fcc42fd83baeee4831319375413b8bae3aceb]
Seal
byte array of 65 elements
[0x0,...,0x0]
CommittedSeal
[][]byte
[]
extraData
with the above data is created by
where concat
is a string concatenation function, and RLPEncode
is a function to convert a given structure to an RLP-encoded string.
With this function, the output extraData
for this example is 0x0000000000000000000000000000000000000000000000000000000000000000f86fea9448009b4e20ec72aadf306577cbe2eaf54b0ebb1694089fcc42fd83baeee4831319375413b8bae3acebb8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0.
Consensus Engine
The available consensus engines for Klaytn network are Clique and Istanbul. Each engine is explained as follows.
Clique
The clique
field stores the configuration for Proof-Of-Authority (POA) based sealing.
period
The minimum time interval between the consecutive blocks (unit: second).
epoch
The number of blocks to reset votes and marked as a checkpoint.
Istanbul
The istanbul
field stores the configuration for Istanbul based sealing.
epoch
The number of blocks to reset votes to be a checkpoint.
policy
The block proposer selection policy. [0: Round Robin, 1: Sticky, 2: Weighted Random]
sub
Committee size.
Governance
The governance
field stores governance information for a network.
governanceMode
One of three governance modes. [none
, single
, ballot
]
governingNode
Designated governing node's address. It only works if the governance mode is single
.
reward
Reward
The reward
field stores the information about the network's token economy.
mintingAmount
Amount of peb minted when a block is generated. Double quotation marks are needed for a value.
ratio
Distribution rate for a CN/KIR/PoC
separated by /
. The sum of all values has to be 100.
useGiniCoeff
Use GINI coefficient or not.
deferredTxFee
A way to distribute TX fee for a block.
stakingUpdateInterval
Time interval in block height to update staking information.
proposerUpdateInterval
Time interval in block height to update proposer information.
minimumStake
Minimum amount of peb to join Core Cell Operators.
Example
Last updated