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.

ERC-7985 defines standard attributes for cancellation, timeouts, retries, dependencies, and delivery control in cross-chain messaging.

This article translates, summarizes, and expands on the following proposal.

More EIP, BIP, SLIP, CAIP, ENSIP, RFC, and ACP explainers:

Overview

ERC-7985 defines attributes for ERC-7786 cross-chain messaging gateways, allowing applications to express requirements concerning message lifecycles, ordering, and delivery.

For ERC-7786, see the following article.

ERC-7786: Standardizing cross-chain messaging

Key features

Feature Description
Cancellation Allows pending messages to be canceled after submission.
Timeouts Sets a delivery deadline to prevent indefinite eligibility for delivery.
Retry policy Standardizes retry behavior after delivery failures.
Dependencies Expresses ordering requirements between messages.
Gas control Specifies minimum delivery gas requirements.
Delivery timing Defines an eligible delivery time window.

ERC-7786 introduces an extensible attribute system for cross-chain messaging. ERC-7985 builds on that system by defining specific message-control attributes.

Motivation

ERC-7786 introduced an extensible attribute mechanism while leaving the definition of individual attributes to subsequent specifications.

As cross-chain applications become more complex, they increasingly need consistent ways to control message delivery.

Why standardization is necessary

Requirement Description
Cancellation Cancel pending messages when conditions change.
Timeouts Prevent delivery after an applicable deadline.
Retry logic Improve reliability through consistent failure-handling policies.
Revert behavior Provide consistent error-handling semantics across gateways.
Dependencies Enforce required ordering between related messages.
Gas requirements Reduce failures caused by insufficient delivery gas.
Delivery timing Coordinate and schedule eligible delivery times.

Without standardized attributes, gateways may implement these features differently, requiring application-specific integration logic and fragmenting the ecosystem.

Specification

The proposal defines standard attributes for ERC-7786 cross-chain messaging gateways. Delivery refers to the process of delivering a message on its destination chain, consistent with ERC-7786 terminology.

Gateways may implement attributes independently. They must validate the encoding of supported attributes and revert when an applicable encoding is invalid.

The following tables and code excerpts reflect the proposal version discussed in the original February 2026 article.

Attributes

Attribute Selector Description
cancellable(bool) 0xde986d7f Whether a message can be canceled.
deliverBefore(uint256) 0x3e97d7ee Delivery deadline.
deliverAfter(uint256) 0x745910eb Earliest delivery timestamp.
retryPolicy(bytes) 0xf002c055 Retry behavior.
revertBehavior(uint8) 0x9e521a77 Handling failed delivery attempts.
dependsOn(bytes32[]) 0xa9fed7b9 Message dependencies.
minGasLimit(uint256) 0x39f87ba1 Minimum delivery gas requirement.

cancellable(bool)

javascript
// セレクタ: 0xde986d7f = keccak256("cancellable(bool)")の先頭4バイト
bytes4 constant CANCELLABLE_SELECTOR = 0xde986d7f;

Indicates whether a message may be canceled after submission.

Encoding

The attribute value is an ABI-encoded Boolean. The default is false.

Behavior

When true, the gateway must provide a cancellation mechanism allowing the application to cancel a pending message if its requirements or circumstances change.

Cancellation does not reverse a message that has already been successfully delivered. Implementations must account for races between cancellation and delivery across chains.

deliverBefore(uint256)

javascript
// セレクタ: 0x3e97d7ee = keccak256("deliverBefore(uint256)")の先頭4バイト
bytes4 constant DELIVER_BEFORE_SELECTOR = 0x3e97d7ee;

Specifies a deadline beyond which delivery is prohibited.

Encoding

An ABI-encoded Unix timestamp. The default is zero.

Behavior

A nonzero value establishes the applicable delivery deadline. Zero indicates that no deadline is specified.

The exact timestamp-boundary comparison must follow the applicable specification.

deliverAfter(uint256)

javascript
// セレクタ: 0x745910eb = keccak256("deliverAfter(uint256)")の先頭4バイト
bytes4 constant DELIVER_AFTER_SELECTOR = 0x745910eb;

Specifies the earliest eligible delivery time.

Encoding

An ABI-encoded Unix timestamp. The default is zero.

Behavior

When a nonzero value is supplied, the gateway must not deliver the message before the specified time. Zero indicates that no additional delay is requested.

Combining deliverAfter and deliverBefore creates a delivery time window.

gantt
    title 配信時間ウィンドウの例
    dateFormat X
    axisFormat %H:%M

    section メッセージ
    配信不可 :done, 0, 100
    配信可能ウィンドウ :active, 100, 200
    配信不可(期限切れ) :crit, 200, 300

The original diagram retains its Japanese labels. It illustrates a message that cannot be delivered before the opening of its window, becomes eligible during that window, and expires afterward.

Eligibility does not guarantee delivery within the window.

retryPolicy(bytes)

javascript
// セレクタ: 0xf002c055 = keccak256("retryPolicy(bytes)")の先頭4バイト
bytes4 constant RETRY_POLICY_SELECTOR = 0xf002c055;

Defines retry behavior following failed delivery attempts.

Encoding

Retry parameters are encoded using abi.encodePacked(uint16(maxRetries), uint32(retryDelay), uint32(backoffMultiplier)).

Parameter Type Description
maxRetries uint16 Maximum number of retries.
retryDelay uint32 Initial delay between attempts, in seconds.
backoffMultiplier uint32 Exponential-backoff multiplier in basis points; 10,000 represents 1x.
Default value

