本文档说明 Cosmos Hub 主网的创世文件是如何组织的,同时也说明你如何为自己的 gaia 测试网构建创世文件。 请注意,你可以通过运行以下命令为自己的测试网生成默认创世文件:
gaiad init <moniker> --chain-id <chain-id>
创世文件存储在 ~/.gaia/config/genesis.toml 中。

什么是创世文件

创世文件是一个 JSON 文件,用于定义你的区块链初始状态。你可以将它视为区块链的高度 0。第一个区块(高度为 1)会引用创世文件作为其父级。 创世文件中定义的状态包含所有必要信息,例如初始代币分配、创世时间、默认参数等。下面我们来拆解这些信息。

创世时间与 Chain_id

genesis_time 定义在创世文件顶部。它是一个 UTC 时间戳,用于指定区块链何时启动。到达这个时间时,创世验证者应当上线并开始参与共识过程。当超过 2/3 的创世验证者(按投票权重计算)在线时,区块链就会启动。
"genesis_time": "2019-03-13T17:00:00.000000000Z",
chain_id 是链的唯一标识符。它有助于区分使用同一软件版本的不同链。
"chain_id": "cosmoshub-2",

共识参数

接下来,创世文件会定义共识参数。共识参数汇总了所有与共识层相关的参数,在 gaia 的场景下,共识层是 Tendermint。下面来看这些参数:
  • block
    • max_bytes:每个区块允许的最大字节数。
    • max_gas:每个区块的 Gas 上限。区块中包含的每笔交易都会消耗一定 Gas。一个区块中所有交易消耗的 Gas 总量不能超过这个限制。
  • evidence
    • max_age:Evidence 是验证者在同一高度(以及同一轮次)签署两个不同区块的证明。这是明确的恶意行为,会在状态机层面受到惩罚。max_age 定义了一条 evidence 在经过多少个区块后不再有效。
  • validator
    • pub_key_types:验证者允许使用的公钥类型(ed25519、secp256k1 等)。当前仅接受 ed25519。
"consensus_params": {
  "block_size": {
  "max_bytes": "150000",
  "max_gas": "1500000"
    
},
    "evidence": {
  "max_age": "1000000"
    
},
    "validator": {
  "pub_key_types": [
        "ed25519"
      ]
    }
  
},

应用状态

应用状态定义了状态机的初始状态。

创世账户

本节定义初始代币分配。你可以通过直接编辑创世文件来手动添加账户,也可以使用以下命令:
// Example: gaiad add-genesis-account cosmos1qs8tnw2t8l6amtzvdemnnsq9dzk0ag0z37gh3h 10000000uatom

gaiad genesis add-genesis-account <account-address> <amount><denom>
该命令会在 app_state 部分下的 accounts 列表中创建一项。
"accounts": [
      {
  "address": "cosmos1qs8tnw2t8l6amtzvdemnnsq9dzk0ag0z37gh3h",
  "coins": [
          {
  "denom": "uatom",
  "amount": "10000000"
          }
        ],
        "sequence_number": "0",
  "account_number": "0",
  "original_vesting": [
          {
  "denom": "uatom",
  "amount": "26306000000"
          }
        ],
        "delegated_free": null,
        "delegated_vesting": null,
        "start_time": "0",
  "end_time": "10000"
      }
]
下面拆解这些参数:
  • sequence_number:该数字用于统计此账户发送的交易数量。每当一笔交易被打包进区块时,它都会递增,并用于防止重放攻击。初始值为 0。
  • account_number:账户的唯一标识符。它会在包含该账户的交易第一次被打包进区块时生成。
  • original_vesting:gaia 原生支持 Vesting。你可以定义账户持有的一部分代币在一段时间内需要完成归属后才能转移。已归属代币可以被委托。默认值为 null。
  • delegated_free:已经归属、因此可以转移的已委托代币数量。在创世中大多数情况下为 null。
  • delegated_vesting:仍处于归属期内的已委托代币数量。在创世中大多数情况下为 null。
  • start_time:归属期开始的时间戳。在创世中大多数情况下为 0。
  • end_time:归属期结束的时间戳。如果该账户没有 Vesting,则为 0。

