{"eip":7521,"title":"General Intents for Smart Contract Wallets","description":"A generalized intent specification for smart contract wallets, allowing authorization of current and future intent structures at sign time","authors":["Stephen Monn (@pixelcircuits)","Bikem Bengisu (@supiket)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2023-09-19","discussionsTo":"https://ethereum-magicians.org/t/erc-7521-generalized-intents-for-smart-contract-wallets/15840","repo":"ERCs","label":"ERC-7521","officialUrl":"https://eips.ethereum.org/EIPS/eip-7521","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7521.md","url":"https://eips.huatuo.xyz/eip-7521/","tldr":{"en":"An ERC-4337-style entry point for intents: smart contract wallets verify one signature, while pluggable 'intent standard' contracts define what the intent means and solvers bundle intents into a single transaction.","ja":"インテント向けの ERC-4337 スタイルのエントリーポイント。スマートコントラクトウォレットは署名を 1 つ検証し、差し替え可能な「インテント標準」コントラクトがインテントの意味を定義し、ソルバーがインテントを 1 つのトランザクションにまとめる。","ko":"인텐트를 위한 ERC-4337 스타일의 엔트리 포인트. 스마트 컨트랙트 지갑은 서명 하나만 검증하고, 교체 가능한 \"인텐트 표준\" 컨트랙트가 인텐트의 의미를 정의하며, 솔버가 인텐트를 하나의 트랜잭션으로 묶는다.","zh":"面向意图（intent）的 ERC-4337 风格入口点：智能合约钱包只验证一个签名，可插拔的\"意图标准\"合约定义意图的含义，求解器（solver）把意图打包进一笔交易。"},"tags":["intents","account-abstraction","wallet","mev","solvers"],"explainers":{"en":{"lang":"en","tldr":"An ERC-4337-style entry point for intents: smart contract wallets verify one signature, while pluggable 'intent standard' contracts define what the intent means and solvers bundle intents into a single transaction.","tags":["intents","account-abstraction","wallet","mev","solvers"],"related":[4337,7683],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7521/","markdown":"## What problem does it solve?\n\nAn **intent** is a signed statement of what a user wants (\"swap up to 1,000 USDC for at least 0.3 ETH\") rather than the exact transaction to run. Third parties, called **solvers**, compete to fulfil it. Intent formats keep evolving, and if every new format required a wallet upgrade, users would be stuck with whatever their wallet supports today.\n\nERC-7521 separates the two concerns. The wallet only proves \"yes, I signed this\". The meaning of the intent is defined by separate **intent standard** contracts that anyone can register. A wallet that supports ERC-7521 once can use any current or future intent standard without upgrading.\n\n## How it works\n\n**UserIntent.** A user signs `{ sender, segments[], signature }`. Each **segment** is a bytes blob whose first 32 bytes is the ID of the intent standard that interprets it. One intent can combine segments from several standards (for example \"release these tokens\" + \"require I receive those tokens\").\n\n**IntentSolution.** A solver collects intents (often including its own) into `{ timestamp, intents[], order[] }` and calls `handleIntents(solution)` on a shared **entry point** contract. The solver pays the gas.\n\n**Entry point**, in two loops:\n\n1. *Verification*: checks the solution timestamp, then calls `validateUserIntent(intent, hash)` on each wallet. A failing intent is skipped (or the whole call may revert).\n2. *Execution*: for each segment, calls `executeIntentSegment(solution, executionIndex, segmentIndex, context)` on the matching intent standard. Each standard returns a `context` blob that is fed back on that intent's next segment, letting it check state changes across interleaved intents. `order[]` lets the solver interleave segments of different intents; otherwise a default round-robin is used.\n\n**Wallet callbacks.** If a standard needs the wallet to act (for example to move tokens), it calls the wallet's `generalizedIntentDelegateCall(data)`. The wallet first asks the entry point `verifyExecutingIntentSegmentForStandard(msg.sender)` to make sure the caller is the standard currently executing one of *its* intents, then delegate-calls it.\n\nStandards register permissionlessly with `registerIntentStandard`, which returns an ID unique to the standard, entry point and chain. Optional extensions include built-in common standards, `handleIntentsMulti`, entry-point nonce storage, and \"data blob\" intents.\n\n## Sample code\n\nThe wallet-side hooks:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\nstruct UserIntent { address sender; bytes[] segments; bytes signature; }\n\ninterface IEntryPoint {\n    function verifyExecutingIntentSegmentForStandard(address standard) external view returns (bool);\n}\n\nabstract contract IntentWallet {\n    IEntryPoint public immutable entryPoint;\n    constructor(IEntryPoint ep) { entryPoint = ep; }\n\n    function _isValidSignature(bytes32 hash, bytes calldata sig) internal view virtual returns (bool);\n\n    function validateUserIntent(UserIntent calldata intent, bytes32 intentHash) external view {\n        require(msg.sender == address(entryPoint), \"not entry point\");\n        require(_isValidSignature(intentHash, intent.signature), \"bad signature\");\n    }\n\n    function generalizedIntentDelegateCall(bytes memory data) external {\n        require(entryPoint.verifyExecutingIntentSegmentForStandard(msg.sender), \"not executing\");\n        (bool ok, ) = msg.sender.delegatecall(data);\n        require(ok, \"delegatecall failed\");\n    }\n}\n```\n\n## Things to know\n\n- Status is **Draft**. The spec points to an external reference implementation; there is no canonical deployed entry point defined in the spec.\n- The entry point is a single trust point for every ERC-7521 wallet, so it needs heavy auditing and formal verification. So does every intent standard a user signs for, because the wallet will delegate-call into it.\n- Nonce and replay protection are expected to be handled by an intent segment (or the nonce extension), not by `validateUserIntent`.\n- Wallets that already support [ERC-4337](/eip-4337/) can reuse much of their `validateUserOp` logic. For a narrower, cross-chain-focused intent format, see [ERC-7683](/eip-7683/).\n"},"ja":{"lang":"ja","tldr":"インテント向けの ERC-4337 スタイルのエントリーポイント。スマートコントラクトウォレットは署名を 1 つ検証し、差し替え可能な「インテント標準」コントラクトがインテントの意味を定義し、ソルバーがインテントを 1 つのトランザクションにまとめる。","tags":["intents","account-abstraction","wallet","mev","solvers"],"related":[4337,7683],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7521/","markdown":"## 何を解決するのか\n\n**インテント**とは、実行すべき正確なトランザクションではなく、ユーザーが望むこと（「最大 1,000 USDC を最低 0.3 ETH にスワップする」など）を表す署名付きの宣言です。**ソルバー**と呼ばれる第三者が、その実現を競います。インテントの形式は進化し続けており、新しい形式のたびにウォレットのアップグレードが必要だと、ユーザーは今のウォレットが対応しているものに縛られてしまいます。\n\nERC-7521 は、この 2 つの関心事を分離します。ウォレットは「はい、これに署名しました」ということだけを証明します。インテントの意味は、誰でも登録できる別個の**インテント標準**コントラクトによって定義されます。ERC-7521 に一度対応したウォレットは、アップグレードなしで、現在および将来のあらゆるインテント標準を使えます。\n\n## 仕組み\n\n**UserIntent。** ユーザーは `{ sender, segments[], signature }` に署名します。各**セグメント**は bytes の塊で、先頭の 32 バイトは、それを解釈するインテント標準の ID です。1 つのインテントに、複数の標準のセグメントを組み合わせられます（たとえば「これらのトークンを手放す」＋「あれらのトークンを受け取ることを要求する」）。\n\n**IntentSolution。** ソルバーはインテント（多くは自分自身のものも含む）を `{ timestamp, intents[], order[] }` にまとめ、共有の**エントリーポイント**コントラクトの `handleIntents(solution)` を呼び出します。ガス代はソルバーが負担します。\n\n**エントリーポイント**は 2 つのループで動作します。\n\n1. *検証*: solution のタイムスタンプを確認し、各ウォレットの `validateUserIntent(intent, hash)` を呼び出します。失敗したインテントはスキップされます（または呼び出し全体が revert することもあります）。\n2. *実行*: 各セグメントについて、対応するインテント標準の `executeIntentSegment(solution, executionIndex, segmentIndex, context)` を呼び出します。各標準は `context` の塊を返し、それがそのインテントの次のセグメントに渡されるため、入り組んだインテント間での状態変化を確認できます。`order[]` により、ソルバーは異なるインテントのセグメントを交互に並べられます。指定しなければデフォルトのラウンドロビンが使われます。\n\n**ウォレットのコールバック。** 標準がウォレットに何かをさせる必要がある場合（たとえばトークンを動かすなど）、ウォレットの `generalizedIntentDelegateCall(data)` を呼びます。ウォレットはまずエントリーポイントに `verifyExecutingIntentSegmentForStandard(msg.sender)` を問い合わせ、呼び出し元が*自分の*インテントのいずれかを現在実行中の標準であることを確かめてから、delegate-call します。\n\n標準は `registerIntentStandard` でパーミッションレスに登録され、標準・エントリーポイント・チェーンごとに一意の ID が返されます。任意の拡張として、組み込みの共通標準、`handleIntentsMulti`、エントリーポイントの nonce ストレージ、「データ blob」インテントがあります。\n\n## サンプルコード\n\nウォレット側のフック:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\nstruct UserIntent { address sender; bytes[] segments; bytes signature; }\n\ninterface IEntryPoint {\n    function verifyExecutingIntentSegmentForStandard(address standard) external view returns (bool);\n}\n\nabstract contract IntentWallet {\n    IEntryPoint public immutable entryPoint;\n    constructor(IEntryPoint ep) { entryPoint = ep; }\n\n    function _isValidSignature(bytes32 hash, bytes calldata sig) internal view virtual returns (bool);\n\n    function validateUserIntent(UserIntent calldata intent, bytes32 intentHash) external view {\n        require(msg.sender == address(entryPoint), \"not entry point\");\n        require(_isValidSignature(intentHash, intent.signature), \"bad signature\");\n    }\n\n    function generalizedIntentDelegateCall(bytes memory data) external {\n        require(entryPoint.verifyExecutingIntentSegmentForStandard(msg.sender), \"not executing\");\n        (bool ok, ) = msg.sender.delegatecall(data);\n        require(ok, \"delegatecall failed\");\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。仕様は外部のリファレンス実装を指しており、仕様の中にデプロイ済みの正規のエントリーポイントは定義されていません。\n- エントリーポイントは、すべての ERC-7521 ウォレットにとって単一の信頼点なので、徹底的な監査と形式検証が必要です。ユーザーが署名するすべてのインテント標準も同様です。ウォレットがその中へ delegate-call するためです。\n- nonce とリプレイ保護は、`validateUserIntent` ではなく、インテントのセグメント（または nonce 拡張）で扱われることが想定されています。\n- すでに [ERC-4337](/eip-4337/) に対応しているウォレットは、`validateUserOp` のロジックの多くを再利用できます。より限定的で、クロスチェーンに特化したインテント形式については、[ERC-7683](/eip-7683/) を参照してください。\n"},"ko":{"lang":"ko","tldr":"인텐트를 위한 ERC-4337 스타일의 엔트리 포인트. 스마트 컨트랙트 지갑은 서명 하나만 검증하고, 교체 가능한 \"인텐트 표준\" 컨트랙트가 인텐트의 의미를 정의하며, 솔버가 인텐트를 하나의 트랜잭션으로 묶는다.","tags":["intents","account-abstraction","wallet","mev","solvers"],"related":[4337,7683],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7521/","markdown":"## 어떤 문제를 해결하나요?\n\n**인텐트**는 실행할 정확한 트랜잭션이 아니라 사용자가 원하는 것(\"최대 1,000 USDC를 최소 0.3 ETH로 스왑\")을 서명으로 표현한 진술입니다. **솔버**라고 부르는 제3자들이 이를 이행하기 위해 경쟁합니다. 인텐트 형식은 계속 진화하는데, 새 형식마다 지갑 업그레이드가 필요하다면 사용자는 지갑이 현재 지원하는 것에 묶이게 됩니다.\n\nERC-7521은 이 두 관심사를 분리합니다. 지갑은 \"네, 제가 서명했습니다\"만 증명합니다. 인텐트의 의미는 누구나 등록할 수 있는 별도의 **인텐트 표준** 컨트랙트가 정의합니다. ERC-7521을 한 번 지원한 지갑은 업그레이드 없이 현재와 미래의 모든 인텐트 표준을 사용할 수 있습니다.\n\n## 어떻게 동작하나요?\n\n**UserIntent.** 사용자는 `{ sender, segments[], signature }`에 서명합니다. 각 **세그먼트**는 bytes 덩어리이며, 앞의 32바이트는 이를 해석하는 인텐트 표준의 ID입니다. 하나의 인텐트에 여러 표준의 세그먼트를 결합할 수 있습니다(예: \"이 토큰들을 내놓는다\" + \"저 토큰들을 받을 것을 요구한다\").\n\n**IntentSolution.** 솔버는 인텐트(자신의 인텐트를 포함하는 경우가 많음)를 `{ timestamp, intents[], order[] }`로 모아 공유 **엔트리 포인트** 컨트랙트의 `handleIntents(solution)`를 호출합니다. 가스는 솔버가 부담합니다.\n\n**엔트리 포인트**는 두 개의 루프로 동작합니다.\n\n1. *검증*: solution 타임스탬프를 확인한 다음 각 지갑의 `validateUserIntent(intent, hash)`를 호출합니다. 실패한 인텐트는 건너뜁니다(또는 호출 전체가 revert될 수도 있습니다).\n2. *실행*: 각 세그먼트마다 해당하는 인텐트 표준의 `executeIntentSegment(solution, executionIndex, segmentIndex, context)`를 호출합니다. 각 표준은 `context` 덩어리를 반환하며, 이는 그 인텐트의 다음 세그먼트로 전달되어 서로 얽힌 인텐트들 사이의 상태 변화를 확인할 수 있게 합니다. `order[]`를 통해 솔버는 서로 다른 인텐트의 세그먼트를 번갈아 배치할 수 있으며, 지정하지 않으면 기본 라운드 로빈이 사용됩니다.\n\n**지갑 콜백.** 표준이 지갑에게 무언가를 시켜야 할 때(예: 토큰 이동) 지갑의 `generalizedIntentDelegateCall(data)`를 호출합니다. 지갑은 먼저 엔트리 포인트에 `verifyExecutingIntentSegmentForStandard(msg.sender)`를 물어 호출자가 *자신의* 인텐트 중 하나를 현재 실행 중인 표준인지 확인한 다음 delegate-call합니다.\n\n표준은 `registerIntentStandard`로 허가 없이 등록하며, 이 함수는 표준, 엔트리 포인트, 체인별로 고유한 ID를 반환합니다. 선택적 확장으로는 내장 공통 표준, `handleIntentsMulti`, 엔트리 포인트 nonce 저장, \"데이터 blob\" 인텐트가 있습니다.\n\n## 샘플 코드\n\n지갑 측 훅:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\nstruct UserIntent { address sender; bytes[] segments; bytes signature; }\n\ninterface IEntryPoint {\n    function verifyExecutingIntentSegmentForStandard(address standard) external view returns (bool);\n}\n\nabstract contract IntentWallet {\n    IEntryPoint public immutable entryPoint;\n    constructor(IEntryPoint ep) { entryPoint = ep; }\n\n    function _isValidSignature(bytes32 hash, bytes calldata sig) internal view virtual returns (bool);\n\n    function validateUserIntent(UserIntent calldata intent, bytes32 intentHash) external view {\n        require(msg.sender == address(entryPoint), \"not entry point\");\n        require(_isValidSignature(intentHash, intent.signature), \"bad signature\");\n    }\n\n    function generalizedIntentDelegateCall(bytes memory data) external {\n        require(entryPoint.verifyExecutingIntentSegmentForStandard(msg.sender), \"not executing\");\n        (bool ok, ) = msg.sender.delegatecall(data);\n        require(ok, \"delegatecall failed\");\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다. 명세는 외부 참조 구현을 가리키며, 명세 안에 배포된 정식 엔트리 포인트는 정의되어 있지 않습니다.\n- 엔트리 포인트는 모든 ERC-7521 지갑의 단일 신뢰 지점이므로 철저한 감사와 형식 검증이 필요합니다. 사용자가 서명하는 모든 인텐트 표준도 마찬가지입니다. 지갑이 그 안으로 delegate-call하기 때문입니다.\n- nonce와 리플레이 방지는 `validateUserIntent`가 아니라 인텐트 세그먼트(또는 nonce 확장)에서 처리될 것으로 기대됩니다.\n- 이미 [ERC-4337](/eip-4337/)을 지원하는 지갑은 `validateUserOp` 로직의 상당 부분을 재사용할 수 있습니다. 더 좁고 크로스체인에 초점을 둔 인텐트 형식은 [ERC-7683](/eip-7683/)을 참고하세요.\n"},"zh":{"lang":"zh","tldr":"面向意图（intent）的 ERC-4337 风格入口点：智能合约钱包只验证一个签名，可插拔的\"意图标准\"合约定义意图的含义，求解器（solver）把意图打包进一笔交易。","tags":["intents","account-abstraction","wallet","mev","solvers"],"related":[4337,7683],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7521/","markdown":"## 它解决什么问题？\n\n**意图**是用户想要什么的签名声明（例如\"最多用 1,000 USDC 换取至少 0.3 ETH\"），而不是要执行的确切交易。称为**求解器**的第三方会竞争来完成它。意图的格式在不断演进，如果每种新格式都需要升级钱包，用户就只能被钱包当前所支持的内容所限制。\n\nERC-7521 把这两个关注点分开。钱包只证明\"是的，这是我签的\"。意图的含义由任何人都可以注册的独立**意图标准**合约来定义。只要钱包支持一次 ERC-7521，就可以在无需升级的情况下使用任何当前或未来的意图标准。\n\n## 它如何运作\n\n**UserIntent。** 用户签署 `{ sender, segments[], signature }`。每个**片段（segment）**是一段 bytes，其前 32 字节是解释它的意图标准的 ID。一个意图可以组合来自多个标准的片段（例如\"释放这些代币\"+\"要求我收到那些代币\"）。\n\n**IntentSolution。** 求解器把意图（往往包括它自己的意图）收集为 `{ timestamp, intents[], order[] }`，并在共享的**入口点**合约上调用 `handleIntents(solution)`。gas 由求解器支付。\n\n**入口点**分两个循环：\n\n1. *验证*：检查 solution 的时间戳，然后对每个钱包调用 `validateUserIntent(intent, hash)`。验证失败的意图会被跳过（也可以让整个调用 revert）。\n2. *执行*：对每个片段，在匹配的意图标准上调用 `executeIntentSegment(solution, executionIndex, segmentIndex, context)`。每个标准返回一段 `context`，它会被传给该意图的下一个片段，使其可以检查交错的多个意图之间的状态变化。`order[]` 让求解器可以交错排列不同意图的片段；否则使用默认的轮询顺序。\n\n**钱包回调。** 如果某个标准需要钱包执行操作（例如转移代币），它会调用钱包的 `generalizedIntentDelegateCall(data)`。钱包首先向入口点查询 `verifyExecutingIntentSegmentForStandard(msg.sender)`，确保调用者是当前正在执行*其*某个意图的标准，然后再对它进行 delegate-call。\n\n标准通过 `registerIntentStandard` 无需许可地注册，它返回一个对该标准、入口点和链而言唯一的 ID。可选扩展包括内置的通用标准、`handleIntentsMulti`、入口点 nonce 存储以及\"数据 blob\"意图。\n\n## 示例代码\n\n钱包侧的钩子：\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\nstruct UserIntent { address sender; bytes[] segments; bytes signature; }\n\ninterface IEntryPoint {\n    function verifyExecutingIntentSegmentForStandard(address standard) external view returns (bool);\n}\n\nabstract contract IntentWallet {\n    IEntryPoint public immutable entryPoint;\n    constructor(IEntryPoint ep) { entryPoint = ep; }\n\n    function _isValidSignature(bytes32 hash, bytes calldata sig) internal view virtual returns (bool);\n\n    function validateUserIntent(UserIntent calldata intent, bytes32 intentHash) external view {\n        require(msg.sender == address(entryPoint), \"not entry point\");\n        require(_isValidSignature(intentHash, intent.signature), \"bad signature\");\n    }\n\n    function generalizedIntentDelegateCall(bytes memory data) external {\n        require(entryPoint.verifyExecutingIntentSegmentForStandard(msg.sender), \"not executing\");\n        (bool ok, ) = msg.sender.delegatecall(data);\n        require(ok, \"delegatecall failed\");\n    }\n}\n```\n\n## 需要注意\n\n- 状态为 **Draft**。规范指向一个外部的参考实现；规范中没有定义规范的已部署入口点。\n- 入口点是每个 ERC-7521 钱包的单一信任点，因此需要大量审计和形式化验证。用户所签署的每个意图标准同样如此，因为钱包会对其进行 delegate-call。\n- nonce 和重放保护预期由意图片段（或 nonce 扩展）处理，而不是由 `validateUserIntent` 处理。\n- 已支持 [ERC-4337](/eip-4337/) 的钱包可以复用其大部分 `validateUserOp` 逻辑。若需要更窄、专注于跨链的意图格式，请参阅 [ERC-7683](/eip-7683/)。\n"}}}
