ERC-7964 Cross-chain EIP-712 signatures (Crosschain EIP-712 Signatures)

Draft · Signatures & auth · created 2025-06-05

A standard that allows a single signature to produce an EIP-712 signature valid simultaneously across multiple chains, enabling cross-chain transactions, voting, and account management to be authorized without signing separately on each chain.

Why it is needed

Under current account abstraction approaches, you must sign separately on each chain, which makes tasks like cross-chain transactions, multi-chain DAO voting, managing the same account deployed across multiple chains, and cross-chain social recovery cumbersome. Existing solutions to this use Merkle trees to bundle operations into a single root, but standard wallets cannot display Merkle tree leaves, so users cannot see on the wallet screen what they are actually signing, and wallets must implement separate logic to request all leaves and verify the tree. Alternatively, non-standard encoding schemes are used, but these are difficult to use in practice since wallets do not adopt them.

In depth

Cross-chain domain with chainId omitted

Omitting the top-level chainId field from the EIP-712 domain means the rule by which a wallet rejects a signature when the domain's chainId differs from the current chain no longer applies, allowing the same signature to be reused across multiple chains. To preserve protection for signers, each per-chain operation struct must still include a target chainId, so users can see, within the typed data shown by the wallet, the list of chains they are actually signing for. Since the contract address and chainId must be verified per chain, the main domain typically retains only name and version. verifyingContract can be included in the main domain to bind the signature to an application deployed at the same address on every chain, in which case the address can be omitted from the per-chain structs.

Operation array encoding and the chainId field

Cross-chain operations are encoded as an array of message structs. Each element of the array must include a field named exactly chainId at some depth within the struct, which lets off-chain tools find the operation relevant to the current chain without knowing the application-specific structure. If the chainId field appears more than once within the same operation, the first one encountered when scanning the struct depth-first in input order is treated as the target chainId. If the contract is deployed at different addresses on different chains, and the main domain lacks verifyingContract, each operation must also include verifyingContract (or an equivalent field). Implementers can nest chainId and verifyingContract in a struct named something like EIP712ChainDomain to avoid a name collision with EIP712Domain.

Hashing the full message struct

The EIP-712 signature is computed not just over the operation array but over the entire message struct, such as CrossChainIntent or MultiChainVote. The application must define a typehash for the full struct that contains the operation array, and other message fields such as nonce or deadline can also be included in this struct. Per EIP-712 rules, the array itself is hashed by recursively hashing each element (struct) via hashStruct, then concatenating those 32-byte hashes and hashing them once more with keccak256 to produce a single array hash. The same typehash must be used on every chain where the application is deployed.

Signature encoding and on-chain verification procedure

The cross-chain signature is ABI-encoded as the tuple (bytes32 header, bytes32[] structsArray, bytes crossChainSignature). The single header word packs three values together using abi.encodePacked: a 10-byte magic value 0x79647964796479647964 (identifying a cross-chain signature), a 2-byte structIndex (the position of the current chain's operation within the array), and a 20-byte application address (a contract implementing ERC-5267 to provide EIP-712 domain information). If the first 10 bytes of the signature match the magic value, the application recognizes it as a cross-chain signature, checks that structsArray[structIndex] matches the struct hash of the current chain's message, then calls the application contract's eip712Domain() to obtain domain information, computes the main domain fields, reconstructs the full hash, and verifies crossChainSignature.

Computing the main domain fields

The verifier fixes in advance which domain fields will be included in the per-chain struct and represents this as a chainFields constant in ERC-5267's fields bitmap format. Since every per-chain struct includes the target chainId, chainFields must always include the chainId bit (0x04). The fields to include in the main domain are whatever remains from applicationFields returned by the application contract after subtracting chainFields (mainFields = applicationFields & ~chainFields). This set is determined by the verifier, not the signature, and is not encoded into the signature. Every chain verifying a given cross-chain message must use the same typehash and chainFields, and the application must return the same main domain values on every target chain for all signatures to be valid.

Comparing the array approach with the Merkle tree approach

This standard chose array encoding over Merkle trees. Merkle trees can reduce on-chain data when there are many chains, but standard EIP-712 wallets cannot display Merkle tree leaves, so there is no way for a wallet UI to show the user which operations are contained in the Merkle root being signed, and wallets must build separate logic to request all leaves and verify the tree's construction. With the array approach, every per-chain operation is visible as-is as part of the standard EIP-712 message structure, so there can be no hidden operations. The difference in on-chain cost is also small, around 32 to 64 bytes (one or two hashes) in the 2 to 5 chain range, not large enough to justify sacrificing transparency.

Compatibility with existing wallets and apps

Because this standard uses EIP-712 unmodified, wallets and apps that already support EIP-712 can display cross-chain signed messages immediately without any changes. However, they will not recognize the cross-chain semantics (that the signature is reusable across multiple chains). Existing applications that verify against a specific chainId in the domain will automatically reject a cross-chain signature with chainId omitted, so they fail safely by default. Applications that want to support cross-chain signatures must implement the verification procedure described by this standard themselves.

Proposal status

This proposal is still in Draft status, and details may change or the proposal may stall during community discussion and implementation.

Things to watch out for

Original ERC · ← ERCs