Bank

bank 模块负责处理代币。本节中唯一需要定义的参数,是在创世时是否启用 transfers。
"bank": {
  "send_enabled": false
    }

Staking

staking 模块负责状态机中绝大部分权益证明逻辑。本节应如下所示:
"staking": {
  "pool": {
  "not_bonded_tokens": "10000000",
  "bonded_tokens": "0"
      
},
      "params": {
  "unbonding_time": "1814400000000000",
  "max_validators": 100,
        "max_entries": 7,
        "bond_denom": "uatom"
      
},
      "last_total_power": "0",
  "last_validator_powers": null,
      "validators": null,
      "bonds": null,
      "unbonding_delegations": null,
      "redelegations": null,
      "exported": false
    }
下面拆解这些参数:
  • pool
    • not_bonded_tokens:定义创世时未绑定(即未委托)的代币数量。通常它等于质押代币总供应量(本例中为 uatom)。
    • bonded_tokens:创世时已绑定的代币数量。通常为 0。
  • params
    • unbonding_time:代币完成解绑所需的时间,单位为纳秒。
    • max_validators:活跃验证者的最大数量。
    • max_entries:特定委托人 / 验证者配对之间,解绑委托和再委托的最大条目数。
    • bond_denom:质押代币的面额。
  • last_total_power:投票权总量。在创世中通常为 0(除非创世文件是基于先前状态生成的)。
  • last_validator_powers:最后已知状态中每个验证者的权重。在创世中通常为 null(除非创世文件是基于先前状态生成的)。
  • validators:最后已知验证者列表。在创世中通常为 null(除非创世文件是基于先前状态生成的)。
  • bonds:最后已知委托列表。在创世中通常为 null(除非创世文件是基于先前状态生成的)。
  • unbonding_delegations:最后已知解绑委托列表。在创世中通常为 null(除非创世文件是基于先前状态生成的)。
  • redelegations:最后已知再委托列表。在创世中通常为 null(除非创世文件是基于先前状态生成的)。
  • exported:该创世文件是否基于先前状态的导出结果生成。

Mint

mint 模块负责代币供应通胀逻辑。创世文件中的 mint 部分如下所示:
"mint": {
  "minter": {
  "inflation": "0.070000000000000000",
  "annual_provisions": "0.000000000000000000"
      
},
      "params": {
  "mint_denom": "uatom",
  "inflation_rate_change": "0.130000000000000000",
  "inflation_max": "0.200000000000000000",
  "inflation_min": "0.070000000000000000",
  "goal_bonded": "0.670000000000000000",
  "blocks_per_year": "6311520"
      }
    }
下面拆解这些参数:
  • minter
    • inflation:质押代币总供应量的初始年化增长比例,按周复利。0.070000000000000000 表示目标年化通胀率为 7%,按周复利计算。
    • annual_provisions:每个区块都会计算。初始化为 0.000000000000000000。
  • params
    • mint_denom:发生通胀的质押代币面额。
    • inflation_rate_change:年化通胀率的最大变化幅度。
    • inflation_max:通胀率上限。
    • inflation_min:通胀率下限。
    • goal_bonded:目标绑定占总供应量的比例。如果已绑定的质押代币比例低于该目标,通胀率会上升(遵循 inflation_rate_change),直到达到 inflation_max。如果已绑定的质押代币比例高于该目标,通胀率会下降(遵循 inflation_rate_change),直到达到 inflation_min。
    • blocks_per_year:每年区块数量的估算值。用于计算由通胀产生的质押代币区块奖励(称为 block provisions)。

分发

