Skip to content

Genesis

Genesis defines the initial chain state. In the current Iroha 2 and Iroha 3 codebase, the editable source is a JSON manifest and the node consumes a signed Norito transaction file.

Default genesis manifest
json
{
  "bls_domain": "bls-iroha2:npos-sumeragi:v1",
  "chain": "00000000-0000-0000-0000-000000000000",
  "chain_discriminant": 753,
  "consensus_fingerprint": "0xfed0dd949356d73782acd30f024f9a1a72a64344417c96ff195f19362812fe62",
  "consensus_mode": "Npos",
  "crypto": {
    "allowed_curve_ids": [
      1,
      3,
      4
    ],
    "allowed_signing": [
      "ed25519",
      "secp256k1",
      "bls_normal"
    ],
    "default_hash": "blake2b-256",
    "sm2_distid_default": "1234567812345678",
    "sm_intrinsics": "auto",
    "sm_openssl_preview": false
  },
  "executor": null,
  "ivm_dir": ".",
  "transactions": [
    {
      "instructions": [
        {
          "Register": {
            "Domain": {
              "id": "wonderland.universal",
              "logo": null,
              "metadata": {
                "key": "value"
              }
            }
          }
        },
        {
          "Register": {
            "Account": {
              "id": "sorauロ1Npテユヱヌq11pウリ2ア5ヌヲiCJKjRヤzキNMNニケユPCウルFvオE9LBLB",
              "label": null,
              "metadata": {
                "key": "value"
              },
              "uaid": null
            }
          }
        },
        {
          "Register": {
            "AssetDefinition": {
              "confidential_policy": {
                "mode": "TransparentOnly",
                "pedersen_params_id": null,
                "pending_transition": null,
                "poseidon_params_id": null,
                "vk_set_hash": null
              },
              "id": "62Fk4FPcMuLvW5QjDGNF2a4jAmjM",
              "logo": null,
              "metadata": {},
              "mintable": "Infinitely",
              "spec": {
                "scale": null
              },
              "name": "rose"
            }
          }
        },
        {
          "Register": {
            "Domain": {
              "id": "garden_of_live_flowers.universal",
              "logo": null,
              "metadata": {}
            }
          }
        },
        {
          "Register": {
            "Account": {
              "id": "sorauロ1PyXノspjg6gnvエ1メムLネオBトEwtテD8Rクヌgヲホセレカ7エvWUJA5A",
              "label": null,
              "metadata": {},
              "uaid": null
            }
          }
        },
        {
          "Register": {
            "AssetDefinition": {
              "confidential_policy": {
                "mode": "TransparentOnly",
                "pedersen_params_id": null,
                "pending_transition": null,
                "poseidon_params_id": null,
                "vk_set_hash": null
              },
              "id": "5CJ6HCMxWw9xhuHmxDrzEfWGeE7M",
              "logo": null,
              "metadata": {},
              "mintable": "Infinitely",
              "spec": {
                "scale": null
              },
              "name": "cabbage"
            }
          }
        }
      ],
      "ivm_triggers": [],
      "parameters": {
        "block": {
          "max_transactions": 512
        },
        "custom": {
          "ivm_gas_limit_per_block": {
            "id": "ivm_gas_limit_per_block",
            "payload": 1680000
          },
          "sumeragi_npos_parameters": {
            "id": "sumeragi_npos_parameters",
            "payload": {
              "activation_lag_blocks": 1,
              "block_time_ms": 100,
              "epoch_length_blocks": 3600,
              "epoch_seed": "0000000000000000000000000000000000000000000000000000000000000000",
              "evidence_horizon_blocks": 7200,
              "finality_margin_blocks": 8,
              "k_aggregators": 3,
              "max_entity_correlation_pct": 25,
              "max_nominator_concentration_pct": 25,
              "max_validators": 128,
              "min_nomination_bond": 1,
              "min_self_bond": 1000,
              "redundant_send_r": 3,
              "seat_band_pct": 5,
              "slashing_delay_blocks": 259200,
              "timeout_aggregator_ms": 120,
              "timeout_commit_ms": 150,
              "timeout_da_ms": 300,
              "timeout_precommit_ms": 250,
              "timeout_prevote_ms": 300,
              "timeout_propose_ms": 300,
              "vrf_commit_window_blocks": 100,
              "vrf_reveal_window_blocks": 40
            }
          }
        },
        "executor": {
          "execution_depth": 3,
          "fuel": 55000000,
          "memory": 55000000
        },
        "smart_contract": {
          "execution_depth": 3,
          "fuel": 55000000,
          "memory": 55000000
        },
        "sumeragi": {
          "block_time_ms": 100,
          "collectors_k": 3,
          "collectors_redundant_send_r": 3,
          "commit_time_ms": 100,
          "da_enabled": true,
          "key_activation_lead_blocks": 1,
          "key_allowed_algorithms": [
            "bls_normal"
          ],
          "key_allowed_hsm_providers": [
            "pkcs11",
            "yubihsm",
            "softkey"
          ],
          "key_expiry_grace_blocks": 0,
          "key_overlap_grace_blocks": 8,
          "key_require_hsm": false,
          "max_clock_drift_ms": 1000,
          "min_finality_ms": 100
        },
        "transaction": {
          "ivm_bytecode_size": 4194304,
          "max_decompressed_bytes": 10485760,
          "max_instructions": 20000,
          "max_metadata_depth": 8,
          "max_signatures": 16,
          "max_tx_bytes": 10485760,
          "require_height_ttl": false,
          "require_sequence": false
        }
      },
      "topology": []
    },
    {
      "instructions": [
        {
          "Mint": {
            "Asset": {
              "destination": "62Fk4FPcMuLvW5QjDGNF2a4jAmjM#sorauロ1Npテユヱヌq11pウリ2ア5ヌヲiCJKjRヤzキNMNニケユPCウルFvオE9LBLB",
              "object": "13"
            }
          }
        },
        {
          "Mint": {
            "Asset": {
              "destination": "5CJ6HCMxWw9xhuHmxDrzEfWGeE7M#sorauロ1Npテユヱヌq11pウリ2ア5ヌヲiCJKjRヤzキNMNニケユPCウルFvオE9LBLB",
              "object": "44"
            }
          }
        },
        {
          "Transfer": {
            "AssetDefinition": {
              "destination": "sorauロ1Npテユヱヌq11pウリ2ア5ヌヲiCJKjRヤzキNMNニケユPCウルFvオE9LBLB",
              "object": "62Fk4FPcMuLvW5QjDGNF2a4jAmjM",
              "source": "sorauロ1Nノマ2スヘネdmcLfDBwoスリシoF5sHeカdカQbネxGVヰ8tCホ4P4KX7"
            }
          }
        },
        {
          "Grant": {
            "Permission": {
              "destination": "sorauロ1Npテユヱヌq11pウリ2ア5ヌヲiCJKjRヤzキNMNニケユPCウルFvオE9LBLB",
              "object": {
                "name": "CanSetParameters"
              }
            }
          }
        },
        {
          "Grant": {
            "Permission": {
              "destination": "sorauロ1Npテユヱヌq11pウリ2ア5ヌヲiCJKjRヤzキNMNニケユPCウルFvオE9LBLB",
              "object": {
                "name": "CanRegisterDomain"
              }
            }
          }
        },
        {
          "Grant": {
            "Permission": {
              "destination": "sorauロ1Npテユヱヌq11pウリ2ア5ヌヲiCJKjRヤzキNMNニケユPCウルFvオE9LBLB",
              "object": {
                "name": "CanRegisterAccount"
              }
            }
          }
        }
      ],
      "ivm_triggers": [],
      "topology": []
    }
  ],
  "wire_proto_versions": [
    2
  ]
}

