{"eip":7964,"title":"Crosschain EIP-712 Signatures","description":"Support EIP-712 signatures for crosschain account operations.","authors":["Ernesto García (@ernestognw)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2025-06-05","requires":[712,1271,5267],"discussionsTo":"https://ethereum-magicians.org/t/universal-cross-chain-signatures-for-account-abstraction/24452","repo":"ERCs","label":"ERC-7964","officialUrl":"https://eips.ethereum.org/EIPS/eip-7964","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7964.md","url":"https://eips.huatuo.xyz/eip-7964/","tldr":{"en":"Lets one EIP-712 signature authorize operations on several chains by dropping chainId from the domain and listing a per-chain operation (each with its own chainId) in an array the wallet displays in full.","ja":"ドメインから chainId を外し、各チェーンの操作（それぞれ独自の chainId を持つ）をウォレットが全件表示する配列に並べることで、1 つの EIP-712 署名で複数チェーンの操作を承認できるようにする。","ko":"도메인에서 chainId를 빼고 체인별 작업(각각 자체 chainId 포함)을 지갑이 전부 표시하는 배열에 나열해, 하나의 EIP-712 서명으로 여러 체인의 작업을 승인할 수 있게 한다.","zh":"通过从域中去掉 chainId，并把每条链各自的操作（各带自己的 chainId）列在钱包完整展示的数组中，让一次 EIP-712 签名即可授权多条链上的操作。"},"tags":["signatures","eip-712","crosschain","account-abstraction","erc"],"explainers":{"en":{"lang":"en","tldr":"Lets one EIP-712 signature authorize operations on several chains by dropping chainId from the domain and listing a per-chain operation (each with its own chainId) in an array the wallet displays in full.","tags":["signatures","eip-712","crosschain","account-abstraction","erc"],"related":[712,1271,5267],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7964/","markdown":"## What problem does it solve?\n\nSmart accounts today need a separate signature for every chain. A user who wants to vote on a DAO deployed on three networks, run an intent that touches two chains, or rotate keys on the same account everywhere has to sign again and again.\n\nEarlier ideas signed a Merkle root of all operations, but a normal wallet cannot show what is inside a Merkle root, so the user is effectively signing blind. ERC-7964 uses only plain [EIP-712](/eip-712/) typed data, so any wallet that already displays typed data shows every operation on every chain.\n\n## How it works\n\n- **Domain without `chainId`.** The top-level `EIP712Domain` usually contains only `name` and `version`. EIP-712 only requires wallets to check the chain when `chainId` is present, so omitting it makes the signature legitimately multi-chain.\n- **One operation per chain.** The message holds an array of structs, and each must contain a field named exactly `chainId` (and normally the target contract). The signer therefore still sees and approves the exact set of chains.\n- **Wrapper struct.** The array sits inside an app-defined struct such as `CrossChainIntent(ChainOperation[] operations, uint256 nonce, uint256 deadline)`, with the same type hash on every chain.\n- **On-chain envelope.** Each chain receives `abi.encode(header, structsArray, signature)`. `header` packs a 9-byte magic value `0x796479647964796479`, a `fields` byte, the `structIndex` of this chain's operation, and an `application` address implementing [ERC-5267](/eip-5267/) to supply the domain. `structsArray` is the list of every operation's struct hash.\n- **Verification.** The contract checks `structsArray[structIndex]` equals the hash of the local operation, rebuilds the full EIP-712 digest, and verifies the signature with ECDSA or [ERC-1271](/eip-1271/).\n\n## Sample code\n\nTyped data a wallet would sign (two chains, one signature):\n\n```json\n{\n  \"domain\": { \"name\": \"MyApp\", \"version\": \"1\" },\n  \"primaryType\": \"CrossChainIntent\",\n  \"types\": {\n    \"EIP712Domain\": [\n      { \"name\": \"name\", \"type\": \"string\" },\n      { \"name\": \"version\", \"type\": \"string\" }\n    ],\n    \"CrossChainIntent\": [\n      { \"name\": \"operations\", \"type\": \"ChainOperation[]\" },\n      { \"name\": \"nonce\", \"type\": \"uint256\" },\n      { \"name\": \"deadline\", \"type\": \"uint256\" }\n    ],\n    \"ChainOperation\": [\n      { \"name\": \"domain\", \"type\": \"EIP712ChainDomain\" },\n      { \"name\": \"target\", \"type\": \"address\" },\n      { \"name\": \"value\", \"type\": \"uint256\" },\n      { \"name\": \"data\", \"type\": \"bytes\" }\n    ],\n    \"EIP712ChainDomain\": [\n      { \"name\": \"chainId\", \"type\": \"uint256\" },\n      { \"name\": \"verifyingContract\", \"type\": \"address\" }\n    ]\n  },\n  \"message\": {\n    \"operations\": [\n      { \"domain\": { \"chainId\": 1,    \"verifyingContract\": \"0x…\" }, \"target\": \"0x…\", \"value\": 0, \"data\": \"0x\" },\n      { \"domain\": { \"chainId\": 8453, \"verifyingContract\": \"0x…\" }, \"target\": \"0x…\", \"value\": 0, \"data\": \"0x\" }\n    ],\n    \"nonce\": 7,\n    \"deadline\": 1767225600\n  }\n}\n```\n\n## Things to know\n\n- Status is **Draft**; the encoding and field names may still change.\n- Each chain receives every operation's hash (`N × 32` bytes). The spec argues this is only slightly more than a Merkle proof for 2–5 chains and keeps full transparency.\n- Contracts that build their domain with a specific `chainId` reject these signatures by default, which is the safe failure mode; support must be added on purpose.\n- Replay protection still matters: include a nonce and deadline in the wrapper struct, and make sure each chain only executes the operation matching its own `chainId`.\n"},"ja":{"lang":"ja","tldr":"ドメインから chainId を外し、各チェーンの操作（それぞれ独自の chainId を持つ）をウォレットが全件表示する配列に並べることで、1 つの EIP-712 署名で複数チェーンの操作を承認できるようにする。","tags":["signatures","eip-712","crosschain","account-abstraction","erc"],"related":[712,1271,5267],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7964/","markdown":"## 何を解決するのか\n\n現在のスマートアカウントは、チェーンごとに別々の署名が必要です。3 つのネットワークにデプロイされた DAO で投票する、2 つのチェーンにまたがるインテントを実行する、同じアカウントのキーをすべてのチェーンでローテーションする、といった場合、ユーザーは何度も署名しなければなりません。\n\n以前のアイデアでは、すべての操作の Merkle root に署名していましたが、通常のウォレットは Merkle root の中身を表示できないため、ユーザーは実質的に中身を見ずに署名することになります。ERC-7964 は純粋な [EIP-712](/eip-712/) の型付きデータだけを使うので、型付きデータを表示できるウォレットなら、すべてのチェーンのすべての操作を表示できます。\n\n## 仕組み\n\n- **`chainId` のないドメイン。** トップレベルの `EIP712Domain` は通常 `name` と `version` だけを含みます。EIP-712 でウォレットにチェーンの確認が求められるのは `chainId` がある場合だけなので、これを省くことで署名は正当にマルチチェーンになります。\n- **チェーンごとに 1 つの操作。** メッセージは構造体の配列を保持し、各構造体には正確に `chainId` という名前のフィールド（通常は対象コントラクトも）を含める必要があります。そのため、署名者は承認するチェーンの集合を正確に確認できます。\n- **ラッパー構造体。** 配列は `CrossChainIntent(ChainOperation[] operations, uint256 nonce, uint256 deadline)` のようなアプリ定義の構造体の中に置かれ、型ハッシュはすべてのチェーンで同一です。\n- **オンチェーンのエンベロープ。** 各チェーンは `abi.encode(header, structsArray, signature)` を受け取ります。`header` には、9 バイトのマジック値 `0x796479647964796479`、`fields` バイト、このチェーンの操作の `structIndex`、ドメインを提供する [ERC-5267](/eip-5267/) を実装した `application` アドレスが詰め込まれています。`structsArray` はすべての操作の struct hash のリストです。\n- **検証。** コントラクトは `structsArray[structIndex]` がローカルの操作のハッシュと等しいことを確認し、EIP-712 のダイジェスト全体を再構築して、ECDSA または [ERC-1271](/eip-1271/) で署名を検証します。\n\n## サンプルコード\n\nウォレットが署名する型付きデータ（2 チェーン、署名は 1 つ）:\n\n```json\n{\n  \"domain\": { \"name\": \"MyApp\", \"version\": \"1\" },\n  \"primaryType\": \"CrossChainIntent\",\n  \"types\": {\n    \"EIP712Domain\": [\n      { \"name\": \"name\", \"type\": \"string\" },\n      { \"name\": \"version\", \"type\": \"string\" }\n    ],\n    \"CrossChainIntent\": [\n      { \"name\": \"operations\", \"type\": \"ChainOperation[]\" },\n      { \"name\": \"nonce\", \"type\": \"uint256\" },\n      { \"name\": \"deadline\", \"type\": \"uint256\" }\n    ],\n    \"ChainOperation\": [\n      { \"name\": \"domain\", \"type\": \"EIP712ChainDomain\" },\n      { \"name\": \"target\", \"type\": \"address\" },\n      { \"name\": \"value\", \"type\": \"uint256\" },\n      { \"name\": \"data\", \"type\": \"bytes\" }\n    ],\n    \"EIP712ChainDomain\": [\n      { \"name\": \"chainId\", \"type\": \"uint256\" },\n      { \"name\": \"verifyingContract\", \"type\": \"address\" }\n    ]\n  },\n  \"message\": {\n    \"operations\": [\n      { \"domain\": { \"chainId\": 1,    \"verifyingContract\": \"0x…\" }, \"target\": \"0x…\", \"value\": 0, \"data\": \"0x\" },\n      { \"domain\": { \"chainId\": 8453, \"verifyingContract\": \"0x…\" }, \"target\": \"0x…\", \"value\": 0, \"data\": \"0x\" }\n    ],\n    \"nonce\": 7,\n    \"deadline\": 1767225600\n  }\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。エンコーディングやフィールド名は今後変わる可能性があります。\n- 各チェーンはすべての操作のハッシュ（`N × 32` バイト）を受け取ります。仕様では、2〜5 チェーンであれば Merkle proof よりわずかに大きい程度で、完全な透明性を保てると述べています。\n- 特定の `chainId` でドメインを構築するコントラクトは、デフォルトでこれらの署名を拒否します。これは安全側の失敗であり、対応するには意図的に追加する必要があります。\n- リプレイ対策は引き続き重要です。ラッパー構造体に nonce と deadline を含め、各チェーンが自分の `chainId` に一致する操作だけを実行するようにしてください。\n"},"ko":{"lang":"ko","tldr":"도메인에서 chainId를 빼고 체인별 작업(각각 자체 chainId 포함)을 지갑이 전부 표시하는 배열에 나열해, 하나의 EIP-712 서명으로 여러 체인의 작업을 승인할 수 있게 한다.","tags":["signatures","eip-712","crosschain","account-abstraction","erc"],"related":[712,1271,5267],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7964/","markdown":"## 어떤 문제를 해결하나요?\n\n현재의 스마트 계정은 체인마다 별도의 서명이 필요합니다. 세 개의 네트워크에 배포된 DAO에서 투표하거나, 두 체인에 걸친 인텐트를 실행하거나, 같은 계정의 키를 모든 곳에서 교체하려는 사용자는 서명을 계속 반복해야 합니다.\n\n이전 아이디어는 모든 작업의 Merkle root에 서명했지만, 일반 지갑은 Merkle root 안에 무엇이 들어 있는지 보여줄 수 없어서 사용자는 사실상 내용을 보지 못한 채 서명하게 됩니다. ERC-7964는 순수한 [EIP-712](/eip-712/) 타입 데이터만 사용하므로, 이미 타입 데이터를 표시하는 지갑이라면 모든 체인의 모든 작업을 보여줄 수 있습니다.\n\n## 어떻게 동작하나요?\n\n- **`chainId`가 없는 도메인.** 최상위 `EIP712Domain`은 보통 `name`과 `version`만 포함합니다. EIP-712는 `chainId`가 있을 때만 지갑이 체인을 확인하도록 요구하므로, 이를 생략하면 서명이 정당하게 멀티체인이 됩니다.\n- **체인당 하나의 작업.** 메시지는 구조체 배열을 담고, 각 구조체에는 정확히 `chainId`라는 이름의 필드(보통 대상 컨트랙트도)가 있어야 합니다. 따라서 서명자는 승인하는 체인의 집합을 정확히 확인할 수 있습니다.\n- **래퍼 구조체.** 배열은 `CrossChainIntent(ChainOperation[] operations, uint256 nonce, uint256 deadline)` 같은 앱 정의 구조체 안에 들어가며, 타입 해시는 모든 체인에서 동일합니다.\n- **온체인 엔벨로프.** 각 체인은 `abi.encode(header, structsArray, signature)`를 받습니다. `header`에는 9바이트 매직 값 `0x796479647964796479`, `fields` 바이트, 이 체인 작업의 `structIndex`, 도메인을 제공하는 [ERC-5267](/eip-5267/)을 구현한 `application` 주소가 담깁니다. `structsArray`는 모든 작업의 struct hash 목록입니다.\n- **검증.** 컨트랙트는 `structsArray[structIndex]`가 로컬 작업의 해시와 같은지 확인하고, 전체 EIP-712 다이제스트를 재구성한 뒤, ECDSA 또는 [ERC-1271](/eip-1271/)로 서명을 검증합니다.\n\n## 샘플 코드\n\n지갑이 서명하게 될 타입 데이터(두 체인, 서명 하나):\n\n```json\n{\n  \"domain\": { \"name\": \"MyApp\", \"version\": \"1\" },\n  \"primaryType\": \"CrossChainIntent\",\n  \"types\": {\n    \"EIP712Domain\": [\n      { \"name\": \"name\", \"type\": \"string\" },\n      { \"name\": \"version\", \"type\": \"string\" }\n    ],\n    \"CrossChainIntent\": [\n      { \"name\": \"operations\", \"type\": \"ChainOperation[]\" },\n      { \"name\": \"nonce\", \"type\": \"uint256\" },\n      { \"name\": \"deadline\", \"type\": \"uint256\" }\n    ],\n    \"ChainOperation\": [\n      { \"name\": \"domain\", \"type\": \"EIP712ChainDomain\" },\n      { \"name\": \"target\", \"type\": \"address\" },\n      { \"name\": \"value\", \"type\": \"uint256\" },\n      { \"name\": \"data\", \"type\": \"bytes\" }\n    ],\n    \"EIP712ChainDomain\": [\n      { \"name\": \"chainId\", \"type\": \"uint256\" },\n      { \"name\": \"verifyingContract\", \"type\": \"address\" }\n    ]\n  },\n  \"message\": {\n    \"operations\": [\n      { \"domain\": { \"chainId\": 1,    \"verifyingContract\": \"0x…\" }, \"target\": \"0x…\", \"value\": 0, \"data\": \"0x\" },\n      { \"domain\": { \"chainId\": 8453, \"verifyingContract\": \"0x…\" }, \"target\": \"0x…\", \"value\": 0, \"data\": \"0x\" }\n    ],\n    \"nonce\": 7,\n    \"deadline\": 1767225600\n  }\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**이며, 인코딩과 필드 이름은 아직 바뀔 수 있습니다.\n- 각 체인은 모든 작업의 해시(`N × 32` 바이트)를 받습니다. 사양은 2–5개 체인에서는 Merkle proof보다 약간 클 뿐이며 완전한 투명성을 유지한다고 주장합니다.\n- 특정 `chainId`로 도메인을 구성하는 컨트랙트는 기본적으로 이 서명을 거부하며, 이는 안전한 실패 방식입니다. 지원하려면 의도적으로 추가해야 합니다.\n- 리플레이 방지는 여전히 중요합니다. 래퍼 구조체에 nonce와 deadline을 포함하고, 각 체인이 자신의 `chainId`와 일치하는 작업만 실행하도록 하세요.\n"},"zh":{"lang":"zh","tldr":"通过从域中去掉 chainId，并把每条链各自的操作（各带自己的 chainId）列在钱包完整展示的数组中，让一次 EIP-712 签名即可授权多条链上的操作。","tags":["signatures","eip-712","crosschain","account-abstraction","erc"],"related":[712,1271,5267],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7964/","markdown":"## 它解决什么问题？\n\n如今的智能账户在每条链上都需要单独签名。用户想在部署于三个网络的 DAO 中投票、执行涉及两条链的意图，或在所有链上轮换同一账户的密钥，都得一遍又一遍地签名。\n\n早期的方案是对所有操作的 Merkle root 签名，但普通钱包无法显示 Merkle root 里的内容，用户等于是在盲签。ERC-7964 只使用普通的 [EIP-712](/eip-712/) 类型化数据，因此任何已经能显示类型化数据的钱包，都能显示每条链上的每个操作。\n\n## 它如何运作\n\n- **不含 `chainId` 的域。** 顶层 `EIP712Domain` 通常只包含 `name` 和 `version`。EIP-712 只要求钱包在存在 `chainId` 时检查所在链，因此省略它就能让签名合法地跨链。\n- **每条链一个操作。** 消息中包含一个结构体数组，每个结构体都必须有一个名为 `chainId` 的字段（通常还有目标合约）。因此签名者仍能看到并批准确切的链集合。\n- **包装结构体。** 数组位于应用自定义的结构体中，例如 `CrossChainIntent(ChainOperation[] operations, uint256 nonce, uint256 deadline)`，各链上的类型哈希相同。\n- **链上信封。** 每条链收到 `abi.encode(header, structsArray, signature)`。`header` 打包了 9 字节的魔数 `0x796479647964796479`、一个 `fields` 字节、本链操作的 `structIndex`，以及实现 [ERC-5267](/eip-5267/) 以提供域的 `application` 地址。`structsArray` 是所有操作的 struct hash 列表。\n- **验证。** 合约检查 `structsArray[structIndex]` 是否等于本地操作的哈希，重建完整的 EIP-712 摘要，并用 ECDSA 或 [ERC-1271](/eip-1271/) 验证签名。\n\n## 示例代码\n\n钱包将要签名的类型化数据（两条链，一次签名）：\n\n```json\n{\n  \"domain\": { \"name\": \"MyApp\", \"version\": \"1\" },\n  \"primaryType\": \"CrossChainIntent\",\n  \"types\": {\n    \"EIP712Domain\": [\n      { \"name\": \"name\", \"type\": \"string\" },\n      { \"name\": \"version\", \"type\": \"string\" }\n    ],\n    \"CrossChainIntent\": [\n      { \"name\": \"operations\", \"type\": \"ChainOperation[]\" },\n      { \"name\": \"nonce\", \"type\": \"uint256\" },\n      { \"name\": \"deadline\", \"type\": \"uint256\" }\n    ],\n    \"ChainOperation\": [\n      { \"name\": \"domain\", \"type\": \"EIP712ChainDomain\" },\n      { \"name\": \"target\", \"type\": \"address\" },\n      { \"name\": \"value\", \"type\": \"uint256\" },\n      { \"name\": \"data\", \"type\": \"bytes\" }\n    ],\n    \"EIP712ChainDomain\": [\n      { \"name\": \"chainId\", \"type\": \"uint256\" },\n      { \"name\": \"verifyingContract\", \"type\": \"address\" }\n    ]\n  },\n  \"message\": {\n    \"operations\": [\n      { \"domain\": { \"chainId\": 1,    \"verifyingContract\": \"0x…\" }, \"target\": \"0x…\", \"value\": 0, \"data\": \"0x\" },\n      { \"domain\": { \"chainId\": 8453, \"verifyingContract\": \"0x…\" }, \"target\": \"0x…\", \"value\": 0, \"data\": \"0x\" }\n    ],\n    \"nonce\": 7,\n    \"deadline\": 1767225600\n  }\n}\n```\n\n## 需要注意\n\n- 状态为 **Draft**，编码和字段名称仍可能改变。\n- 每条链都会收到所有操作的哈希（`N × 32` 字节）。规范认为，在 2–5 条链的情况下，这只比 Merkle proof 稍大，同时保持了完全透明。\n- 用特定 `chainId` 构建域的合约默认会拒绝这些签名，这是安全的失败方式；要支持它必须有意添加。\n- 重放保护依然重要：在包装结构体中加入 nonce 和 deadline，并确保每条链只执行与自己 `chainId` 匹配的操作。\n"}}}
