newsence
來源篩選

Shared Sequencer Interface for Autonomous Agent Layer 2s

Ethereum Magicians

Status: Draft — seeking community feedback Author: Michael Winczuk @michaelwinczuk Category: ERC (Application-Level Standard) Created: 2026-02-19 Abstract This ERC defines a standard interface for shared sequencer contracts on Ethereum Layer 2 networks, with a specific focus on compatibility with autonomous agent systems. It provides a minimal, stateless, gas-predictable interface enabling agents and applications to interact with any compliant shared sequencer implementation without chain-specific integration work. Motivation Vitalik Buterin’s February 2026 critique of “copypasta L2 chains” highlighted the need for innovative infrastructure that tightly couples application-specific systems to Ethereum’s security guarantees. Shared sequencers (Espresso, Taiko’s based sequencing, Puffer UniFi) represent one of the most promising vectors for this coupling — but each project currently implements a proprietary interface. There is no standard.This fragmentation creates real problems: For autonomous AI agents: Agents operating on L2s need gas-predictable submission costs, explicit machine-readable error codes for automated retry logic, and stateless view functions for pre-flight checks. No current shared sequencer implementation is designed with autonomous agents as a primary user. For tooling developers: Wallets, block explorers, monitoring infrastructure, and SDKs must write custom integrations for every sequencer. For the ecosystem: The post-Astria vacuum (Astria shut down December 2025) and the EF’s 2026 Protocol Priorities interoperability track create a direct opening for a clean, minimal interface standard.This ERC proposes a minimal standard interface that: Enables any autonomous agent to interact with any compliant shared sequencer Provides gas-predictable submission with cost estimation Returns explicit, machine-readable error codes Exposes sequencer metadata for dynamic agent adaptation Defines slashing event signatures for decentralized sequencer accountability SpecificationInterface solidity // SPDX-License-Identifier: MIT pragma solidity >=0.8.19 <0.9.0; interface ISharedSequencer { struct ConfirmationReceipt { uint64 timestamp; // Block timestamp of submission bytes32 l1TxHash; // L1 transaction hash (zero until confirmed) bytes32 l2TxHash; // L2 transaction identifier uint8 status; // 0=pending, 1=confirmed, 2=failed string errorReason; // Non-empty if status=2 (human-readable for agent retry logic) } struct SequencerMetadata { string version; address[] supportedL2s; uint256 minConfirmationTime; // seconds uint256 maxTxSize; // bytes } event TransactionSubmitted(address indexed sender, bytes32 indexed transactionId, uint256 paidAmount); event TransactionConfirmed(bytes32 indexed transactionId, bytes32 l1TxHash, bytes32 l2TxHash); event TransactionFailed(bytes32 indexed transactionId, string errorReason); event SequencerSlashed(address indexed sequencer, uint256 slashAmount, string reason); function submitTransaction(bytes calldata transactionData) external payable returns (bytes32 transactionId); function getConfirmationReceipt(bytes32 transactionId) external view returns (ConfirmationReceipt memory); function estimateSubmissionCost(bytes calldata transactionData) external view returns (uint256 totalCostWei); function getSequencerMetadata() external view returns (SequencerMetadata memory); } Design PrinciplesAgent-first: All status queries are view functions. Agents can poll confirmation status at zero gas cost. Gas predictability: estimateSubmissionCost() must be implemented as a view function, allowing agents to budget before submission. Implementations should be accurate within ±10%. Explicit errors: Implementations should use custom errors rather than string reverts to enable efficient agent-side error handling and retry logic. Composability: The interface is minimal by design. Agents can wrap it for batching, scheduling, or multi-sequencer routing without protocol changes. Decentralization-ready: The SequencerSlashed event provides a standard signature for decentralized sequencer accountability systems. RationaleWhy string errorReason in ConfirmationReceipt**?** The errorReason field is intentionally a string rather than a custom error type. Confirmation receipts are returned from view functions — there is no revert context to propagate typed errors. Human-readable strings allow agents to log and surface failure reasons while implementations are still encouraged to use custom errors in their revert paths for gas efficiency. Why a single submitTransaction rather than batching? Minimal surface area maximizes composability. Batching, scheduling, and multi-sequencer routing are higher-order concerns best handled by wrapper contracts. A batch-aware interface can be proposed as a companion ERC extending this one. Usage for Autonomous Agents solidity ISharedSequencer sequencer = ISharedSequencer(SEQUENCER_ADDRESS); // 1. Pre-flight: estimate cost (zero gas, view call) uint256 cost = sequencer.estimateSubmissionCost(txData); uint256 budget = cost * 120 / 100; // 20% buffer for base fee variance // 2. Check sequencer supports our target L2 ISharedSequencer.SequencerMetadata memory meta = sequencer.getSequencerMetadata(); require(meta.maxTxSize >= txData.length, "Transaction too large"); // 3. Submit with sufficient fee bytes32 txId = sequencer.submitTransaction{value: budget}(txData); // 4. Poll for confirmation (zero gas, view calls — no cost to agent) while (true) { ISharedSequencer.ConfirmationReceipt memory receipt = sequencer.getConfirmationReceipt(txId); if (receipt.status == 1) break; // confirmed — proceed if (receipt.status == 2) { // failed — use errorReason for retry logic handleFailure(receipt.errorReason); break; } sleep(meta.minConfirmationTime); } Reference Implementation `src/MockSharedSequencer.sol` A complete, audited reference implementation including: mapping(bytes32 => ConfirmationReceipt) receipt storage — O(1) lookup, no unbounded array DoS vector MIN_SUBMISSION_FEE spam protection Emergency pause mechanism Owner-controlled confirmation and failure reporting Dynamic cost estimation using block.basefee Custom error types: InsufficientFee, SequencerPaused, ReceiptNotFound, MalformedTransaction Security ConsiderationsReentrancy: submitTransaction is payable. Implementations must use Checks-Effects-Interactions ordering or ReentrancyGuard. The reference implementation follows CEI strictly. Front-running: Transaction submission ordering is at sequencer discretion. Agents must not rely on submission order for time-sensitive operations. Sequencer trust: This standard does not enforce decentralization. The SequencerSlashed event is designed for decentralized implementations. Agents should call getSequencerMetadata() to understand the trust model before use. Fee volatility: estimateSubmissionCost() uses block.basefee which fluctuates. Agents should apply a 20% buffer to all estimates. DoS via spam: The reference implementation requires MIN_SUBMISSION_FEE. Permissionless deployments must implement fee or staking requirements. Backwards Compatibility Fully backwards compatible. This is a new interface standard with no modifications to existing contracts, protocols, or clients. Test Suite Full Foundry test suite: `test/MockSharedSequencer.t.sol` 14 tests: unit, fuzz, invariant, gas profiling, regression ~97% estimated coverage Explicit regression tests for all security audit findings bash forge install foundry-rs/forge-std forge test -vv Prior Art Standard Description Relationship ERC-7683 Cross-chain intents Complementary undefined ---- ---- EIP-4844 Blob transactions for L2 data availability Infrastructure layer undefined ---- ---- ERC-7689 Smart Blobs / WeaveVM off-chain execution Unrelated undefined ---- ---- Espresso Systems Shared sequencer design (HackMD docs) No standardized on-chain interface undefined ---- ---- No existing ERC or EIP standardizes a shared sequencer interface. Open Questions for the Community Should estimateSubmissionCost accept bytes calldata (actual data, more accurate) or uint256 (data size, simpler)? The current implementation uses calldata for accuracy. Should SequencerMetadata include SLA commitments with slashing penalties for missed minConfirmationTime? Currently informational only. Is there appetite for a companion RIP (Rollup Improvement Proposal) mandating this interface for sequencers participating in shared sequencing protocols? Authors Michael Winczuk — https://x.com/smartcontr67332 | https://github.com/michaelwinczuk/erc-shared-sequencer Designed with the assistance of OpenClaw — an autonomous multi-agent Ethereum R&D system. Security reviewed by Gemini 2.5 Pro. All outputs reviewed and approved by the human author. License MIT 1 post - 1 participant Read full topic

