You can look up existing EVM Chain IDs by referring to chainlist.org to ensure your chosen ID is not already in use.
Dual Chain ID System
Cosmos EVM requires two separate chain IDs to maintain full compatibility with both the Cosmos SDK and Ethereum ecosystems:1. Cosmos Chain ID (String)
The Cosmos Chain ID is a string identifier used by:- CometBFT consensus engine
- IBC (Inter-Blockchain Communication) protocol
- Native Cosmos SDK transactions
- Chain upgrades and governance
"cosmosevm-1"
, "mychain-testnet-2"
)
Example:
2. EVM Chain ID (Integer)
The EVM Chain ID is an integer used by:- Ethereum transactions (EIP-155 replay protection)
- MetaMask and other Ethereum wallets
- Smart contract deployments
- EVM tooling (Hardhat, Foundry, etc.)
9000
, 9001
)
Example:
Configuration
Both chain IDs must be configured when setting up your chain:In Your Application Code
In Genesis Configuration
The Cosmos Chain ID is set ingenesis.json
:
Important Considerations
Chain ID Selection
The two chain IDs serve different purposes and must not be confused:
- Use the Cosmos Chain ID (string) for IBC connections, governance proposals, and Cosmos SDK operations
- Use the EVM Chain ID (integer) for MetaMask configuration, smart contract deployments, and EIP-155 transaction signing
EVM Chain ID Guidelines
When selecting your EVM Chain ID:- Check availability: Verify your chosen ID is not already in use on chainlist.org
- Avoid conflicts: Don’t use well-known chain IDs (1 for Ethereum mainnet, 137 for Polygon, etc.)
- Consider ranges:
- Production networks often use lower numbers
- Testnets commonly use higher ranges (9000+)
- Local development can use very high numbers (31337+)
Chain Upgrades
Unlike traditional Cosmos chains that change their chain ID during upgrades (e.g.,
cosmoshub-4
to cosmoshub-5
), the EVM Chain ID must remain constant across upgrades to maintain compatibility with deployed smart contracts and existing wallets.Examples
Here are some example configurations:Network Type | Cosmos Chain ID | EVM Chain ID | Notes |
---|---|---|---|
Mainnet | "cosmosevm-1" | 9000 | Production network |
Testnet | "cosmosevm-testnet-1" | 9001 | Public testnet |
Devnet | "cosmosevm-dev-1" | 9002 | Development network |
Local | "cosmosevm-local-1" | 31337 | Local development |
Troubleshooting
Common Issues
-
“Chain ID mismatch” errors
- Cause: Using Cosmos Chain ID where EVM Chain ID is expected (or vice versa)
- Solution: Ensure you’re using the correct type of chain ID for each context
-
MetaMask connection failures
- Cause: Incorrect EVM Chain ID in wallet configuration
- Solution: Use the integer EVM Chain ID, not the string Cosmos Chain ID
-
IBC transfer failures
- Cause: Using EVM Chain ID for IBC operations
- Solution: IBC always uses the Cosmos Chain ID (string format)
-
Smart contract deployment issues
- Cause: EIP-155 replay protection using wrong chain ID
- Solution: Ensure your EVM Chain ID matches what’s configured in the chain