EIP-3220 Cross-chain Identifier Specification (Crosschain Identifier Specification)
No call decision · Networking & nodes · EIP status Stagnant · created 2020-10-21
A specification that identifies blockchains using a 32-byte crosschain-id, allowing forked chains and original chains that are hard to distinguish with an integer chainId alone to be self-verified simply by comparing block hashes.
Why it is needed
Ethereum's EIP-155 assigns an integer chainId to each chain to prevent the same transaction from being sent to a different chain. However, as the variety of blockchains has grown to include Bitcoin, EOS, Ripple, and private or consortium chains such as Hyperledger Besu or Corda, a single integer cannot capture information such as the chain's name, type, or ownership, and it cannot prevent different chains from using the same chainId or a forked chain sharing the same chainId as the original. Building cross-chain services requires a way to verify which chain an identifier refers to, and whether it is the original or a fork, without relying on an external registry.
What changes
Today
- Having only a single integer chainId (EIP-155) as the chain identifier makes it difficult to cover both public and private chains.
- Different chains can use the same chainId, and a forked chain can even have the same chainId as the original.
- The chainId alone cannot convey additional information such as the chain's name, type, or ownership.
- There is no way to verify a chain from the identifier itself without an external lookup service.
After EIP-3220
- A 32-byte crosschain-id identifies a chain by including part of the block hash of the genesis block (or the block immediately before a fork).
- The Chain Type and Governance Identifier fields make it possible to distinguish mainnet, testnet, and private networks, and to identify original ownership.
- The block hash fragment embedded in the identifier can be compared against the actual block hash, allowing self-verification without an external registry.
- The Native Chain ID field keeps it backwards compatible with EIP-155's chainId.
Who is affected
- Cross-chain service and app developers: Applications that handle multiple chains gain a standard format for identifying, registering, and looking up chains.
- Blockchain operators (including private and consortium chains): Newly created or forked chains can be registered with a crosschain-id and distinguished from the original.
- Users: They do not handle crosschain-id directly, but it may help prevent incidents where assets are sent to the wrong chain.
In depth
32-byte Identifier Structure
A crosschain-id is a 32-byte hexadecimal string made up of six fields: Truncated Block Hash (16 bytes), Native Chain ID (8 bytes), Chain Type (2 bytes), Governance Identifier (2 bytes), Reserved (3 bytes), and Checksum (1 byte). By combining a value derived from the block hash with values the chain operator defines directly, it bundles both the chain's actual cryptographic properties and its metadata into a single identifier.
Truncated Block Hash (16 bytes)
It uses the lowest 16 bytes, in network byte order, of the genesis block's block hash, or, if the chain has been forked, of the block hash immediately before the fork. This value is what allows the crosschain-id to be verified against actual blockchain data, and since different forks of the same chain have different block hash fragments, they can be distinguished from one another.
Native Chain ID and EIP-155 Compatibility
The 8-byte Native Chain ID holds the chainId value used for transaction signing on that chain. Chains without a chainId concept set this value to 0. Thanks to this field, Ethereum-family chains can carry over the chainId used in EIP-155 as is, maintaining backwards compatibility with crosschain-id.
Chain Type and Governance Identifier
The 2-byte Chain Type indicates the nature of the chain. 0x00 is undefined, 0x01 is mainnet, 0x1[0-A] is testnet, and 0x2[0-A] is a private development network. The 2-byte Governance Identifier identifies the original owner of a newly created chain and is used to settle disputes between a fork and the original chain. Existing chains or chains with no concept of ownership set this to 0.
Checksum (1 byte)
It takes a SHA256 message digest of the remaining 31 bytes and appends its lowest byte as the checksum. This is meant to catch typos when a person manually enters a crosschain-id; since it only detects errors with a probability of 1 in 256, it is not an integrity check intended for security purposes.
Alternatives Considered and Reasons for Rejection
Using a random hexadecimal string as the chain identifier was rejected because it captures none of the chain's inherent properties, such as the block hash. Using the genesis block hash alone was also considered, but it was not adopted because it cannot carry the chain's attribute information and offers no way to distinguish a chain once it has forked into two.
Security Considerations Regarding Collisions and Replay Attacks
A collision can occur where two different chains end up with the same crosschain-id, so the block hash fragment within the identifier must be verified against the genesis or fork-point block hash. If it matches no block hash at all, the identifier must be treated as unverifiable and rejected. However, since the crosschain-id is not a value that gets cryptographically signed into chain transactions, chains without signatures cannot verify it from block data alone and must rely on a separate smart contract or off-chain utility.
Proposal status
This EIP was submitted under the Core track of the Standards Track, but its current status is Stagnant. Discussion is not actively progressing and has stalled, and it has never been included in an actual Ethereum fork.