{"eip":7679,"title":"UserOperation Builder","description":"Construct UserOperations without being coupled with account-specific logic.","authors":["Derek Chiang (@derekchiang)","Garvit Khatri (@plusminushalf)","Fil Makarov (@filmakarov)","Kristof Gazso (@kristofgazso)","Derek Rein (@arein)","Tomas Rocchi (@tomiir)","bumblefudge (@bumblefudge)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2024-04-05","requires":[4337],"discussionsTo":"https://ethereum-magicians.org/t/erc-7679-smart-account-interfaces/19547","repo":"ERCs","label":"ERC-7679","officialUrl":"https://eips.ethereum.org/EIPS/eip-7679","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7679.md","url":"https://eips.huatuo.xyz/eip-7679/","tldr":{"en":"Lets each ERC-4337 smart account publish an on-chain 'builder' contract that encodes its own nonce, calldata and signature, so any wallet or dapp can build UserOperations without an account-specific SDK.","ja":"各 ERC-4337 スマートアカウントが、自身の nonce・calldata・署名のエンコード方法を持つオンチェーンの「builder」コントラクトを公開できるようにし、アカウント固有の SDK なしでどのウォレットや dapp でも UserOperation を組み立てられるようにする。","ko":"각 ERC-4337 스마트 계정이 자신의 nonce, calldata, 서명 인코딩 방식을 담은 온체인 \"builder\" 컨트랙트를 공개하게 해, 계정별 SDK 없이도 어떤 지갑이나 dapp이든 UserOperation을 만들 수 있게 한다.","zh":"让每个 ERC-4337 智能账户发布一个链上的\"builder\"合约，封装自己的 nonce、calldata 和签名编码方式，这样任何钱包或 dapp 都无需账户专属 SDK 就能构造 UserOperation。"},"tags":["account-abstraction","smart-accounts","userop","interoperability"],"explainers":{"en":{"lang":"en","tldr":"Lets each ERC-4337 smart account publish an on-chain 'builder' contract that encodes its own nonce, calldata and signature, so any wallet or dapp can build UserOperations without an account-specific SDK.","tags":["account-abstraction","smart-accounts","userop","interoperability"],"related":[4337,6492,1271,7579],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7679/","markdown":"## What problem does it solve?\n\n[ERC-4337](/eip-4337/) lets smart accounts send UserOperations (UserOps), but it leaves three fields up to each account implementation: the `nonce`, the `callData` and the `signature`. One account might expose `executeFoo`, another `executeBar`; one packs a validator address into the nonce, another wraps the signature with extra data.\n\nThe result is that a dapp or wallet that wants to send a UserOp has to know which account implementation it is talking to and ship that vendor's SDK. That is vendor lock-in, and it fragments the account-abstraction ecosystem.\n\nERC-7679 moves that account-specific encoding logic on-chain, behind one common interface.\n\n## How it works\n\nEach smart account implementation provides a **UserOp builder** contract implementing `IUserOperationBuilder`:\n\n| Function | Returns |\n| --- | --- |\n| `entryPoint()` | The ERC-4337 EntryPoint the account supports |\n| `getNonce(account, context)` | The nonce to use |\n| `getCallData(account, executions, context)` | `callData` for a batch of `(target, value, callData)` executions |\n| `formatSignature(account, userOp, context)` | The raw signature wrapped in the account's expected format |\n\n`context` is an opaque byte string the account owner (or their wallet) hands to the building party. It carries whatever the builder needs, for example a delegation authorization.\n\nThe suggested flow for a building party:\n\n1. Get the builder address and `context` from the account owner.\n2. `eth_call` `getNonce` and `getCallData` (ideally batched).\n3. Fill a UserOp with low gas values, sign it, and call `formatSignature` to get a correctly shaped **dummy signature** for gas estimation.\n4. Estimate gas, put the real gas values in, sign again, and call `formatSignature` once more to get the final, valid UserOp.\n\nOther UserOp fields (gas, paymaster, etc.) are out of scope. For accounts not yet deployed, the spec describes a `CounterfactualCall` contract, inspired by [ERC-6492](/eip-6492/), that deploys the account inside an `eth_call` via the factory and then queries the builder.\n\n## Sample code\n\nBuilding `callData` and `nonce` with ethers v6:\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst builder = new Contract(builderAddress, [\n  \"function entryPoint() view returns (address)\",\n  \"function getNonce(address smartAccount, bytes context) view returns (uint256)\",\n  \"function getCallData(address smartAccount, (address target, uint256 value, bytes callData)[] executions, bytes context) view returns (bytes)\",\n], provider);\n\nconst executions = [\n  { target: tokenAddress, value: 0n, callData: transferData },\n];\n\nconst [nonce, callData] = await Promise.all([\n  builder.getNonce(account, context),\n  builder.getCallData(account, executions, context),\n]);\n// Fill the rest of the UserOp, then call formatSignature(...) for the dummy and final signatures.\n```\n\n## Things to know\n\n- **Status: Draft.** The interface may still change.\n- The interface targets EntryPoint v0.7 (`PackedUserOperation`). Accounts on EntryPoint v0.6 need a variant using the v0.6 struct.\n- Dummy signatures matter: they must consume roughly as much gas as a real one, which is why they come from the account-specific builder rather than a fixed value.\n- The dummy signature is exposed publicly; the spec recommends signing the dummy UserOp with very low gas values so it is useless if intercepted.\n- It complements modular-account standards such as [ERC-7579](/eip-7579/), which standardize execution and modules inside the account rather than how UserOps are built from outside.\n"},"ja":{"lang":"ja","tldr":"各 ERC-4337 スマートアカウントが、自身の nonce・calldata・署名のエンコード方法を持つオンチェーンの「builder」コントラクトを公開できるようにし、アカウント固有の SDK なしでどのウォレットや dapp でも UserOperation を組み立てられるようにする。","tags":["account-abstraction","smart-accounts","userop","interoperability"],"related":[4337,6492,1271,7579],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7679/","markdown":"## 何を解決するのか\n\n[ERC-4337](/eip-4337/) ではスマートアカウントが UserOperation（UserOp）を送れますが、`nonce`、`callData`、`signature` の 3 つのフィールドはアカウント実装ごとに任意となっています。あるアカウントは `executeFoo` を公開し、別のアカウントは `executeBar` を公開します。nonce にバリデーターのアドレスを詰め込むものもあれば、署名に追加データを被せるものもあります。\n\nその結果、UserOp を送りたい dapp やウォレットは、相手がどのアカウント実装なのかを知り、そのベンダーの SDK を組み込む必要があります。これはベンダーロックインであり、アカウントアブストラクションのエコシステムを分断します。\n\nERC-7679 は、このアカウント固有のエンコードロジックを、共通の 1 つのインターフェースの背後でオンチェーンに移します。\n\n## 仕組み\n\n各スマートアカウント実装は、`IUserOperationBuilder` を実装する **UserOp builder** コントラクトを提供します。\n\n| 関数 | 戻り値 |\n| --- | --- |\n| `entryPoint()` | アカウントが対応する ERC-4337 EntryPoint |\n| `getNonce(account, context)` | 使用する nonce |\n| `getCallData(account, executions, context)` | `(target, value, callData)` の実行バッチに対する `callData` |\n| `formatSignature(account, userOp, context)` | 生の署名を、アカウントが期待する形式にラップしたもの |\n\n`context` は、アカウントの所有者（またはそのウォレット）が組み立てる側に渡す不透明なバイト列です。委任の認可など、builder が必要とする情報を運びます。\n\n組み立てる側の推奨フローは次のとおりです。\n\n1. アカウントの所有者から builder のアドレスと `context` を取得する。\n2. `getNonce` と `getCallData` を `eth_call` で呼ぶ（できればバッチで）。\n3. 低い gas 値で UserOp を埋めて署名し、`formatSignature` を呼んで、gas 見積もり用の正しい形の**ダミー署名**を得る。\n4. gas を見積もり、実際の gas 値を入れて再度署名し、もう一度 `formatSignature` を呼んで、最終的に有効な UserOp を得る。\n\nその他の UserOp フィールド（gas、paymaster など）は対象外です。まだデプロイされていないアカウントについては、[ERC-6492](/eip-6492/) に着想を得た `CounterfactualCall` コントラクトが仕様で説明されています。これは `eth_call` の中でファクトリー経由でアカウントをデプロイし、その後 builder に問い合わせます。\n\n## サンプルコード\n\nethers v6 で `callData` と `nonce` を組み立てる例:\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst builder = new Contract(builderAddress, [\n  \"function entryPoint() view returns (address)\",\n  \"function getNonce(address smartAccount, bytes context) view returns (uint256)\",\n  \"function getCallData(address smartAccount, (address target, uint256 value, bytes callData)[] executions, bytes context) view returns (bytes)\",\n], provider);\n\nconst executions = [\n  { target: tokenAddress, value: 0n, callData: transferData },\n];\n\nconst [nonce, callData] = await Promise.all([\n  builder.getNonce(account, context),\n  builder.getCallData(account, executions, context),\n]);\n// Fill the rest of the UserOp, then call formatSignature(...) for the dummy and final signatures.\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** インターフェースはまだ変更される可能性があります。\n- このインターフェースは EntryPoint v0.7（`PackedUserOperation`）を対象としています。EntryPoint v0.6 のアカウントには、v0.6 の構造体を使うバリアントが必要です。\n- ダミー署名は重要です。実際の署名とほぼ同じ量の gas を消費する必要があるため、固定値ではなくアカウント固有の builder から取得します。\n- ダミー署名は公開されます。仕様では、傍受されても使い物にならないよう、非常に低い gas 値でダミー UserOp に署名することを推奨しています。\n- [ERC-7579](/eip-7579/) のようなモジュラーアカウント標準を補完します。ERC-7579 は UserOp を外部からどう組み立てるかではなく、アカウント内部の実行とモジュールを標準化するものです。\n"},"ko":{"lang":"ko","tldr":"각 ERC-4337 스마트 계정이 자신의 nonce, calldata, 서명 인코딩 방식을 담은 온체인 \"builder\" 컨트랙트를 공개하게 해, 계정별 SDK 없이도 어떤 지갑이나 dapp이든 UserOperation을 만들 수 있게 한다.","tags":["account-abstraction","smart-accounts","userop","interoperability"],"related":[4337,6492,1271,7579],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7679/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-4337](/eip-4337/)은 스마트 계정이 UserOperation(UserOp)을 보내도록 하지만, `nonce`, `callData`, `signature` 세 필드는 각 계정 구현에 맡겨 둡니다. 어떤 계정은 `executeFoo`를 노출하고 다른 계정은 `executeBar`를 노출합니다. nonce에 검증자 주소를 담는 계정도 있고, 서명에 추가 데이터를 덧씌우는 계정도 있습니다.\n\n그 결과 UserOp를 보내려는 dapp이나 지갑은 상대가 어떤 계정 구현인지 알아야 하고, 그 벤더의 SDK를 함께 배포해야 합니다. 이는 벤더 종속이며 계정 추상화 생태계를 파편화합니다.\n\nERC-7679는 이런 계정별 인코딩 로직을 하나의 공통 인터페이스 뒤로 옮겨 온체인에 둡니다.\n\n## 어떻게 동작하나요?\n\n각 스마트 계정 구현은 `IUserOperationBuilder`를 구현하는 **UserOp builder** 컨트랙트를 제공합니다.\n\n| 함수 | 반환값 |\n| --- | --- |\n| `entryPoint()` | 계정이 지원하는 ERC-4337 EntryPoint |\n| `getNonce(account, context)` | 사용할 nonce |\n| `getCallData(account, executions, context)` | `(target, value, callData)` 실행 묶음에 대한 `callData` |\n| `formatSignature(account, userOp, context)` | 계정이 기대하는 형식으로 감싼 원본 서명 |\n\n`context`는 계정 소유자(또는 그의 지갑)가 만드는 쪽에 넘겨 주는 불투명한 바이트 문자열입니다. 위임 인증처럼 builder에 필요한 정보를 담습니다.\n\n만드는 쪽에 권장되는 흐름은 다음과 같습니다.\n\n1. 계정 소유자로부터 builder 주소와 `context`를 받는다.\n2. `getNonce`와 `getCallData`를 `eth_call`로 호출한다(가능하면 배치로).\n3. 낮은 gas 값으로 UserOp를 채워 서명하고, `formatSignature`를 호출해 gas 추정용으로 올바른 형태의 **더미 서명**을 얻는다.\n4. gas를 추정하고, 실제 gas 값을 넣어 다시 서명한 뒤, `formatSignature`를 한 번 더 호출해 최종적으로 유효한 UserOp를 얻는다.\n\n그 밖의 UserOp 필드(gas, paymaster 등)는 범위 밖입니다. 아직 배포되지 않은 계정을 위해, 명세는 [ERC-6492](/eip-6492/)에서 착안한 `CounterfactualCall` 컨트랙트를 설명합니다. 이 컨트랙트는 `eth_call` 안에서 팩토리를 통해 계정을 배포한 뒤 builder를 조회합니다.\n\n## 샘플 코드\n\nethers v6로 `callData`와 `nonce`를 만드는 예:\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst builder = new Contract(builderAddress, [\n  \"function entryPoint() view returns (address)\",\n  \"function getNonce(address smartAccount, bytes context) view returns (uint256)\",\n  \"function getCallData(address smartAccount, (address target, uint256 value, bytes callData)[] executions, bytes context) view returns (bytes)\",\n], provider);\n\nconst executions = [\n  { target: tokenAddress, value: 0n, callData: transferData },\n];\n\nconst [nonce, callData] = await Promise.all([\n  builder.getNonce(account, context),\n  builder.getCallData(account, executions, context),\n]);\n// Fill the rest of the UserOp, then call formatSignature(...) for the dummy and final signatures.\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 인터페이스는 아직 바뀔 수 있습니다.\n- 이 인터페이스는 EntryPoint v0.7(`PackedUserOperation`)을 대상으로 합니다. EntryPoint v0.6의 계정에는 v0.6 구조체를 쓰는 변형이 필요합니다.\n- 더미 서명은 중요합니다. 실제 서명과 거의 같은 양의 gas를 소비해야 하므로, 고정값이 아니라 계정별 builder에서 가져옵니다.\n- 더미 서명은 공개적으로 노출됩니다. 명세는 가로채이더라도 쓸모없도록 매우 낮은 gas 값으로 더미 UserOp에 서명할 것을 권장합니다.\n- [ERC-7579](/eip-7579/) 같은 모듈형 계정 표준을 보완합니다. ERC-7579는 UserOp를 외부에서 만드는 방식이 아니라 계정 내부의 실행과 모듈을 표준화합니다.\n"},"zh":{"lang":"zh","tldr":"让每个 ERC-4337 智能账户发布一个链上的\"builder\"合约，封装自己的 nonce、calldata 和签名编码方式，这样任何钱包或 dapp 都无需账户专属 SDK 就能构造 UserOperation。","tags":["account-abstraction","smart-accounts","userop","interoperability"],"related":[4337,6492,1271,7579],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7679/","markdown":"## 它解决什么问题？\n\n[ERC-4337](/eip-4337/) 允许智能账户发送 UserOperation（UserOp），但把三个字段留给各账户实现自行决定：`nonce`、`callData` 和 `signature`。有的账户暴露 `executeFoo`，有的暴露 `executeBar`；有的把验证器地址打包进 nonce，有的则用额外数据包装签名。\n\n结果是，想要发送 UserOp 的 dapp 或钱包必须知道自己面对的是哪种账户实现，并集成该厂商的 SDK。这是厂商锁定，也让账户抽象生态变得碎片化。\n\nERC-7679 把这部分账户专属的编码逻辑搬到链上，放在一个通用接口之后。\n\n## 它如何运作\n\n每种智能账户实现都提供一个实现 `IUserOperationBuilder` 的 **UserOp builder** 合约：\n\n| 函数 | 返回值 |\n| --- | --- |\n| `entryPoint()` | 该账户支持的 ERC-4337 EntryPoint |\n| `getNonce(account, context)` | 应使用的 nonce |\n| `getCallData(account, executions, context)` | 一批 `(target, value, callData)` 执行对应的 `callData` |\n| `formatSignature(account, userOp, context)` | 按账户期望的格式包装后的原始签名 |\n\n`context` 是账户所有者（或其钱包）交给构造方的不透明字节串，携带 builder 所需的任何信息，例如委托授权。\n\n构造方的建议流程：\n\n1. 从账户所有者处获取 builder 地址和 `context`。\n2. 通过 `eth_call` 调用 `getNonce` 和 `getCallData`（最好批量调用）。\n3. 用较低的 gas 值填充 UserOp 并签名，然后调用 `formatSignature`，得到用于 gas 估算、格式正确的**占位签名**（dummy signature）。\n4. 估算 gas，填入真实的 gas 值，再次签名，并再调用一次 `formatSignature`，得到最终有效的 UserOp。\n\n其他 UserOp 字段（gas、paymaster 等）不在范围内。对于尚未部署的账户，规范描述了一个受 [ERC-6492](/eip-6492/) 启发的 `CounterfactualCall` 合约：它在 `eth_call` 中通过工厂合约部署账户，然后再查询 builder。\n\n## 示例代码\n\n使用 ethers v6 构造 `callData` 和 `nonce`：\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst builder = new Contract(builderAddress, [\n  \"function entryPoint() view returns (address)\",\n  \"function getNonce(address smartAccount, bytes context) view returns (uint256)\",\n  \"function getCallData(address smartAccount, (address target, uint256 value, bytes callData)[] executions, bytes context) view returns (bytes)\",\n], provider);\n\nconst executions = [\n  { target: tokenAddress, value: 0n, callData: transferData },\n];\n\nconst [nonce, callData] = await Promise.all([\n  builder.getNonce(account, context),\n  builder.getCallData(account, executions, context),\n]);\n// Fill the rest of the UserOp, then call formatSignature(...) for the dummy and final signatures.\n```\n\n## 需要注意\n\n- **状态：Draft。** 接口仍可能变化。\n- 该接口面向 EntryPoint v0.7（`PackedUserOperation`）。使用 EntryPoint v0.6 的账户需要一个采用 v0.6 结构体的变体。\n- 占位签名很重要：它消耗的 gas 必须与真实签名大致相当，因此它来自账户专属的 builder，而不是固定值。\n- 占位签名是公开暴露的；规范建议用非常低的 gas 值对占位 UserOp 签名，这样即使被截获也毫无用处。\n- 它与 [ERC-7579](/eip-7579/) 等模块化账户标准互为补充：后者标准化的是账户内部的执行和模块，而不是从外部构造 UserOp 的方式。\n"}}}
