Chain ID
A chain ID is a unique identifier that represents a blockchain network. We use it to distinguish different blockchain
networks from each other and to ensure that transactions and messages are sent to the correct network. Your Cosmos EVM blockchain should
follow the format of identifier_EIP155-version
format.
You can also look up the EIP-155 Chain ID
by referring
to chainlist.org.
The Chain Identifier
Every chain must have a unique identifier or chain-id
. Tendermint requires each application to
define its own chain-id
in the genesis.json fields.
However, to comply with both EIP-155 and Cosmos standard for chain upgrades, Cosmos EVM-compatible chains must implement
a special structure for their chain identifiers.
Structure
A Cosmos EVM Chain ID contains 3 main components
- Identifier: Unstructured string that defines the name of the application.
- EIP-155 Number: Immutable EIP-155
CHAIN_ID
that defines the replay attack protection number. - Version Number: Is the version number (always positive) that the chain is currently running. This number MUST be incremented every time the chain is upgraded or forked to avoid network or consensus errors.
Format
The format for specifying a Cosmos EVM-compatible chain-id in genesis is the following:
{identifier}_{EIP155}-{version}
The following table provides an example where the second row corresponds to an upgrade from the first one:
ChainID | Identifier | EIP-155 Number | Version Number |
---|---|---|---|
cosmoshub-1 | cosmoshub | 9000 | 1 |
cosmoshub-2 | cosmoshub | 9000 | 2 |
... | ... | ... | ... |
cosmoshub-N | cosmoshub | 9000 | N |