Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines cryptographic verification of cross-chain messages under ERC7965.

ERC7965 proposes verification attributes for ERC7786 cross-chain messaging that allow message authenticity to be established using the chains' consensus mechanisms and cryptographic proofs instead of relying on a separate validator committee.

This article explains the proposal below.

I have also covered a range of EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

ERC7965 proposes adding cryptographic proof attributes to the ERC7786 cross-chain messaging gateway.

For more on ERC7786, see the following article.

[ERC7786] Standardizing cross-chain messaging

Cross-chain messaging requires a way to verify whether a message was actually sent from the source chain. Many existing protocols rely on external validators or multisignature arrangements to establish message validity. If those validators are compromised or cease operating, however, the entire cross-chain messaging system may stop functioning.

ERC7965 addresses this problem using cryptographic proofs. By directly verifying source-chain state or transaction history using mechanisms such as storage proofs, it can eliminate the need to trust a separate intermediary. In other words, message validity can be established using the chains' consensus mechanisms and cryptographic commitments, subject to the assumptions of the proof system.

The proposal also standardizes broadcasting mechanisms for specifying message destinations flexibly. Three broadcast scopes allow applications to send messages to all addresses on a particular chain, all chains of a particular type, or all supported chains and addresses. This enables different delivery patterns for oracle price feeds, governance notifications, and emergency pause instructions.

Motivation

Dependence on external validators

Many existing cross-chain messaging protocols rely on external validators, multisignature arrangements (signatures from multiple keys), or optimistic mechanisms that presume validity unless a challenge is submitted within a specified period.

These approaches share a potential limitation. When message verification depends on trusted parties external to the chain, compromise or interruption of those parties can disrupt cross-chain communications. A majority of validators acting in collusion may also be able to approve an invalid message as legitimate, depending on the protocol.

Cryptographic proofs allow verification to rely directly on the chains' consensus mechanisms and commitments, such as block hashes and storage roots. Removing the need for separate trusted validators can reduce points of failure and improve security.

Limited broadcast granularity

ERC7786 defines a broadcast mechanism in which the recipient address is omitted or zero. The existing mechanism does not distinguish the three broadcast scopes proposed here.

Actual use cases may require finer-grained control. For example, an oracle may want to send a price feed only to a particular chain. Governance voting results may be relevant to all EVM-compatible chains but unnecessary for non-EVM chains. An emergency pause instruction may need to reach every supported chain.

The proposed solution

ERC7965 addresses these challenges through the following features.

  • Cryptographic proof verification Proving chain state or transaction history directly can establish message validity without a separate validator committee.
  • Hierarchical broadcast scopes Using the ERC7930 interoperable address structure, destinations can be specified at the address, chain-type, or universal level.
  • Multi-hop routing Chains without a direct verification relationship can establish a verification path through intermediate chains.
  • Compatibility with existing infrastructure Existing ERC7786 tools and infrastructure can retain the same basic interface. Extending the attribute system avoids the need to define an entirely new messaging interface.
  • Interoperability between proof systems The mechanism can operate between chains with verifiable state relationships, such as shared settlement infrastructure or compatible proof systems.

Specification

Broadcasting

Broadcasting in ERC7965 uses the interoperable address structure defined by ERC7930.

For more on ERC7930, see the proposal below.

https://eips.ethereum.org/EIPS/eip-7930 An ERC7930 address includes a chain type, a chain reference, and an address. Broadcast patterns use zero-valued fields or zero-length components to indicate a wider destination scope.

Three broadcast patterns are defined.

Pattern ChainType ChainReference Address Example use case
Address broadcast Specified Specified Length 0 Distribute a price feed to all addresses on Arbitrum One
Chain-type broadcast Specified Length 0 Length 0 Send governance notifications to all EVM-compatible chains
Universal broadcast 0 Length 0 Length 0 Send an emergency pause instruction to all supported chains and addresses

The following diagram compares the scope of the three broadcast patterns.

Comparison of broadcast patterns

The broadcast scope expands from left to right. The destination scope depends on which fields of the ERC7930 address are zero or empty.

Address broadcast

This pattern sends a message to all addresses on a particular chain. Specify ChainType and ChainReference, and set AddressLength to 0.