Files

The upstream repository ships a default manifest at defaults/genesis.json. Kagami-generated networks write their own manifest and signed transaction into the output directory:

bash
cargo run --bin kagami -- localnet --build-line iroha3 --peers 4 --out-dir ./localnet

The generated README.md in that directory records the exact files and launch commands for the selected profile.

Peer Configuration

Peers point at the signed genesis transaction in the [genesis] section of config.toml:

toml
[genesis]
file = "./genesis.signed.nrt"
public_key = "ed0120..."

All peers in the network must agree on the signed genesis transaction and the genesis public key.

Signing Genesis

If you edit a manifest manually, validate and sign it before starting peers:

bash
cargo run --bin kagami -- genesis validate ./genesis.json
cargo run --bin kagami -- genesis sign ./genesis.json \
  --private-key "$GENESIS_PRIVATE_KEY_HEX" \
  --algorithm ed25519 \
  --out-file ./genesis.signed.nrt

For NPoS or Nexus profiles, include the topology and BLS Proofs-of-Possession required by the generated profile. Kagami localnet, wizard, and profile generation commands handle those details automatically.

Recommitting Genesis

A peer only commits genesis when its storage is empty. To test a new genesis in a disposable localnet, stop the peers, remove their generated state directory, and start from the new signed genesis. Do not replace genesis on a running network unless every validator is coordinating the same migration.