Chain ID
A Chain ID is a unique identifier assigned to a blockchain network. It helps to:
Differentiate networks (Mainnet, Testnet, Devnet).
Ensure transactions are broadcasted to the correct network.
Prevent replay attacks by including the Chain ID in signed transactions (EIP-155 compliance).
LagomChain's Chain ID Format
LagomChain follows a structured Chain ID format, which includes:
Identifier – Defines the blockchain name.
EIP-155 Number – Immutable replay protection number.
Version Number – Represents the current network version and is incremented upon upgrades or forks.
Chain ID Format in Genesis
Example:
Official Chain IDs
Mainnet:
Testnet:
Certain upgrades may require an increase in the version number, but not all protocol changes necessitate a Chain ID change.
The Chain Identifier in LagomChain
Every blockchain must have a unique chain-id defined in genesis.json
.
LagomChain’s Chain ID is used in:
EIP-155 replay protection to prevent cross-chain transaction replays.
Cosmos SDK standardization for smooth chain upgrades.
Tendermint consensus rules, ensuring network integrity.
Example Configuration in genesis.json
genesis.json
Chain ID Upgrade Process
When upgrading the LagomChain network, the version number must be incremented to avoid consensus issues.
Example of Chain ID Upgrade:
Previous Chain ID
Upgraded Chain ID
Reason for Change
lagom_986-1
lagom_986-2
Major upgrade requiring new consensus rules
lagom_testnet-986-1
lagom_testnet-986-2
Testnet upgrade for new feature testing
Why Chain ID Matters
1. Ensures Network Uniqueness
Each blockchain network must have a distinct Chain ID to differentiate it from others.
2. Prevents Replay Attacks (EIP-155 Compliance)
Transactions signed on one network cannot be replayed on another due to the Chain ID being embedded in the transaction data.
3. Enables Seamless Upgrades
By following the structured Chain ID format, LagomChain ensures smooth protocol upgrades without breaking consensus.
Last updated