For example, to target all addresses on Arbitrum One (chain ID 42161), use the chain type corresponding to eip155, set the chain reference to 42161, and leave the address component empty. An oracle could use this pattern to distribute price information to contracts on a particular chain.

Chain-type broadcast

This pattern sends a message to all chains of a particular type. Specify ChainType and set both ChainReferenceLength and AddressLength to 0.

For example, the chain type corresponding to eip155 targets the EVM-compatible chains covered by that namespace. This is useful for notifying EVM-compatible chains of the outcome of a governance proposal.

Universal broadcast

Setting the destination fields to their universal or empty values targets all supported chains and addresses. This corresponds to the basic broadcast behavior described for ERC7786. It can be used for messages that need to reach all participating infrastructure, such as emergency pause instructions.

Recipients of broadcast messages must verify the sender and message contents according to their own security requirements.

Cryptographic proof attributes

ERC7965 defines three cryptographic proof attributes using the ERC7786 attribute system. A gateway responsible for relaying messages must return true from supportsAttribute for attributes it supports.

Attribute Required or optional Purpose
route Required Specifies the verification path, including multi-hop routes
inclusionProof Required Proves that the message is included in source-chain state
targetBlock Optional Identifies the block in which the message was committed

route

javascript
abi.encodeWithSignature("route((bytes,bytes,uint256)[])", hops);

This attribute represents the verification path. An array of tuples specifies the path from the destination chain to the source chain.

Each tuple contains the following three fields.

Field Type Description
gateway bytes Address to call when verifying the next chain's state. The address is encoded as bytes and may invoke another gateway to forward the message to the next hop.
proof bytes Cryptographic proof data required for that verification step
version uint256 Version of the verification logic. A value of 0 accepts any version.

If version is nonzero, the gateway must reject the message unless the route address supports the exact requested version.

The route must form a valid path. Each step must represent a relationship that permits direct verification of state or transactions between chains. Gateways reject messages containing invalid or incomplete proof data.

inclusionProof

javascript
abi.encodeWithSignature("inclusionProof(bytes)", proofData);

A cryptographic proof establishing that a particular message exists in a finalized block or transaction on the source chain.

Finality

Finality is the condition in which a blockchain block is considered settled and irreversible under its consensus assumptions. Constructing proofs against finalized block state reduces the risk that a chain reorganization (reorg) invalidates the proof.

On EVM chains, this can be implemented through event inclusion proofs or storage proofs. An event inclusion proof establishes that a particular event appears in a transaction receipt included in the committed receipts structure, using an appropriate Merkle proof. A storage proof uses a Merkle Patricia Trie to establish that a particular value is stored in a specified contract storage slot.

The receiving ERC7786 receiver must verify the proof according to the source chain's proof system.

targetBlock

javascript
abi.encodeWithSignature("targetBlock(uint256)", blockNumber);

An optional attribute specifying the source-chain block number or height at which the message was committed. For chains that do not use sequential block numbers, it represents an equivalent commitment identifier.

Recipients can use this attribute to check message freshness and finality requirements. However, it may be unnecessary for some use cases and can be ignored where appropriate.

When provided, the attribute must correspond to the block whose state is established by the cryptographic proof.

Verification process

Message verification proceeds through the following steps.

flowchart TD
    A[メッセージ受信] --> B[属性のパース]
    B --> C{必須属性が揃っているか}
    C -->|No| D[メッセージ拒否]
    C -->|Yes| E[ルート検証]
    E --> F{各ホップの証明が有効か}
    F -->|No| D
    F -->|Yes| G[inclusionProof検証]
    G --> H{メッセージが送信元のステートに存在するか}
    H -->|No| D
    H -->|Yes| I{targetBlockの検証}
    I -->|失敗| D
    I -->|成功/スキップ| J[メッセージ実行]

The procedure is as follows.

  1. Parse the route and inclusionProof attributes from the message, along with targetBlock if provided.
  2. Check that all required attributes are present and correctly formatted.
  3. For every route step, use the corresponding proof to verify the block hash transition or equivalent state commitment. Verify the version as well if a nonzero version requirement is specified.
  4. Use inclusionProof to verify that the message data existed in the committed source-chain state at the target block established by route verification. The source chain must correspond to the chain verified by the final step of the route.
  5. If targetBlock is provided and the recipient chooses to check it, verify that freshness and finality requirements are satisfied.
  6. Execute the message if all required checks pass.