distribution 模块负责处理区块分发供给以及向验证者和委托人分配手续费的逻辑。genesis 文件中的 distribution 部分如下所示:
"distribution": {
  "fee_pool": {
  "community_pool": null
      
},
      "community_tax": "0.020000000000000000",
  "base_proposer_reward": "0.010000000000000000",
  "bonus_proposer_reward": "0.040000000000000000",
  "withdraw_addr_enabled": false,
      "delegator_withdraw_infos": null,
      "previous_proposer": "",
  "outstanding_rewards": null,
      "validator_accumulated_commissions": null,
      "validator_historical_rewards": null,
      "validator_current_rewards": null,
      "delegator_starting_infos": null,
      "validator_slash_events": null
    }
下面对这些参数逐一说明:
  • fee_pool
    • community_pool:社区池是一个可用于支付赏金的代币池,通过治理提案进行分配。在 genesis 中通常为 null。
  • community_tax:手续费和区块奖励中进入社区池的税率。
  • base_proposer_reward:有效区块中所收集交易手续费给予区块提议者的基础奖励。如果值为 0.010000000000000000,则 1% 的手续费会分配给提议者。
  • bonus_proposer_reward:有效区块中所收集交易手续费给予区块提议者的最大奖励。该奖励取决于提议者包含的 precommits 数量。如果提议者包含了按投票权加权后的 2/3 precommits(区块有效的最低要求),他们将获得 base_proposer_reward 的奖励。如果提议者包含了 100% 的 precommits,该奖励会线性增加至 bonus_proposer_reward。
  • withdraw_addr_enabled:如果为 true,委托人可以设置不同的地址来提取奖励。如果你希望在 genesis 时禁用转账,应将其设为 false,因为这可以被用作绕过限制的一种方式。
  • delegator_withdraw_infos:委托人提取地址列表。如果 genesis 不是从先前状态导出的,通常为 null。
  • previous_proposer:上一个区块的提议者。如果 genesis 不是从先前状态导出的,则设为 ""。
  • outstanding_rewards:未提取的奖励。如果 genesis 不是从先前状态导出的,则设为 null。
  • validator_accumulated_commission:验证者未提取的佣金。如果 genesis 不是从先前状态导出的,则设为 null。
  • validator_historical_rewards:与验证者历史奖励相关的一组信息,distribution 模块会在各种计算中使用。如果 genesis 不是从先前状态导出的,则设为 null。
  • validators_current_rewards:与验证者当前奖励相关的一组信息,distribution 模块会在各种计算中使用。如果 genesis 不是从先前状态导出的,则设为 null。
  • delegator_starting_infos:跟踪先前的验证者周期、委托的质押代币数量以及创建高度(以便后续检查是否发生过惩罚)。如果 genesis 不是从先前状态导出的,则设为 null。
  • validator_slash_events:与验证者历史惩罚事件相关的一组信息。如果 genesis 不是从先前状态导出的,则设为 null。

治理

gov 模块处理所有与治理相关的交易。gov 部分的初始状态如下所示:
"gov": {
  "starting_proposal_id": "1",
  "deposits": null,
      "votes": null,
      "proposals": null,
      "deposit_params": {
  "min_deposit": [
          {
  "denom": "uatom",
  "amount": "512000000"
          }
        ],
        "max_deposit_period": "1209600000000000"
      
},
      "voting_params": {
  "voting_period": "1209600000000000"
      
},
      "tally_params": {
  "quorum": "0.4",
  "threshold": "0.5",
  "veto": "0.334",
  "governance_penalty": "0.0"
      }
    }
下面对这些参数逐一说明:
  • starting_proposal_id:该参数定义第一条提案的 ID。每个提案都由唯一 ID 标识。
  • deposits:每个提案 ID 对应的存款列表。如果 genesis 不是从先前状态导出的,则设为 null。
  • votes:每个提案 ID 对应的投票列表。如果 genesis 不是从先前状态导出的,则设为 null。
  • proposals:每个提案 ID 对应的提案列表:如果 genesis 不是从先前状态导出的,则设为 null。
  • deposit_params
    • min_deposit:提案进入 Voting Period 所需的最小存款。如果提供了多个 denom,则适用 OR 运算符。
    • max_deposit_period:提案在此期限之后将无法再继续存款的最大时长,单位为 纳秒。
  • voting_params
    • voting_period:投票期长度,单位为 纳秒。
  • tally_params
    • quorum:为使结果有效,必须参与投票的已绑定质押代币的最小比例。
    • threshold:为使结果有效,投票中 YES 所需达到的最小比例。
    • veto:为使结果有效,NO_WITH_VETO 投票所允许的最大比例。
    • governance_penalty:验证者未对某个提案投票时的惩罚。