The default is an empty byte string, 0x. The original article describes this as permitting unlimited retries without a delay or backoff.

The original text also describes an explicitly encoded maxRetries value of zero as disabling retries, while equating the empty default with a tuple containing zero for every parameter. These descriptions should not be treated as interchangeable without checking the applicable proposal and gateway implementation.

Example retry intervals

With a multiplier of 20,000 (2x) and an initial delay of 10 seconds:

Retry Delay
First 10 seconds
Second 20 seconds
Third 40 seconds
Fourth 80 seconds

revertBehavior(uint8)

javascript
// セレクタ: 0x9e521a77 = keccak256("revertBehavior(uint8)")の先頭4バイト
bytes4 constant REVERT_BEHAVIOR_SELECTOR = 0x9e521a77;

Specifies how a failed delivery attempt is handled.

Encoding

An ABI-encoded uint8 with the following values.

Value Name Behavior
0 Revert on Failure Revert the delivery operation and propagate the original failure reason.
1 Emit-and-Continue Emit MessageFailed(bytes32 sendId, string reason) and continue subsequent operations.
2 Silent Failure Do not revert or emit a failure-related event.
Default value

The default is zero (Revert on Failure).

Behavior of each mode
flowchart TD
    A[メッセージ配信] --> B{配信成功?}
    B -->|成功| C[処理完了]
    B -->|失敗| D{revertBehavior}

    D -->|0: Revert| E[トランザクションリバート]
    E --> F[元のエラー理由を伝播]

    D -->|1: Emit-and-Continue| G[MessageFailedイベント発行]
    G --> H[後続処理を継続]

    D -->|2: Silent| I[何もしない]
    I --> H

The original diagram illustrates the three failure-handling paths.

Revert on Failure rolls back the applicable destination-chain execution. It does not automatically reverse an earlier transaction on the source chain.

Emit-and-Continue records the failure while allowing subsequent operations to proceed, which can be useful in batch processing.

Silent Failure suppresses the specified error-reporting behavior and should only be used where the application can safely tolerate an unsuccessful delivery. It must not be interpreted as successful message execution.

dependsOn(bytes32[])

javascript
// セレクタ: 0xa9fed7b9 = keccak256("dependsOn(bytes32[])")の先頭4バイト
bytes4 constant DEPENDS_ON_SELECTOR = 0xa9fed7b9;

Specifies messages that must be successfully delivered before the current message is eligible for delivery.

Encoding

An ABI-encoded array of message identifiers.

Behavior

The gateway must not deliver the dependent message until all specified prerequisite messages have been successfully delivered.

An omitted or empty array indicates that there are no dependencies.

Example
graph LR
    A[メッセージA] --> C[メッセージC]
    B[メッセージB] --> C
    C --> D[メッセージD]

In this example, message C depends on both A and B. Message D depends on C. The gateway must therefore complete delivery of both A and B before C, and complete C before D.

minGasLimit(uint256)

javascript
// セレクタ: 0x39f87ba1 = keccak256("minGasLimit(uint256)")の先頭4バイト
bytes4 constant MIN_GAS_LIMIT_SELECTOR = 0x39f87ba1;

Specifies the minimum amount of gas required for a delivery attempt.

Encoding

An ABI-encoded uint256 representing the required minimum gas.

Behavior

Before attempting delivery, the gateway must ensure that at least the required amount of gas is available for the relevant execution.

When the attribute is absent, the gateway may apply its default gas-allocation strategy.

A minimum gas allocation reduces the risk of insufficient gas but does not guarantee successful execution. The recipient can still revert for other reasons.

Rationale

Design considerations

These attributes address common message-control requirements.

Category Attributes Purpose
Lifecycle control cancellable, deliverBefore Cancellation and expiration.
Delivery timing deliverAfter, deliverBefore Define eligible delivery windows.
Failure handling retryPolicy, revertBehavior Configure retries and error handling.
Message ordering dependsOn Express prerequisite delivery relationships.
Delivery resources minGasLimit Express minimum execution gas requirements.

Byte encoding for retry policies

The retry policy uses compact byte encoding to represent multiple parameters within one attribute.

Using abi.encodePacked reduces encoding size. Implementations must agree on the fixed field widths and validate the payload before decoding it.

Dependency design

Explicit dependencies support workflows involving several related messages while remaining optional for independent messages.

An empty or omitted dependency list allows simple use cases without additional configuration.

Backward compatibility

The proposal extends the ERC-7786 attribute mechanism without replacing the underlying interface.

Gateways that do not implement these attributes must handle unsupported attributes according to ERC-7786. Applications should check gateway support before relying on a particular control attribute and must not assume that unsupported requirements can safely be ignored.

Security

Detecting circular dependencies

Gateways must detect and reject cyclic dependencies in dependsOn. A cycle can leave every message involved permanently ineligible for delivery.

Applications must also consider cross-chain finality, cancellation races, replay protection, and idempotent retry handling. These attributes express delivery requirements but do not establish the underlying gateway's security or trust model.

The original code excerpts and diagrams are retained unchanged. The selectors, implementation behavior, and examples have not been independently executed or audited as part of this translation.

References

Conclusion

ERC-7985 proposes a shared vocabulary for controlling cross-chain message delivery, including cancellation, time windows, retries, error handling, dependencies, and gas requirements.

Questions are welcome via Twitter @cardene777.

Other publications: