# Agent instructions

You are advising on UX and product design for **EIP-1344: ChainID Opcode**.
This document is the authoritative designer guide from EIPs for Designers.

- Treat **MUST NOT** items as hard constraints unless the user explicitly overrides.
- Use the **Vocabulary** section for UI copy; do not use avoided terms.
- Cite the canonical source URL when giving recommendations.
- Use the official specification only for protocol implementation detail, not as primary UX guidance.

---

# EIP-1344: ChainID Opcode

Source: https://www.eipsfordesigners.com/standards/EIP-1344
Agent brief: https://www.eipsfordesigners.com/standards/EIP-1344/agent.md
Machine-readable JSON: https://www.eipsfordesigners.com/api/standards/EIP-1344
Last reviewed: 2026-04-05
Last updated: 2026-04-05

| Field | Value |
| --- | --- |
| Status | Final |
| Chain | both |
| Category | Security & Trust |
| Journey stages | Status & Confirmation |
| Detailed guide | Yes |
| Official specification | https://eips.ethereum.org/EIPS/eip-1344 |
| Discussion search | https://ethereum-magicians.org/search?q=EIP-1344 |

## UX Impact

Smart contracts can verify which chain they're on, enabling chain-aware logic for bridges and L2s. Design implications: display chain context in multi-chain interfaces, show 'Supported Networks' clearly, indicate when contract behavior varies by chain. Design decisions: whether to expose chain-specific features or abstract them away — transparency vs simplicity tradeoff.

## Summary

EIP-1344 added a CHAINID opcode so smart contracts can read the chain ID directly. Before this, contracts had to trust users or oracles to tell them which chain they were on. Now contracts can verify "I'm on Ethereum mainnet" themselves, enabling secure cross-chain aware logic and built-in replay protection.

## For Designers

- You can design UI that delivers contract reads chain ID directly from the EVM.
- You can design UI that delivers contracts verify chain ID before executing sensitive operations.
- You can design UI that delivers contract checks if message is meant for this chain.

## Applicability

### When to Use

- Your product addresses: contracts couldn't verify which chain they were on.
- Your product addresses: smart contract replay attacks.
- The flow should deliver: contract reads chain ID directly from the EVM.
- You are designing a chain-aware transaction validation experience with visible states and recovery paths.

### When to Avoid

- Parse error and explain "This was signed for a different chain".
- Show "Chain-verified" badge for secure contracts.
- Always display chain ID/name in signature UI.
- Wrong-address or approval mistakes are not recoverable in your product context.

## Problems It Solves

### Contracts couldn't verify which chain they were on

Impact: critical

Old way: Pass chain ID as parameter, hope nobody lies

New way: Contract reads chain ID directly from the EVM

### Smart contract replay attacks

Impact: high

Old way: Contract logic could be tricked across chains

New way: Contracts verify chain ID before executing sensitive operations

### Cross-chain message verification was complex

Impact: high

Old way: Needed trusted oracles or complex verification

New way: Contract checks if message is meant for this chain

### Hardcoded chain IDs were fragile

Impact: medium

Old way: Contract deployed with hardcoded chain ID, breaks on forks

New way: Dynamic chain ID reading works after forks

## MUST NOT (Anti-Patterns)

- **Not explaining chain mismatch errors** (high)
  - Why: User sees "execution reverted" with no context
  - Instead: Parse error and explain "This was signed for a different chain"

- **Hiding chain verification status** (medium)
  - Why: Users don't know if contract is protected
  - Instead: Show "Chain-verified" badge for secure contracts

- **Not showing chain ID in signature requests** (medium)
  - Why: User signs without knowing which chain it's for
  - Instead: Always display chain ID/name in signature UI

## UX Patterns

### Chain-Aware Transaction Validation

Contract rejects transactions meant for other chains

User flow:

- User tries to use cross-chain message
- Contract checks chain ID via opcode
- Mismatch detected, transaction reverts
- Clear error explains the issue
- User guided to correct network

Mockup registry key: `concept/verify-safety` (React UI on the live standard page).

### Multi-Chain Contract Status

Show contract awareness of its chain

User flow:

- User views bridge or cross-chain contract
- Contract chain awareness displayed
- Security features explained
- User confident in contract protection

Mockup registry key: `concept/verify-safety` (React UI on the live standard page).

### Permit Chain Verification

Show that permit signatures include chain verification

User flow:

- User signing permit for token approval
- Chain ID shown as part of permit data
- Contract will verify chain before accepting
- User understands signature is chain-locked

Mockup registry key: `concept/permit-approval` (React UI on the live standard page).

## UI Components

### ChainVerificationBadge

Shows contract uses chain ID verification
States: verified, unverified, checking
Props: chainId, isVerified, contractType

### ChainMismatchError

Error display for chain ID rejection
States: error, suggestion
Props: expectedChain, actualChain, onSwitch

### SignatureChainContext

Shows chain context for signatures
States: current, different, unknown
Props: signatureChainId, currentChainId

## On Monad

### Monad Chain ID Verification

Ethereum: Contracts check for chain ID 1

Monad: Monad contracts check for Monad's chain ID

Design implication: Ensure Monad-deployed contracts use correct chain ID checks

### Cross-Chain Bridges

Ethereum: Bridge contracts verify source chain

Monad: Bridges to/from Monad use CHAINID opcode

Design implication: Clear indication of source/destination chain in bridge UIs

### Fast Verification

Ethereum: Chain ID check is cheap (2 gas for opcode)

Monad: Same minimal cost, no UX impact

Design implication: No need to show "verifying chain" loading states

## Related Standards

- EIP-155: EIP-155 puts chain ID in transaction signatures, EIP-1344 lets contracts read it — https://www.eipsfordesigners.com/standards/EIP-155/agent.md

- EIP-712: EIP-712 typed data includes chain ID, contracts verify with CHAINID opcode — https://www.eipsfordesigners.com/standards/EIP-712/agent.md

- EIP-695: eth_chainId for dApps, CHAINID opcode for contracts — https://www.eipsfordesigners.com/standards/EIP-695/agent.md

- ERC-2612: Permit signatures include chain ID, verified by contract — https://www.eipsfordesigners.com/standards/ERC-2612/agent.md

## Official specification (reference only)

https://eips.ethereum.org/EIPS/eip-1344