惩罚

slashing 模块负责在验证者行为不当时对其委托人进行惩罚。genesis 中的 slashing 部分如下所示:
"slashing": {
  "params": {
  "max_evidence_age": "1814400000000000",
  "signed_blocks_window": "10000",
  "min_signed_per_window": "0.050000000000000000",
  "downtime_jail_duration": "600000000000",
  "slash_fraction_double_sign": "0.050000000000000000",
  "slash_fraction_downtime": "0.000100000000000000"
      
},
      "signing_infos": {
},
      "missed_blocks": {}
    }
下面对这些参数逐一说明:
  • params
    • max_evidence_age:证据的最大有效期,单位为 纳秒。
    • signed_blocks_window:用于识别离线验证者的滑动区块窗口。
    • min_signed_per_window:在 block window 中必须出现的 precommits 最小比例,满足后验证者才会被视为在线。
    • downtime_jail_duration:验证者因宕机被惩罚后被关押的时长,单位为 纳秒。
    • slash_fraction_double_sign:当验证者发生双签时,其委托人已绑定质押份额被惩罚的比例。
    • slash_fraction_downtime:当验证者离线时,其委托人已绑定质押份额被惩罚的比例。
  • signing_infos:slashing 模块按验证者维度所需的各类信息。如果 genesis 不是从先前状态导出的,则设为 {}。
  • missed_blocks:slashing 模块所需的与漏签区块相关的各类信息。如果 genesis 不是从先前状态导出的,则设为 {}。

创世交易

默认情况下,genesis 文件不包含任何 gentxs。gentx 是一种交易,它会将 genesis 文件中 accounts 下的质押代币绑定给某个验证者,本质上是在 genesis 时创建一个验证者。当在 genesis_time 之后,收到有效 gentx 的验证者中,超过 2/3(按投票权加权)的验证者上线后,链就会启动。 gentx 可以手动添加到 genesis 文件中,也可以通过以下命令添加:
gaiad collect-gentxs

This document explains how the genesis file of the Cosmos Hub mainnet is structured. It also explains how you can build a genesis file for your own gaia testnet. Note that you can generate a default genesis file for your own testnet by running the following command:
gaiad init <moniker> --chain-id <chain-id>
The genesis file is stored in ~/.gaia/config/genesis.toml.

What is a Genesis File

A genesis file is a JSON file which defines the initial state of your blockchain. It can be seen as height 0 of your blockchain. The first block, at height 1, will reference the genesis file as its parent. The state defined in the genesis file contains all the necessary information, like initial token allocation, genesis time, default parameters, and more. Let us break down this information.

Genesis Time and Chain_id

The genesis_time is defined at the top of the genesis file. It is a UTC timestamp that specifies when the blockchain is due to start. At this time, genesis validators are supposed to come online and start participating in the consensus process. The blockchain starts when more than 2/3rd of the genesis validators (weighted by voting power) are online.
"genesis_time": "2019-03-13T17:00:00.000000000Z",
The chain_id is a unique identifier for your chain. It helps differentiate between different chains using the same version of the software.
"chain_id": "cosmoshub-2",

Consensus Parameters

Next, the genesis file defines consensus parameters. Consensus parameters regroup all the parameters that are related to the consensus layer, which is Tendermint in the case of gaia. Let us look at these parameters:
  • block
    • max_bytes: Maximum number of bytes per block.
    • max_gas: Gas limit per block. Each transaction included in the block will consume some gas. The total gas used by transactions included in a block cannot exceed this limit.
  • evidence
    • max_age: An evidence is a proof that a validator signed two different blocks at the same height (and round). This is an explicitly malicious behaviour that is punished at the state-machine level. The max_age defines the maximum number of blocks after which an evidence is not valid anymore.
  • validator
    • pub_key_types: The types of pubkey (ed25519, secp256k1, …) that are accepted for validators. Currently only ed25519 is accepted.