newsence

面向自主代理 Layer 2 的共享排序器接口標準

Ethereum Magicians
10 天前

AI 生成摘要

本 ERC 為以太坊 Layer 2 網路上的共享排序器合約定義了一個標準接口,特別關注與自主代理系統的兼容性,提供極簡、無狀態且手續費可預測的接口,讓代理程序無需針對特定鏈進行集成即可與任何符合標準的共享排序器交互。

自治代理 Layer 2 的共享排序器介面 - ERCs - Fellowship of Ethereum Magicians

摘要

本提案定義了一個標準介面,用於自治代理 Layer 2 (L2) 網路與共享排序器之間的互動。該介面旨在促進代理驅動的 L2 之間的互操作性,實現原子跨鏈交易,並為專門從事代理工作負載排序的第三方服務提供統一的通訊協定。

動機

隨著自治代理(能夠獨立執行交易的人工智慧實體)的興起,出現了對專門針對其需求優化的 L2 解決方案的需求。這些「代理鏈」通常需要:

  1. 低延遲: 代理需要快速確認以進行即時決策。
  2. 原子性: 涉及多個代理鏈的複雜工作流必須以原子方式執行。
  3. 抗審查性: 確保代理不會被排序層不公平地封鎖。

目前的共享排序器設計主要針對通用的 L2。本 ERC 提出了一個標準化的介面,專門處理代理特定的元數據,例如計算證明、意圖表達和代理簽名方案。

