{"eip":7965,"title":"Proof-based Broadcast in ERC-7786 Gateways","description":"Cross-chain messaging using cryptographic proofs to verify messages between blockchains.","authors":["Ernesto García (@ernestognw)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2025-06-06","requires":[7786,7930],"discussionsTo":"https://ethereum-magicians.org/t/erc-7965-storage-proof-broadcasting-for-cross-chain-messaging-gateways/24477","repo":"ERCs","label":"ERC-7965","officialUrl":"https://eips.ethereum.org/EIPS/eip-7965","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7965.md","url":"https://eips.huatuo.xyz/eip-7965/","tldr":{"en":"A draft set of ERC-7786 message attributes (route, inclusionProof, targetBlock) and broadcast rules that let cross-chain gateways verify messages with cryptographic proofs of the source chain's state instead of trusting relayers or multisigs.","ja":"ERC-7786 のメッセージ属性（route、inclusionProof、targetBlock）とブロードキャスト規則のドラフト。クロスチェーンゲートウェイが、リレイヤーやマルチシグを信頼する代わりに、送信元チェーンの状態の暗号学的証明でメッセージを検証できるようにする。","ko":"ERC-7786 메시지 속성(route, inclusionProof, targetBlock)과 브로드캐스트 규칙에 대한 초안. 크로스체인 게이트웨이가 릴레이어나 멀티시그를 신뢰하는 대신 소스 체인 상태의 암호학적 증명으로 메시지를 검증할 수 있게 한다.","zh":"ERC-7786 消息属性（route、inclusionProof、targetBlock）及广播规则的草案，让跨链网关可以用源链状态的密码学证明来验证消息，而不必信任中继者或多签。"},"tags":["cross-chain","interoperability","messaging","proofs","erc"],"explainers":{"en":{"lang":"en","tldr":"A draft set of ERC-7786 message attributes (route, inclusionProof, targetBlock) and broadcast rules that let cross-chain gateways verify messages with cryptographic proofs of the source chain's state instead of trusting relayers or multisigs.","tags":["cross-chain","interoperability","messaging","proofs","erc"],"related":[7786,7930,7888,7201],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7965/","markdown":"## What problem does it solve?\n\nMost cross-chain bridges and messaging layers rely on someone to vouch for a message: a validator set, a multisig or an optimistic challenge window. Each adds trust assumptions and a point of failure.\n\nA different approach is to **prove** the message: show, with a storage or event inclusion proof, that it was committed in the source chain's finalized state, and check that proof on the destination against a state commitment the destination already trusts (for example via a shared settlement layer). [ERC-7786](/eip-7786/) gives a common `sendMessage` interface for gateways but does not say how to carry proof data or routing. ERC-7965 fills that gap with standard **attributes**, and also defines finer-grained broadcast targets.\n\n## How it works\n\n**Proof attributes.** Gateways that support them must return `true` from `supportsAttribute` for their selectors:\n\n| Attribute | Meaning |\n| --- | --- |\n| `route((bytes,bytes,uint256)[])` | Verification path from destination back to source. Each hop: address to call, proof for that step, required version (`0` = any). Multi-hop is allowed. |\n| `inclusionProof(bytes)` | Proof that the message exists in the source chain's committed state (e.g. storage or event proof). |\n| `targetBlock(uint256)` | Optional. Source block (or equivalent commitment) the proof refers to, for freshness or finality checks. |\n\n**Verification.** The destination gateway walks the route, verifying each block-hash (or state-commitment) transition with its proof and checking versions. It then uses `inclusionProof` to show the message is in the source state reached at the end of the route, optionally checks `targetBlock`, and delivers the message. Results may be cached.\n\n**Broadcast granularity.** Using [ERC-7930](/eip-7930/) interoperable addresses as the recipient:\n\n- empty address on a given chain: every address on that chain;\n- empty chain reference with a chain type (e.g. `eip155`): every chain of that type;\n- all fields zero: everything the gateway supports.\n\nExisting proof systems such as [ERC-7888](/eip-7888/) broadcasters can expose an ERC-7786 interface using these attributes without changing their core design.\n\n## Sample code\n\nSending a proof-backed broadcast to every address on chain ID 42161 (adapted from the spec):\n\n```solidity\nstruct Hop { bytes gateway; bytes proof; uint256 version; }\n\nHop[] memory hops = new Hop[](1);\nhops[0] = Hop(routeGateway, stepProof, 0); // 0 = any verifier version\n\n// ERC-7930 recipient: eip155 chain 42161, empty address = broadcast\nbytes memory recipient = abi.encodePacked(\n    uint16(1),      // version\n    uint16(0x0000), // chain type: eip155\n    uint8(2),       // chain reference length\n    uint16(42161),  // chain reference\n    uint8(0)        // address length 0 -\u003e all addresses\n);\n\nbytes[] memory attributes = new bytes[](3);\nattributes[0] = abi.encodeWithSignature(\"route((bytes,bytes,uint256)[])\", hops);\nattributes[1] = abi.encodeWithSignature(\"inclusionProof(bytes)\", proofData);\nattributes[2] = abi.encodeWithSignature(\"targetBlock(uint256)\", blockNumber);\n\ngateway.sendMessage(recipient, abi.encode(\"priceUpdate\", asset, price), attributes);\n```\n\n## Things to know\n\n- **Status: Draft.** Attribute names, encoding and semantics may still change.\n- A multi-hop route is only as secure as its weakest hop. Evaluate every verifier in the path.\n- Proofs should only be built against finalized blocks to avoid reorg attacks. Because a proof can attest to a very old message, receivers should apply their own freshness or replay checks unless the gateway commits messages immutably.\n- Broadcast messages can be relayed and executed by anyone, so receivers must validate the source and content themselves.\n- Gateways may store commitments immutably (e.g. using [ERC-7201](/eip-7201/) namespaced storage), but this is not required.\n"},"ja":{"lang":"ja","tldr":"ERC-7786 のメッセージ属性（route、inclusionProof、targetBlock）とブロードキャスト規則のドラフト。クロスチェーンゲートウェイが、リレイヤーやマルチシグを信頼する代わりに、送信元チェーンの状態の暗号学的証明でメッセージを検証できるようにする。","tags":["cross-chain","interoperability","messaging","proofs","erc"],"related":[7786,7930,7888,7201],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7965/","markdown":"## 何を解決するのか\n\n多くのクロスチェーンブリッジやメッセージング層は、メッセージを保証する誰かに依存しています。バリデータセット、マルチシグ、オプティミスティックなチャレンジ期間などです。いずれも信頼の前提と単一障害点を増やします。\n\n別のアプローチは、メッセージを**証明する**ことです。ストレージまたはイベントの包含証明（inclusion proof）で、そのメッセージが送信元チェーンのファイナライズ済み状態にコミットされていることを示し、その証明を宛先チェーンが既に信頼している状態コミットメント（たとえば共有の決済レイヤー経由）に対して検証します。[ERC-7786](/eip-7786/) はゲートウェイ向けの共通 `sendMessage` インターフェースを定めていますが、証明データやルーティングの運び方は定めていません。ERC-7965 は標準の**属性（attributes）**でこの空白を埋め、より細かいブロードキャスト対象も定義します。\n\n## 仕組み\n\n**証明属性。** これらをサポートするゲートウェイは、対応するセレクタについて `supportsAttribute` から `true` を返さなければなりません。\n\n| 属性 | 意味 |\n| --- | --- |\n| `route((bytes,bytes,uint256)[])` | 宛先から送信元へ遡る検証経路。各ホップは、呼び出すアドレス、そのステップの証明、必要なバージョン（`0` = 任意）で構成されます。マルチホップも可能です。 |\n| `inclusionProof(bytes)` | メッセージが送信元チェーンのコミット済み状態に存在することの証明（ストレージ証明やイベント証明など）。 |\n| `targetBlock(uint256)` | 任意。鮮度やファイナリティの確認のために、証明が参照する送信元のブロック（または同等のコミットメント）。 |\n\n**検証。** 宛先ゲートウェイは route をたどり、各ブロックハッシュ（または状態コミットメント）の遷移を証明で検証し、バージョンを確認します。次に `inclusionProof` を使って、route の最後に到達した送信元の状態にメッセージが含まれていることを示し、必要に応じて `targetBlock` を確認したうえで、メッセージを配送します。結果はキャッシュしてもかまいません。\n\n**ブロードキャストの粒度。** 受信者に [ERC-7930](/eip-7930/) の相互運用可能アドレスを使います。\n\n- 特定のチェーン上で空のアドレス: そのチェーン上のすべてのアドレス\n- チェーンタイプ（例: `eip155`）を指定し、チェーン参照が空: そのタイプのすべてのチェーン\n- すべてのフィールドがゼロ: ゲートウェイがサポートするすべて\n\n[ERC-7888](/eip-7888/) のブロードキャスターのような既存の証明システムは、中核の設計を変えずに、これらの属性を使って ERC-7786 インターフェースを公開できます。\n\n## サンプルコード\n\nチェーン ID 42161 上のすべてのアドレスに、証明付きのブロードキャストを送る例（仕様から改変）:\n\n```solidity\nstruct Hop { bytes gateway; bytes proof; uint256 version; }\n\nHop[] memory hops = new Hop[](1);\nhops[0] = Hop(routeGateway, stepProof, 0); // 0 = any verifier version\n\n// ERC-7930 recipient: eip155 chain 42161, empty address = broadcast\nbytes memory recipient = abi.encodePacked(\n    uint16(1),      // version\n    uint16(0x0000), // chain type: eip155\n    uint8(2),       // chain reference length\n    uint16(42161),  // chain reference\n    uint8(0)        // address length 0 -\u003e all addresses\n);\n\nbytes[] memory attributes = new bytes[](3);\nattributes[0] = abi.encodeWithSignature(\"route((bytes,bytes,uint256)[])\", hops);\nattributes[1] = abi.encodeWithSignature(\"inclusionProof(bytes)\", proofData);\nattributes[2] = abi.encodeWithSignature(\"targetBlock(uint256)\", blockNumber);\n\ngateway.sendMessage(recipient, abi.encode(\"priceUpdate\", asset, price), attributes);\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** 属性名、エンコーディング、セマンティクスは今後変わる可能性があります。\n- マルチホップの route の安全性は、最も弱いホップで決まります。経路上のすべての検証者を評価してください。\n- リオーグ攻撃を避けるため、証明はファイナライズ済みのブロックに対してのみ構築すべきです。証明は非常に古いメッセージを証明することもあるため、ゲートウェイがメッセージを不変の形でコミットしていない限り、受信側は独自の鮮度チェックやリプレイチェックを行うべきです。\n- ブロードキャストメッセージは誰でもリレー・実行できるため、受信側は送信元と内容を自分で検証する必要があります。\n- ゲートウェイはコミットメントを不変の形で保存してもかまいません（たとえば [ERC-7201](/eip-7201/) の名前空間付きストレージを使用）が、必須ではありません。\n"},"ko":{"lang":"ko","tldr":"ERC-7786 메시지 속성(route, inclusionProof, targetBlock)과 브로드캐스트 규칙에 대한 초안. 크로스체인 게이트웨이가 릴레이어나 멀티시그를 신뢰하는 대신 소스 체인 상태의 암호학적 증명으로 메시지를 검증할 수 있게 한다.","tags":["cross-chain","interoperability","messaging","proofs","erc"],"related":[7786,7930,7888,7201],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7965/","markdown":"## 어떤 문제를 해결하나요?\n\n대부분의 크로스체인 브릿지와 메시징 계층은 메시지를 보증해 줄 누군가에게 의존합니다. 검증자 집합, 멀티시그, 낙관적 챌린지 기간 같은 것들입니다. 각각 신뢰 가정과 단일 장애 지점을 늘립니다.\n\n다른 접근은 메시지를 **증명**하는 것입니다. 스토리지 또는 이벤트 포함 증명(inclusion proof)으로 메시지가 소스 체인의 최종 확정된 상태에 커밋되었음을 보이고, 그 증명을 대상 체인이 이미 신뢰하는 상태 커밋먼트(예: 공유 정산 계층을 통해)에 대해 검증합니다. [ERC-7786](/eip-7786/)은 게이트웨이를 위한 공통 `sendMessage` 인터페이스를 제공하지만, 증명 데이터나 라우팅을 어떻게 실을지는 정하지 않습니다. ERC-7965는 표준 **속성(attributes)**으로 이 빈틈을 메우고, 더 세밀한 브로드캐스트 대상도 정의합니다.\n\n## 어떻게 동작하나요?\n\n**증명 속성.** 이 속성을 지원하는 게이트웨이는 해당 셀렉터에 대해 `supportsAttribute`에서 `true`를 반환해야 합니다.\n\n| 속성 | 의미 |\n| --- | --- |\n| `route((bytes,bytes,uint256)[])` | 대상 체인에서 소스 체인까지 거슬러 올라가는 검증 경로. 각 홉은 호출할 주소, 해당 단계의 증명, 필요한 버전(`0` = 아무 버전)으로 구성됩니다. 멀티 홉도 허용됩니다. |\n| `inclusionProof(bytes)` | 메시지가 소스 체인의 커밋된 상태에 존재함을 보이는 증명(예: 스토리지 증명 또는 이벤트 증명). |\n| `targetBlock(uint256)` | 선택 사항. 신선도나 최종성 확인을 위해 증명이 가리키는 소스 블록(또는 이에 상응하는 커밋먼트). |\n\n**검증.** 대상 체인 게이트웨이는 route를 따라가며 각 블록 해시(또는 상태 커밋먼트)의 전환을 증명으로 검증하고 버전을 확인합니다. 그런 다음 `inclusionProof`로 메시지가 route 끝에 도달한 소스 상태에 들어 있음을 확인하고, 필요하면 `targetBlock`도 확인한 뒤 메시지를 전달합니다. 결과는 캐시할 수 있습니다.\n\n**브로드캐스트 세분화.** 수신자로 [ERC-7930](/eip-7930/) 상호운용 주소를 사용합니다.\n\n- 특정 체인의 빈 주소: 해당 체인의 모든 주소\n- 체인 타입(예: `eip155`)은 있고 체인 참조가 비어 있음: 해당 타입의 모든 체인\n- 모든 필드가 0: 게이트웨이가 지원하는 모든 것\n\n[ERC-7888](/eip-7888/) 브로드캐스터 같은 기존 증명 시스템은 핵심 설계를 바꾸지 않고 이 속성들을 사용해 ERC-7786 인터페이스를 제공할 수 있습니다.\n\n## 샘플 코드\n\n체인 ID 42161의 모든 주소에 증명이 포함된 브로드캐스트를 보내는 예(스펙에서 발췌·수정):\n\n```solidity\nstruct Hop { bytes gateway; bytes proof; uint256 version; }\n\nHop[] memory hops = new Hop[](1);\nhops[0] = Hop(routeGateway, stepProof, 0); // 0 = any verifier version\n\n// ERC-7930 recipient: eip155 chain 42161, empty address = broadcast\nbytes memory recipient = abi.encodePacked(\n    uint16(1),      // version\n    uint16(0x0000), // chain type: eip155\n    uint8(2),       // chain reference length\n    uint16(42161),  // chain reference\n    uint8(0)        // address length 0 -\u003e all addresses\n);\n\nbytes[] memory attributes = new bytes[](3);\nattributes[0] = abi.encodeWithSignature(\"route((bytes,bytes,uint256)[])\", hops);\nattributes[1] = abi.encodeWithSignature(\"inclusionProof(bytes)\", proofData);\nattributes[2] = abi.encodeWithSignature(\"targetBlock(uint256)\", blockNumber);\n\ngateway.sendMessage(recipient, abi.encode(\"priceUpdate\", asset, price), attributes);\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 속성 이름, 인코딩, 의미는 아직 바뀔 수 있습니다.\n- 멀티 홉 route는 가장 약한 홉만큼만 안전합니다. 경로상의 모든 검증자를 평가하세요.\n- 리오그 공격을 피하려면 증명은 최종 확정된 블록에 대해서만 만들어야 합니다. 증명은 아주 오래된 메시지도 증명할 수 있으므로, 게이트웨이가 메시지를 불변 방식으로 커밋하지 않는 한 수신자는 자체적으로 신선도 또는 리플레이 검사를 해야 합니다.\n- 브로드캐스트 메시지는 누구나 릴레이하고 실행할 수 있으므로, 수신자는 출처와 내용을 직접 검증해야 합니다.\n- 게이트웨이는 커밋먼트를 불변 방식으로 저장할 수 있지만(예: [ERC-7201](/eip-7201/) 네임스페이스 스토리지 사용), 필수는 아닙니다.\n"},"zh":{"lang":"zh","tldr":"ERC-7786 消息属性（route、inclusionProof、targetBlock）及广播规则的草案，让跨链网关可以用源链状态的密码学证明来验证消息，而不必信任中继者或多签。","tags":["cross-chain","interoperability","messaging","proofs","erc"],"related":[7786,7930,7888,7201],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7965/","markdown":"## 它解决什么问题？\n\n大多数跨链桥和消息层都依赖某个角色为消息担保：验证者集合、多签或乐观质疑窗口。每一种都会增加信任假设和单点故障。\n\n另一种思路是**证明**消息：用存储或事件的包含证明（inclusion proof）表明该消息已被提交到源链的最终化状态中，并在目标链上对照目标链已经信任的状态承诺（例如通过共享的结算层）来检查这个证明。[ERC-7786](/eip-7786/) 为网关提供了通用的 `sendMessage` 接口，但没有规定如何携带证明数据或路由信息。ERC-7965 用标准的**属性（attributes）**填补了这一空白，同时还定义了粒度更细的广播目标。\n\n## 它如何运作\n\n**证明属性。** 支持这些属性的网关，必须就其选择器从 `supportsAttribute` 返回 `true`：\n\n| 属性 | 含义 |\n| --- | --- |\n| `route((bytes,bytes,uint256)[])` | 从目标链回溯到源链的验证路径。每一跳包含：要调用的地址、该步骤的证明、所需版本（`0` = 任意）。允许多跳。 |\n| `inclusionProof(bytes)` | 证明消息存在于源链已提交状态中（例如存储证明或事件证明）。 |\n| `targetBlock(uint256)` | 可选。证明所指的源链区块（或等价的承诺），用于新鲜度或最终性检查。 |\n\n**验证。** 目标链网关沿着 route 逐跳验证每一次区块哈希（或状态承诺）的转换，并检查版本。然后用 `inclusionProof` 证明消息位于 route 终点所到达的源链状态中，按需检查 `targetBlock`，最后投递消息。结果可以缓存。\n\n**广播粒度。** 使用 [ERC-7930](/eip-7930/) 互操作地址作为接收方：\n\n- 某条链上的空地址：该链上的所有地址；\n- 指定链类型（例如 `eip155`）但链引用为空：该类型的所有链；\n- 所有字段为零：网关支持的一切。\n\n诸如 [ERC-7888](/eip-7888/) broadcaster 之类的现有证明系统，可以利用这些属性暴露 ERC-7786 接口，而无需改动其核心设计。\n\n## 示例代码\n\n向链 ID 42161 上的所有地址发送带证明的广播（改编自规范）：\n\n```solidity\nstruct Hop { bytes gateway; bytes proof; uint256 version; }\n\nHop[] memory hops = new Hop[](1);\nhops[0] = Hop(routeGateway, stepProof, 0); // 0 = any verifier version\n\n// ERC-7930 recipient: eip155 chain 42161, empty address = broadcast\nbytes memory recipient = abi.encodePacked(\n    uint16(1),      // version\n    uint16(0x0000), // chain type: eip155\n    uint8(2),       // chain reference length\n    uint16(42161),  // chain reference\n    uint8(0)        // address length 0 -\u003e all addresses\n);\n\nbytes[] memory attributes = new bytes[](3);\nattributes[0] = abi.encodeWithSignature(\"route((bytes,bytes,uint256)[])\", hops);\nattributes[1] = abi.encodeWithSignature(\"inclusionProof(bytes)\", proofData);\nattributes[2] = abi.encodeWithSignature(\"targetBlock(uint256)\", blockNumber);\n\ngateway.sendMessage(recipient, abi.encode(\"priceUpdate\", asset, price), attributes);\n```\n\n## 需要注意\n\n- **状态：Draft。** 属性名称、编码和语义仍可能变化。\n- 多跳 route 的安全性取决于其中最薄弱的一跳。请评估路径上的每一个验证者。\n- 为避免重组攻击，证明只应针对已最终化的区块构建。由于证明可以证明非常久远的消息，除非网关以不可变方式提交消息，否则接收方应自行做新鲜度或重放检查。\n- 广播消息可以被任何人中继和执行，因此接收方必须自行验证来源和内容。\n- 网关可以以不可变方式存储承诺（例如使用 [ERC-7201](/eip-7201/) 命名空间存储），但这不是必需的。\n"}}}