"consensus_params": {
  "block_size": {
  "max_bytes": "150000",
  "max_gas": "1500000"
    
},
    "evidence": {
  "max_age": "1000000"
    
},
    "validator": {
  "pub_key_types": [
        "ed25519"
      ]
    }
  
},

Application State

The application state defines the initial state of the state-machine.

Genesis Accounts

In this section, the initial allocation of tokens is defined. It is possible to add accounts manually by directly editing the genesis file, but it is also possible to use the following command:
// Example: gaiad add-genesis-account cosmos1qs8tnw2t8l6amtzvdemnnsq9dzk0ag0z37gh3h 10000000uatom

gaiad genesis add-genesis-account <account-address> <amount><denom>
This command creates an item in the accounts list, under the app_state section.
"accounts": [
      {
  "address": "cosmos1qs8tnw2t8l6amtzvdemnnsq9dzk0ag0z37gh3h",
  "coins": [
          {
  "denom": "uatom",
  "amount": "10000000"
          }
        ],
        "sequence_number": "0",
  "account_number": "0",
  "original_vesting": [
          {
  "denom": "uatom",
  "amount": "26306000000"
          }
        ],
        "delegated_free": null,
        "delegated_vesting": null,
        "start_time": "0",
  "end_time": "10000"
      }
]
Let us break down the parameters:
  • sequence_number: This number is used to count the number of transactions sent by this account. It is incremented each time a transaction is included in a block, and used to prevent replay attacks. Initial value is 0.
  • account_number: Unique identifier for the account. It is generated the first time a transaction including this account is included in a block.
  • original_vesting: Vesting is natively supported by gaia. You can define an amount of token owned by the account that needs to be vested for a period of time before they can be transferred. Vested tokens can be delegated. Default value is null.
  • delegated_free: Amount of delegated tokens that can be transferred after they’ve been vested. Most of the time, will be null in genesis.
  • delegated_vesting: Amount of delegated tokens that are still vesting. Most of the time, will be null in genesis.
  • start_time: Timestamp at which the vesting period starts. 0 most of the time in genesis.
  • end_time: Timestamp at which the vesting period ends. 0 if no vesting for this account.

Bank

The bank module handles tokens. The only parameter that needs to be defined in this section is whether transfers are enabled at genesis or not.
"bank": {
  "send_enabled": false
    }

Staking

The staking module handles the bulk of the Proof-of-Stake logic of the state-machine. This section should look like the following:
"staking": {
  "pool": {
  "not_bonded_tokens": "10000000",
  "bonded_tokens": "0"
      
},
      "params": {
  "unbonding_time": "1814400000000000",
  "max_validators": 100,
        "max_entries": 7,
        "bond_denom": "uatom"
      
},
      "last_total_power": "0",
  "last_validator_powers": null,
      "validators": null,
      "bonds": null,
      "unbonding_delegations": null,
      "redelegations": null,
      "exported": false
    }
Let us break down the parameters:
  • pool
    • not_bonded_tokens: Defines the amount of tokens not bonded (i.e. delegated) in genesis. Generally, it equals the total supply of the staking token (uatom in this example).
    • bonded_tokens: Amount of bonded tokens in genesis. Generally 0.
  • params
    • unbonding_time: Time in nanosecond it takes for tokens to complete unbonding.
    • max_validators: Maximum number of active validators.
    • max_entries: Maximum unbonding delegations and redelegations between a particular pair of delegator / validator.
    • bond_denom: Denomination of the staking token.
  • last_total_power: Total amount of voting power. Generally 0 in genesis (except if genesis was generated using a previous state).
  • last_validator_powers: Power of each validator in last known state. Generally null in genesis (except if genesis was generated using a previous state).
  • validators: List of last known validators. Generally null in genesis (except if genesis was generated using a previous state).
  • bonds: List of last known delegation. Generally null in genesis (except if genesis was generated using a previous state).
  • unbonding_delegations: List of last known unbonding delegations. Generally null in genesis (except if genesis was generated using a previous state).
  • redelegations: List of last known redelegations. Generally null in genesis (except if genesis was generated using a previous state).
  • exported: Whether this genesis was generated using the export of a previous state.