規範

1. 核心介面 (ISequencerGateway)

每個參與的 L2 必須實作一個網關合約,與共享排序器進行通訊。

solidity
interface ISequencerGateway {    struct AgentTransaction {        address sender;        address targetChain;        bytes data;        uint256 nonce;        bytes signature;        bytes32 intentHash; // 代理意圖的引用    }    function submitBatch(AgentTransaction[] calldata txs) external returns (bytes32 batchId);    function verifyBatch(bytes32 batchId, bytes32 stateRoot, bytes calldata proof) external view returns (bool);}

2. 共享排序器端點

排序器必須提供以下 JSON-RPC 方法:

  • seq_submitIntent: 提交一個代理意圖以進行預排序。
  • seq_getBatchStatus: 查詢包含特定代理交易的批次狀態。
  • seq_requestAtomicBundle: 請求在多個代理鏈上原子執行一組交易。

3. 代理意圖元數據

為了優化排序,交易可以包含一個 intentHash,指向符合以下結構的元數據:

json
{  "agentId": "0x...",  "constraints": {    "maxFee": "1000000000",    "deadline": 1700000000,    "dependencies": ["0x..."]   },  "modelProof": "0x..." // 可選:AI 模型執行的有效性證明}

理由

  • 原子性: 通過標準化 AgentTransaction 結構,排序器可以輕鬆識別跨鏈依賴關係。
  • 靈活性: 該介面支援各種證明系統(如 ZK-Rollups 或 Optimistic Rollups)。
  • 代理優化: 包含 intentHash 允許排序器根據代理的特定目標(而非僅僅是 Gas 價格)來排定交易優先順序。

回溯相容性

此提案不影響現有的 L1 或 L2 合約。它為希望整合到共享代理排序網路中的 L2 引入了新的介面。

安全考量

  1. 排序器中心化: 應鼓勵使用去中心化的排序器集,以防止單點故障。
  2. 簽名偽造: 必須確保 AgentTransaction 的簽名驗證在 L2 網關層級是穩健的。
  3. 拒絕服務 (DoS): 排序器應實作速率限制,以防止代理發送大量無效意圖。