Multi-hop routing

Even without a direct verification relationship between chains, message authenticity can be established through intermediate chains. This is known as multi-hop routing.

sequenceDiagram
    participant D as 宛先チェーン
    participant M as 中継チェーン
    participant S as 送信元チェーン

    Note over S: メッセージをコミット
    Note over D: 検証を開始(宛先→送信元の方向)
    D->>M: ホップ1で中継チェーンのステートを検証
    D->>S: ホップ2で送信元チェーンのステートを検証
    Note over D: 両方の証明が有効なら<br/>メッセージを実行

Verification follows the route in order, from the destination chain toward the source chain. The first hop verifies the intermediate chain nearest the destination; the final hop verifies the source chain's state.

The following diagram illustrates the complete multi-hop verification flow.

Multi-hop verification flow

For example, if no direct state verification mechanism exists between the source and destination chains, an intermediate chain with verification relationships to both can enable the message to be verified in two hops.

Each hop represents a relationship in which the relevant chain state can be verified using the preceding step. The complete route establishes a chain of verification that ultimately authenticates the source-chain state. This mechanism resembles the BlockHashProver chain concept described in ERC7888.

For more on ERC7888, see the proposal below.

Multi-hop security

The security of a multi-hop route is limited by the weakest proof or verification assumption along the path. When multiple route steps are used, overall security depends on the step with the weakest cryptographic guarantees or the least secure consensus mechanism.

In other words, even if two of three hops are highly secure, a weaker third hop limits the security of the entire route. Each hop's security must be evaluated carefully when designing a route.

Caching and immutability

Caching

Cryptographic proof verification is deterministic (the same inputs produce the same result), making it possible to cache results when all relevant verification parameters remain unchanged. Caching can substantially improve performance when verification is repeated, as with broadcast messages.

Gateways should cache both verified block hash transitions and proof verification results, invalidating the cache when the proof infrastructure changes.

Immutability of message commitments

Gateways may choose to commit messages in a way that prevents subsequent removal or modification. This provides an immutability guarantee.

Immutability matters because, if a committed message can subsequently be deleted, a proof against an earlier state may remain valid after deletion. A sender could prove that a message had been sent even though it was no longer present in the current source-chain state.

For EVM chains, storing immutable data in a namespaced storage slot using ERC7201 is recommended.

Additional considerations

Relationship to existing proof protocols

ERC7965 provides standard attributes that enable existing proof protocols to implement an ERC7786 gateway.

For example, a broadcaster using ERC7888, an EVM storage proof protocol, can expose the ERC7786 interface while retaining its existing storage proof architecture. Instead of rebuilding verification logic from scratch, implementers can reuse existing proof systems through ERC7965 attributes.

Other proof systems, including those based on zero-knowledge proofs, can use the same attributes to implement their own proof mechanisms.

Rationale for the attribute design

Several deliberate choices underpin the ERC7965 attribute design.

The route attribute uses an array of tuples to keep the route information type-safe while allowing proof verification and chain state transitions to be optimized independently.

The targetBlock attribute is optional to preserve implementation flexibility. Basic verification only requires route and inclusionProof; not every use case requires freshness checks through targetBlock. For gateways that provide immutable message commitments, a valid proof may be sufficient even if the message is old.

Compatibility

Backwards compatibility with ERC7786

ERC7965 extends the ERC7786 attribute system without changing the underlying interface. Gateways that do not support cryptographic proof attributes reject messages containing those attributes. This is expected behavior for unsupported functionality and does not change the handling of existing messages.

Existing ERC7786 tools and infrastructure can continue using the same basic interface; support for the new proof attributes still depends on the relevant gateway and tooling.

Security considerations

Validation requirements

Gateways must strictly verify all proof data to prevent message forgery. Verification must cover proof formatting, completeness, and cryptographic validity.

Route addresses must correspond to legitimate proof infrastructure forming a valid, connected path between chains. Only finalized blocks or equivalent commitment points should be used to construct proofs. Proofs based on unfinalized blocks may become invalid following a chain reorganization.

Consumers of cryptographically proven messages should implement appropriate freshness checks. Proofs can establish that a message existed at an arbitrary historical block or commitment point, so proofs of very old messages may still be valid. However, this restriction is not necessarily required for gateways that provide immutable message commitments.

