---
eip: 3788
label: EIP-3788
title: Strict enforcement of chainId
status: Stagnant
type: Standards Track
category: Core
created: 2021-09-02
requires: 155
official: https://eips.ethereum.org/EIPS/eip-3788
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3788.md
canonical: https://eips.huatuo.xyz/eip-3788/
lang: en
tldr: Proposed making nodes reject any transaction whose chainId does not match their own, closing the loophole where chainId 0 transactions can be replayed across chains.
tags: [transactions, chainid, replay-protection, security, core]
---

# EIP-3788: Strict enforcement of chainId

> Reject transactions that do not explicitly have the same chainId as the node's configuration.

**TL;DR:** Proposed making nodes reject any transaction whose chainId does not match their own, closing the loophole where chainId 0 transactions can be replayed across chains.

## What problem does it solve?

[EIP-155](/eip-155/) added a chain ID to signed transactions so a transaction signed for one network cannot be replayed on another. But, as this EIP points out, a transaction with `chainId = 0` is still treated as valid. That was kept deliberately, so developers could create transactions that work on any chain.

With many EVM-compatible networks built from forks of Ethereum clients, that escape hatch became a risk. Most wallets do not show users which chain ID they are signing. A malicious (or careless) network could get users to sign `chainId = 0` transactions and then replay them on Ethereum mainnet or elsewhere.

## How it works

From a fork block `N`, a node rejects any transaction whose chain ID differs from the chain ID in its own configuration. In particular, `chainId = 0` transactions become invalid.

```text
if node.config.chainId != tx.chainId:
    reject(tx)
```

The check is applied in two places:

1. **JSON-RPC** (`eth_sendTransaction`, `eth_sendRawTransaction`): reject early, so users never have a transaction pending that is guaranteed to fail.
2. **Transaction validation** during block processing: so such a transaction can never be included in a block.

The node's configured chain ID is the single source of truth.

## Sample code

Typed transactions ([EIP-2718](/eip-2718/), e.g. [EIP-1559](/eip-1559/) type-2) always carry an explicit `chainId`. With ethers v6 the signer fills it in from the connected provider, and you can make the intent explicit:

```ts
import { JsonRpcProvider, Wallet, parseEther } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const wallet = new Wallet(process.env.PRIVATE_KEY!, provider);
const { chainId } = await provider.getNetwork();

const tx = await wallet.sendTransaction({
  to: "0x000000000000000000000000000000000000dEaD",
  value: parseEther("0.001"),
  chainId,            // bound to this network only, never 0
});
console.log(tx.chainId); // e.g. 1n on mainnet
```

## Things to know

- Status: **Stagnant**. It was never scheduled for a network upgrade.
- The spec says it would break any application or tooling that still submits `chainId == 0` transactions after the fork block.
- It does not stop someone from launching a network that reuses `chainId = 1` or any other existing ID. Replay protection only works when chain IDs are unique.
- For wallets the practical lesson stands without a fork: always sign with an explicit, correct chain ID and show it to the user.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-3788
