Chain Configuration Guide
When building your custom chain based onevmd, you’ll need to configure several key parameters. This guide walks through each configuration option from the evmd default setup and shows you how to customize it for your chain.
This guide focuses on the practical configuration steps. For comprehensive parameter references and advanced topics, see the migration guides and module-specific documentation.
evmd Default Configuration
The reference implementation (evmd) comes with these defaults:
| Configuration | Default Value | Customizable |
|---|---|---|
| Binary Name | evmd | Yes (rename) |
| Cosmos Chain ID | cosmos_262144-1 | Yes (genesis) |
| EVM Chain ID | 262144 | Yes (genesis) |
| Custom Opcodes | None | Yes (advanced) |
| Token Pairs | 1 (native token) | Yes (genesis) |
| Denomination | atest (18 decimals) | Yes (genesis) |
| EVM Permissioning | Permissionless | Yes (genesis) |
| Enabled Precompiles | All 9 precompiles | Yes (genesis) |
1. Binary Name
What It Is: The name of your compiled blockchain executable. Default:evmd
How to Change
1
Rename Directory
2
Update Go Files
3
Update go.mod
Edit the module path in
go.mod:4
Update Makefile
Edit the Makefile to use your binary name:
5
Build
After renaming, your binary will be
yourchain instead of evmd. All CLI commands will use this new name (e.g., yourchain start instead of evmd start).2. Cosmos Chain ID
What It Is: The unique identifier for your blockchain in the Cosmos ecosystem. Used for IBC connections and governance. Default:cosmos_262144-1
Format: {name}_{evmChainID}-{version}
How to Change
Set during chain initialization:- Testnet:
yourchain_262144-1 - Mainnet:
yourchain-1(after registering a unique EVM chain ID)
The Cosmos chain ID is separate from the EVM chain ID. The format
name_evmChainID-version helps maintain consistency between both IDs, but it’s not required.Changing After Genesis
While technically possible through a coordinated upgrade, changing the Cosmos chain ID requires all nodes to update and restart simultaneously. Plan your chain ID carefully before launch.3. EVM Chain ID
What It Is: The EIP-155 chain ID used for Ethereum transaction replay protection. Default:262144
Where Configured: Retrieved from app options in app.go
How to Change
The EVM chain ID cannot be changed after genesis without breaking transaction replay protection. Choose carefully before launch.
app.go:
app.toml:
Choosing an EVM Chain ID
Reserved IDs
Reserved IDs
Avoid these ranges:
1- Ethereum Mainnet2-10- Ethereum testnets1-999- Generally reserved by Ethereum Foundation137- Polygon- Common production chains - Check chainlist.org
Testing
Testing
For local development and testnets:
- Use
262144(evmd default) - Or any high number unlikely to conflict
- No registration needed
Production
Production
For mainnet launches:
- Choose a unique ID > 1,000,000
- Register at chainlist.org
- Verify no conflicts with existing chains
- Document your choice publicly
4. Custom Opcodes
What It Is: Custom EVM operations beyond standard Ethereum opcodes. Default: NoneCustom opcodes are an advanced feature. Most chains should use standard Ethereum opcodes with the optional
extra_eips parameter instead.Adding Extra EIPs
Instead of custom opcodes, enable additional Ethereum Improvement Proposals:2200- Net gas metering2929- Gas cost increases for state access3198- BASEFEE opcode3529- Reduction in refunds
Implementing Custom Opcodes (Advanced)
Implementing Custom Opcodes (Advanced)
For teams that need custom EVM functionality:Then in genesis:This is rarely needed - consider if standard EVM functionality meets your needs first.
- Create activator functions in your chain’s
eips/directory - Register in the activators map
- Add to
extra_eipsin genesis
5. Token Pairs (ERC20 Module)
What It Is: Mappings between Cosmos native tokens and ERC20 contract representations. Default: 1 pair for the native tokenHow to Configure
For comprehensive ERC20 module configuration, see the ERC20 Module Documentation.
erc20 module:
Default Native Token Pair
The evmd example uses a special ERC20 address for the native token:- Address:
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE - Denom:
atest(or your chain’s native denom) - Purpose: Allows native tokens to be used in EVM contracts as ERC20
Default Setup: Most chains start with just the native token pair. Additional pairs can be registered after launch through governance or permissionless registration (if enabled).
6. Token Denomination
What It Is: Your chain’s native token denomination and decimal precision. Default:atest (18 decimals, atto-prefix)
Understanding Token Configuration
Token configuration involves three components:- Bank Metadata - Defines denominations and decimals
- VM Parameters - Specifies which denom is the EVM native token
- Extended Denom Options - Required only for non-18 decimal tokens
- 18 Decimals (Recommended)
- 6 Decimals (Cosmos Standard)
- Other Decimals
Direct EVM Compatibility - No Extra Modules NeededBenefits:
- Direct 1:1 EVM mapping
- Uses standard
x/bankmodule - Simpler architecture
- No additional modules required
Common Denomination Prefixes
| Prefix | Decimals | Example | Used For |
|---|---|---|---|
a (atto) | 18 | atoken | EVM-compatible chains (recommended) |
u (micro) | 6 | uatom, ustake | Traditional Cosmos chains |
| Base | 0-8 | sats | Bitcoin-style |
Recommendation: Use 18 decimals (
atto prefix) for new chains. This provides:- Direct EVM compatibility
- Simpler codebase (no precisebank needed)
- Better UX for Ethereum users
- Standard across EVM ecosystems
Setting Denomination in Genesis
The denomination is set in multiple places that must be consistent:Critical: The following must all use the same base denomination:
staking.params.bond_denommint.params.mint_denomgov.params.min_deposit[0].denomvm.params.evm_denombank.denom_metadata[0].base
7. EVM Permissioning
What It Is: Access control for deploying and calling smart contracts. Default: Permissionless (anyone can deploy and call contracts)How to Configure
EVM permissions are set in genesis undervm.params.access_control:
- Permissionless (Default)
- Permissioned Deployment
- Restricted (Blocklist)
- Fully Closed
Access Control Types
| Type | Value | Behavior | access_control_list |
|---|---|---|---|
| Permissionless | 0 | Anyone can perform action | Ignored |
| Restricted | 1 | Block addresses in list | Blocklist |
| Permissioned | 2 | Only addresses in list | Allowlist |
Recommendation: Start with permissionless for testnets. For mainnets, consider permissioned deployment initially, then transition to permissionless through governance once the chain is stable.
Modifying After Genesis
Access control can be changed through governance proposals:8. Enabled Precompiles
What It Is: Native Cosmos SDK functionality exposed as EVM smart contracts. Default: All 9 static precompiles enabledAvailable Precompiles
For complete precompile documentation including Solidity interfaces and usage examples, see the Precompiles Overview.
| Address | Name | Description | Typical Use Case |
|---|---|---|---|
0x0100 | P256 | P256 cryptographic operations | Web3 auth, secure signing |
0x0400 | Bech32 | Cosmos ↔ Ethereum address conversion | Cross-chain operations |
0x0800 | Staking | Validator staking operations | Liquid staking, auto-compounding |
0x0801 | Distribution | Reward distribution queries | Reward dashboards, auto-claiming |
0x0802 | ICS20 | IBC token transfers | Cross-chain DeFi |
0x0803 | Vesting | Vesting account management | Token vesting contracts |
0x0804 | Bank | Native token transfers | Payment contracts |
0x0805 | Governance | On-chain voting | DAO integration |
0x0806 | Slashing | Validator slashing info | Validator monitoring |
How to Configure
- Enable All (evmd default)
- Enable Specific Precompiles
- Disable All
- In app.go
Security Consideration: Only enable precompiles your chain actually needs. Each enabled precompile increases the attack surface and testing complexity.
Modifying After Genesis
Precompiles can be enabled or disabled through governance:Configuration Workflow
Here’s the recommended order for configuring your chain:1
Plan Your Configuration
Decide on:
- Binary name
- Chain IDs (Cosmos and EVM)
- Token denomination and decimals
- Precompiles needed
- Access control policy
2
Rename and Rebrand
3
Initialize Chain
4
Configure Genesis
Edit
~/.yourchain/config/genesis.json:5
Configure app.toml
Edit
~/.yourchain/config/app.toml:6
Test Locally
- Chain starts successfully
- RPC is accessible
- Precompiles are enabled
- Token denomination is correct
7
Deploy
For production:
- Coordinate genesis with validators
- Distribute final genesis file
- Launch at coordinated time
Configuration Examples
Reference: local_node.sh
Looking for a real-world example? The
local_node.sh script in the Cosmos EVM repository is the best reference for complete chain configuration. It demonstrates how evmd sets up genesis and app.toml for local development.local_node.sh script performs all the configuration steps automatically. Here’s what it does:
Genesis Modifications
Genesis Modifications
The script modifies
genesis.json to configure:- Chain ID: Sets to
cosmos_262144-1 - Token denomination: Configures
atest(18 decimals) across all modules - Bank metadata: Sets up denom metadata with proper exponents
- Precompiles: Enables all 9 static precompiles by default
- Validator configuration: Creates genesis validator with initial stake
- Genesis accounts: Funds test accounts for development
app.toml Configuration
app.toml Configuration
The script configures These settings are optimized for local development and should be adjusted for production.
app.toml with development-friendly settings:Script Flags
Script Flags
The
local_node.sh script accepts flags that control configuration:-y: Overwrites previous database (fresh genesis)-n: Preserves previous database (resume)--no-install: Skips binary rebuild--remote-debugging: Builds with debug symbols
Using as a Template
Using as a Template
To use
local_node.sh as a template for your chain:- Copy the script:
cp local_node.sh my_chain_setup.sh - Update chain name: Change
evmdto your binary name - Modify genesis values: Update denom, chain ID, precompiles
- Adjust app.toml settings: Configure for your use case (testnet/mainnet)
- Add custom logic: Include any chain-specific setup
Production Considerations: The
local_node.sh configuration is optimized for local development. For testnets and mainnets:- Disable debug APIs in JSON-RPC
- Require transaction signatures (
allow-unprotected-txs = false) - Set appropriate
min-tipvalue - Use secure key management (not test keys)
- Configure proper peer discovery and networking
Complete 18-Decimal Chain
Complete 6-Decimal Chain with PreciseBank
Next Steps
Now that your chain is configured:- Test Locally: Use
./local_node.shto test all configurations - Deploy Contracts: Verify precompiles work as expected
- Set Up Validators: Prepare for testnet/mainnet launch
- Document Configuration: Share configuration choices with users
- Plan Governance: Determine which parameters may change post-launch
Further Reading
Building Your Chain Guide
Complete guide to forking and customizing evmd
Migration Guide
Detailed migration instructions for v0.5
VM Module
VM module configuration and parameters
PreciseBank Module
Fractional balance tracking for non-18-decimal chains
For additional support, visit the Cosmos EVM GitHub repository or join the Cosmos developer community.