Broadcast message security

Because broadcast messages can be executed by anyone, recipients must strictly verify the message's origin and content. Both the sender's authorization and the semantic validity of the message must be checked.

For example, a recipient of an emergency pause broadcast must verify that the instruction came from an authorized address. Otherwise, a malicious third party could issue a false pause instruction and disrupt a legitimate service.

Reference implementation

The Hop struct

javascript
struct Hop {
    bytes gateway;
    bytes proof;
    uint256 version;
}

Hop represents one verification step in a multi-hop route. The gateway field contains the address of the gateway called to verify the next chain's state. This address may call another gateway to forward the message to the next hop. The proof field holds the cryptographic proof data for the hop, while version specifies the required verification logic version. Setting version to 0 allows verification without a version restriction.

Preparing a route

javascript
// ルートの準備(証明とバージョン要件を含む)
Hop[] memory hops = new Hop[](2);
hops[0] = Hop(gateway1, proof1, 1); // バージョン1を要求
hops[1] = Hop(gateway2, proof2, 0); // バージョン制限なし

This example constructs a two-hop route. The first hop requires version 1 of the verification logic, while the second accepts any version.

Broadcast pattern examples

The following examples illustrate how to construct ERC7930 addresses for the three broadcast patterns.

Address broadcast
javascript
// Arbitrum One(42161)上の全アドレスに送信
bytes memory addressBroadcast = abi.encodePacked(
    uint16(1),        // Version
    uint16(0x0000),   // ChainType: eip155(EVMチェーン)
    uint8(2),         // ChainReferenceLength: 2バイト
    uint16(42161),    // ChainReference: Arbitrum One
    uint8(0)          // AddressLength: 0(全アドレスへブロードキャスト)
);

Specify the target chain using ChainType and ChainReference, and set AddressLength to 0 to broadcast to all addresses on that chain.

Chain-type broadcast
javascript
// すべてのEIP-155チェーン(EVM互換チェーン全体)に送信
bytes memory chainTypeBroadcast = abi.encodePacked(
    uint16(1),        // Version
    uint16(0x0000),   // ChainType: eip155
    uint8(0),         // ChainReferenceLength: 0(全チェーンへブロードキャスト)
    uint8(0)          // AddressLength: 0(全アドレス)
);

Specify the chain type and set ChainReferenceLength to 0 to target all chains of that type. Note that the original code examples below use identical bytes for chain-type and universal broadcasts, so the assigned chain-type identifier must be verified before using them.

Universal broadcast
javascript
// 対応するすべてのチェーンとアドレスに送信
bytes memory universalBroadcast = abi.encodePacked(
    uint16(1),        // Version
    uint16(0x0000),   // ChainType: 0(全チェーンタイプ)
    uint8(0),         // ChainReferenceLength: 0(全チェーン)
    uint8(0)          // AddressLength: 0(全アドレス)
);

The universal destination targets all supported chains and addresses.

Sending messages

javascript
bytes[] memory attributes = new bytes[](3);
attributes[0] = abi.encodeWithSignature("route((bytes,bytes,uint256)[])", hops);
attributes[1] = abi.encodeWithSignature("inclusionProof(bytes)", proofData);
attributes[2] = abi.encodeWithSignature("targetBlock(uint256)", blockNumber);

// アドレスブロードキャストでメッセージ送信
gateway.sendMessage(
    addressBroadcast,
    abi.encode("priceUpdate", asset, price),
    attributes
);

// チェーンタイプブロードキャストでメッセージ送信
gateway.sendMessage(
    chainTypeBroadcast,
    abi.encode("governanceProposal", proposalId, votingPeriod),
    attributes
);

// ユニバーサルブロードキャストでメッセージ送信
gateway.sendMessage(
    universalBroadcast,
    abi.encode("pause", reason),
    attributes
);

Collect the attributes in an array and pass them to sendMessage. The payload contains the message body, such as a price update, governance proposal, or emergency pause instruction, while attributes contains the proof metadata.

References

Conclusion

This article covered cryptographic proof verification and broadcasting for cross-chain messages under ERC7965. I hope you found it useful.

If you have any questions, feel free to contact me via Twitter DM.

Twitter @cardene777

I also publish on other platforms, which you can find below.