Mint

The mint module governs the logic of inflating the supply of token. The mint section in the genesis file looks like the following:
"mint": {
  "minter": {
  "inflation": "0.070000000000000000",
  "annual_provisions": "0.000000000000000000"
      
},
      "params": {
  "mint_denom": "uatom",
  "inflation_rate_change": "0.130000000000000000",
  "inflation_max": "0.200000000000000000",
  "inflation_min": "0.070000000000000000",
  "goal_bonded": "0.670000000000000000",
  "blocks_per_year": "6311520"
      }
    }
Let us break down the parameters:
  • minter
    • inflation: Initial yearly percentage of increase in the total supply of staking token, compounded weekly. A 0.070000000000000000 value means the target is 7% yearly inflation, compounded weekly.
    • annual_provisions: Calculated each block. Initialize at 0.000000000000000000.
  • params
    • mint_denom: Denom of the staking token that is inflated.
    • inflation_rate_change: Max yearly change in inflation.
    • inflation_max: Maximum level of inflation.
    • inflation_min: Minimum level of inflation.
    • goal_bonded: Percentage of the total supply that is targeted to be bonded. If the percentage of bonded staking tokens is below this target, the inflation increases (following inflation_rate_change) until it reaches inflation_max. If the percentage of bonded staking tokens is above this target, the inflation decreases (following inflation_rate_change) until it reaches inflation_min.
    • blocks_per_year: Estimation of the amount of blocks per year. Used to compute the block reward coming from inflated staking token (called block provisions).

Distribution

The distribution module handles the logic of distribution block provisions and fees to validators and delegators. The distribution section in the genesis file looks like the following:
"distribution": {
  "fee_pool": {
  "community_pool": null
      
},
      "community_tax": "0.020000000000000000",
  "base_proposer_reward": "0.010000000000000000",
  "bonus_proposer_reward": "0.040000000000000000",
  "withdraw_addr_enabled": false,
      "delegator_withdraw_infos": null,
      "previous_proposer": "",
  "outstanding_rewards": null,
      "validator_accumulated_commissions": null,
      "validator_historical_rewards": null,
      "validator_current_rewards": null,
      "delegator_starting_infos": null,
      "validator_slash_events": null
    }
Let us break down the parameters:
  • fee_pool
    • community_pool: The community pool is a pool of tokens that can be used to pay for bounties. It is allocated via governance proposals. Generally null in genesis.
  • community_tax: The tax percentage on fees and block rewards that goes to the community pool.
  • base_proposer_reward: Base bonus on transaction fees collected in a valid block that goes to the proposer of block. If value is 0.010000000000000000, 1% of the fees go to the proposer.
  • bonus_proposer_reward: Max bonus on transaction fees collected in a valid block that goes to the proposer of block. The bonus depends on the number of precommits the proposer includes. If the proposer includes 2/3rd precommits weighted by voting power (minimum for the block to be valid), they get a bonus of base_proposer_reward. This bonus increases linearly up to bonus_proposer_reward if the proposer includes 100% of precommits.
  • withdraw_addr_enabled: If true, delegators can set a different address to withdraw their rewards. Set to false if you want to disable transfers at genesis, as it can be used as a way to get around the restriction.
  • delegator_withdraw_infos: List of delegators withdraw address. Generally null if genesis was not exported from previous state.
  • previous_proposer: Proposer of the previous block. Set to "" if genesis was not exported from previous state.
  • outstanding_rewards: Outstanding (un-withdrawn) rewards. Set to null if genesis was not exported from previous state.
  • validator_accumulated_commission: Outstanding (un-withdrawn) commission of validators. Set to null if genesis was not exported from previous state.
  • validator_historical_rewards: Set of information related to the historical rewards of validators and used by the distribution module for various computation. Set to null if genesis was not exported from previous state.
  • validators_current_rewards: Set of information related to the current rewards of validators and used by the distribution module for various computation. Set to null if genesis was not exported from previous state.
  • delegator_starting_infos: Tracks the previous validator period, the delegation’s amount of staking token, and the creation height (to check later on if any slashes have occurred). Set to null if genesis was not exported from previous state.
  • validator_slash_events: Set of information related to the past slashing of validators. Set to null if genesis was not exported from previous state.

Governance

The gov module handles all governance-related transactions. The initial state of the gov section looks like the following:
"gov": {
  "starting_proposal_id": "1",
  "deposits": null,
      "votes": null,
      "proposals": null,
      "deposit_params": {
  "min_deposit": [
          {
  "denom": "uatom",
  "amount": "512000000"
          }
        ],
        "max_deposit_period": "1209600000000000"
      
},
      "voting_params": {
  "voting_period": "1209600000000000"
      
},
      "tally_params": {
  "quorum": "0.4",
  "threshold": "0.5",
  "veto": "0.334",
  "governance_penalty": "0.0"
      }
    }
Let us break down the parameters:
  • starting_proposal_id: This parameter defines the ID of the first proposal. Each proposal is identified by a unique ID.
  • deposits: List of deposits for each proposal ID. Set to null if genesis was not exported from previous state.
  • votes: List of votes for each proposal ID. Set to null if genesis was not exported from previous state.
  • proposals: List of proposals for each proposal ID: Set to null if genesis was not exported from previous state.
  • deposit_params
    • min_deposit: The minimum deposit required for the proposal to enter Voting Period. If multiple denoms are provided, the OR operator applies.
    • max_deposit_period: The maximum period (in nanoseconds) after which it is not possible to deposit on the proposal anymore.
  • voting_params
    • voting_period: Length of the voting period in nanoseconds.
  • tally_params
    • quorum: Minimum percentage of bonded staking tokens that needs to vote for the result to be valid.
    • threshold: Minimum percentage of votes that need to be YES for the result to be valid.
    • veto: Maximum percentage NO_WITH_VETO votes for the result to be valid.
    • governance_penalty: Penalty for validators that do not vote on a given proposal.

Slashing

The slashing module handles the logic to slash delegators if their validator misbehaves. The slashing section in genesis looks as follows:
"slashing": {
  "params": {
  "max_evidence_age": "1814400000000000",
  "signed_blocks_window": "10000",
  "min_signed_per_window": "0.050000000000000000",
  "downtime_jail_duration": "600000000000",
  "slash_fraction_double_sign": "0.050000000000000000",
  "slash_fraction_downtime": "0.000100000000000000"
      
},
      "signing_infos": {
},
      "missed_blocks": {}
    }
Let us break down the parameters:
  • params
    • max_evidence_age: Maximum age of the evidence in nanoseconds.
    • signed_blocks_window: Moving window of blocks to figure out offline validators.
    • min_signed_per_window: Minimum percentage of precommitsthat must be present in the block window for the validator to be considered online.
    • downtime_jail_duration: Duration in nanoseconds for which a validator is jailed after they get slashed for downtime.
    • slash_fraction_double_sign: Percentage of delegators bonded stake slashed when their validator double signs.
    • slash_fraction_downtime: Percentage of delegators bonded stake slashed when their validator is down.
  • signing_infos: Various infos per validator needed by the slashing module. Set to {} if genesis was not exported from previous state.
  • missed_blocks: Various infos related to missed blocks needed by the slashing module. Set to {} if genesis was not exported from previous state.

Genesis Transactions

By default, the genesis file do not contain any gentxs. A gentx is a transaction that bonds staking token present in the genesis file under accounts to a validator, essentially creating a validator at genesis. The chain will start as soon as more than 2/3rds of the validators (weighted by voting power) that are the recipient of a valid gentx come online after genesis_time. A gentx can be added manually to the genesis file, or via the following command:
gaiad collect-gentxs