{"eip":8397,"title":"Frame Authenticator Signatures","description":"Adds a bounded, state-independent custom-authentication signature scheme to frame transactions.","authors":["Taek (@leekt)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2026-08-26","requires":[2929,7702,7928,8141],"discussionsTo":"https://ethereum-magicians.org/t/eip-8397-frame-authenticator-signatures/29517","repo":"EIPs","label":"EIP-8397","officialUrl":"https://eips.ethereum.org/EIPS/eip-8397","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8397.md","url":"https://eips.huatuo.xyz/eip-8397/","tldr":{"en":"Adds an AUTHENTICATOR signature scheme to EIP-8141 frame transactions: a contract verifies custom signatures (passkeys, post-quantum, etc.) in a pure, fixed-gas context, and the account just decides which authenticators it trusts.","ja":"EIP-8141 のフレームトランザクションに AUTHENTICATOR 署名方式を追加する。コントラクトが、純粋で固定 gas のコンテキストでカスタム署名（パスキー、ポスト量子など）を検証し、アカウントはどの authenticator を信頼するかだけを決める。","ko":"EIP-8141 프레임 트랜잭션에 AUTHENTICATOR 서명 방식을 추가한다. 컨트랙트가 순수하고 고정 gas인 컨텍스트에서 커스텀 서명(패스키, 양자 내성 등)을 검증하고, 계정은 어떤 authenticator를 신뢰할지만 결정한다.","zh":"为 EIP-8141 的 frame 交易增加 AUTHENTICATOR 签名方案：由合约在纯净、固定 gas 的上下文中验证自定义签名（passkey、后量子等），账户只需决定信任哪些 authenticator。"},"tags":["account-abstraction","signatures","frame-transactions","mempool","core"],"explainers":{"en":{"lang":"en","tldr":"Adds an AUTHENTICATOR signature scheme to EIP-8141 frame transactions: a contract verifies custom signatures (passkeys, post-quantum, etc.) in a pure, fixed-gas context, and the account just decides which authenticators it trusts.","tags":["account-abstraction","signatures","frame-transactions","mempool","core"],"related":[8141,7928,2929,7702,8209],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8397/","markdown":"## What problem does it solve?\n\n[EIP-8141](/eip-8141/) frame transactions let the protocol verify secp256k1 and P-256 signatures natively. Any other scheme has to be an `ARBITRARY` signature checked by account code inside a `VERIFY` frame.\n\nThat mixes two very different jobs: **expensive, state-independent cryptography** (checking the signature math) and **cheap, stateful authorization** (does this account accept this key?). Because it all runs as account code that can read state, builders and sequencers find it hard to bound, cache or batch the expensive part.\n\nEIP-8397 moves just the expensive part into protocol validation, with a fixed gas budget, and leaves the trust decision with the account.\n\n## How it works\n\nA new signature scheme `AUTHENTICATOR` (`0x03`):\n\n```text\nsigner    = authenticator contract address (20 bytes)\nsignature = key_id (32 bytes) || proof (variable)\n```\n\n1. **Protocol authentication.** Before any frame runs, the protocol calls `authenticate(digest, proof)` on the authenticator contract with exactly 50,000 gas (`AUTHENTICATOR_GAS_LIMIT`). The contract checks the proof against the transaction digest and returns the `key_id` it proved. The signature is valid only if this equals the claimed `key_id`.\n2. **Pure context.** The call runs in static mode, with no storage, balance or other-code reads, no block or origin data, no logs, no creates, and `STATICCALL` only to precompiles. Any forbidden operation, revert or wrong return invalidates the signature.\n3. **Fixed cost.** Every such signature costs `COLD_ACCOUNT_ACCESS_COST + 50,000` (52,600 under the current schedule), charged in full. Signature bytes are priced at the non-zero byte rate because they are not covered by the signed hash.\n4. **Account authorization.** In its `VERIFY` frame, the account reads `SIGPARAM(0x00)` (the authenticator address) and checks it trusts it. It may also read the authenticated `key_id` via the new `SIGPARAM(0x04)` for per-key rules.\n\nThe authenticator must be regular deployed code: not a precompile, not an [EIP-7702](/eip-7702/) delegated account. Its code read is recorded in the [EIP-7928](/eip-7928/) block access list but does not warm the address under [EIP-2929](/eip-2929/).\n\n## Sample code\n\nAuthenticator interface, plus a sketch of the account side:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IFrameAuthenticator {\n    /// Must derive keyId from the proof itself, never echo an input value.\n    function authenticate(bytes32 digest, bytes calldata proof)\n        external view returns (bytes32 keyId);\n}\n\n// Account VERIFY logic (conceptual; SIGPARAM / APPROVE are EIP-8141 opcodes):\n//\n//   require(SIGPARAM(0x01, i) == 0x03);          // scheme == AUTHENTICATOR\n//   require(SIGPARAM(0x02, i) == 0);             // signs the canonical tx hash\n//   address auth = address(SIGPARAM(0x00, i));\n//   require(isAuthorized[auth]);\n//   // optional: bytes32 keyId = SIGPARAM(0x04, i); enforce per-key policy\n//   APPROVE(scope);\n```\n\n## Things to know\n\n- **Status: Draft.** It is a delta on [EIP-8141](/eip-8141/), itself a Draft, and full test vectors are still to be written.\n- **Trusting an authenticator means trusting every credential it accepts.** Unless the account also checks `key_id`, a permissive authenticator authorizes all of them. An authenticator that returns a `key_id` not bound to the proof must never be authorized.\n- Code is not pinned to the address. Avoid authenticators whose address can be redeployed with different code; node caches must key on the code hash.\n- Two `AUTHENTICATOR` signatures (e.g. sender plus sponsor) cost 105,200 gas, above EIP-8141's 100,000 `MAX_VERIFY_GAS` mempool limit, so such transactions may be valid on-chain but not propagated publicly.\n- A non-empty explicit `msg` does not necessarily commit to the transaction; accounts must reject it for approvals unless they verify that commitment themselves.\n"},"ja":{"lang":"ja","tldr":"EIP-8141 のフレームトランザクションに AUTHENTICATOR 署名方式を追加する。コントラクトが、純粋で固定 gas のコンテキストでカスタム署名（パスキー、ポスト量子など）を検証し、アカウントはどの authenticator を信頼するかだけを決める。","tags":["account-abstraction","signatures","frame-transactions","mempool","core"],"related":[8141,7928,2929,7702,8209],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8397/","markdown":"## 何を解決するのか\n\n[EIP-8141](/eip-8141/) のフレームトランザクションでは、プロトコルが secp256k1 と P-256 の署名をネイティブに検証できます。それ以外の方式は、`VERIFY` フレーム内でアカウントのコードによって確認される `ARBITRARY` 署名にしなければなりません。\n\nこれは、非常に性質の異なる 2 つの仕事を混ぜてしまいます。**高コストで状態に依存しない暗号処理**（署名の数学的な確認）と、**低コストでステートフルな認可**（このアカウントはこの鍵を受け入れるか）です。すべてが状態を読めるアカウントのコードとして実行されるため、ビルダーやシーケンサーは、高コストな部分に上限を設けたり、キャッシュしたり、バッチ処理したりするのが難しくなります。\n\nEIP-8397 は、高コストな部分だけを固定の gas 予算でプロトコルの検証に移し、信頼の判断はアカウントに残します。\n\n## 仕組み\n\n新しい署名方式 `AUTHENTICATOR`（`0x03`）:\n\n```text\nsigner    = authenticator contract address (20 bytes)\nsignature = key_id (32 bytes) || proof (variable)\n```\n\n1. **プロトコルによる認証。** どのフレームも実行される前に、プロトコルは authenticator コントラクトの `authenticate(digest, proof)` を、ちょうど 50,000 gas（`AUTHENTICATOR_GAS_LIMIT`）で呼び出します。コントラクトは、証明をトランザクションのダイジェストに照らして確認し、証明した `key_id` を返します。署名が有効になるのは、これが主張された `key_id` と等しい場合だけです。\n2. **純粋なコンテキスト。** 呼び出しは静的モードで実行され、ストレージ、残高、他のコードの読み取りはなく、ブロックや origin のデータもなく、ログも、作成もなく、`STATICCALL` はプリコンパイルに対してのみ可能です。禁止された操作、revert、誤った戻り値があれば、署名は無効になります。\n3. **固定コスト。** このような署名はすべて `COLD_ACCOUNT_ACCESS_COST + 50,000`（現行のスケジュールでは 52,600）がかかり、全額が課金されます。署名のバイト列は署名対象のハッシュに含まれないため、非ゼロバイトの料率で価格付けされます。\n4. **アカウントによる認可。** アカウントは `VERIFY` フレームで `SIGPARAM(0x00)`（authenticator のアドレス）を読み、それを信頼しているか確認します。鍵ごとのルールのために、新しい `SIGPARAM(0x04)` で認証済みの `key_id` を読むこともできます。\n\nauthenticator は通常のデプロイ済みコードでなければなりません。プリコンパイルでも、[EIP-7702](/eip-7702/) で委任されたアカウントでもだめです。そのコードの読み取りは [EIP-7928](/eip-7928/) の block access list に記録されますが、[EIP-2929](/eip-2929/) ではそのアドレスをウォームにしません。\n\n## サンプルコード\n\nauthenticator のインターフェースと、アカウント側のスケッチ:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IFrameAuthenticator {\n    /// Must derive keyId from the proof itself, never echo an input value.\n    function authenticate(bytes32 digest, bytes calldata proof)\n        external view returns (bytes32 keyId);\n}\n\n// Account VERIFY logic (conceptual; SIGPARAM / APPROVE are EIP-8141 opcodes):\n//\n//   require(SIGPARAM(0x01, i) == 0x03);          // scheme == AUTHENTICATOR\n//   require(SIGPARAM(0x02, i) == 0);             // signs the canonical tx hash\n//   address auth = address(SIGPARAM(0x00, i));\n//   require(isAuthorized[auth]);\n//   // optional: bytes32 keyId = SIGPARAM(0x04, i); enforce per-key policy\n//   APPROVE(scope);\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** それ自体が Draft である [EIP-8141](/eip-8141/) への差分であり、完全なテストベクターはまだ書かれていません。\n- **authenticator を信頼することは、それが受け入れるすべての認証情報を信頼することを意味します。** アカウントが `key_id` も確認しない限り、寛容な authenticator はそれらすべてを認可します。証明に結びついていない `key_id` を返す authenticator を、認可してはなりません。\n- コードはアドレスに固定されていません。異なるコードで再デプロイできるアドレスの authenticator は避けてください。ノードのキャッシュは、コードハッシュをキーにしなければなりません。\n- 2 つの `AUTHENTICATOR` 署名（たとえば送信者とスポンサー）は 105,200 gas かかり、EIP-8141 の 100,000 の `MAX_VERIFY_GAS` という mempool 上限を超えるため、そのようなトランザクションはオンチェーンでは有効でも、公開では伝播されないことがあります。\n- 空でない明示的な `msg` が、必ずしもトランザクションにコミットしているとは限りません。アカウントは、そのコミットメントを自分で検証しない限り、承認でそれを拒否しなければなりません。\n"},"ko":{"lang":"ko","tldr":"EIP-8141 프레임 트랜잭션에 AUTHENTICATOR 서명 방식을 추가한다. 컨트랙트가 순수하고 고정 gas인 컨텍스트에서 커스텀 서명(패스키, 양자 내성 등)을 검증하고, 계정은 어떤 authenticator를 신뢰할지만 결정한다.","tags":["account-abstraction","signatures","frame-transactions","mempool","core"],"related":[8141,7928,2929,7702,8209],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8397/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-8141](/eip-8141/) 프레임 트랜잭션은 프로토콜이 secp256k1과 P-256 서명을 네이티브로 검증하게 해 줍니다. 그 밖의 방식은 `VERIFY` 프레임 안에서 계정 코드가 확인하는 `ARBITRARY` 서명이어야 합니다.\n\n이는 매우 다른 두 가지 일을 뒤섞습니다. **비싸고 상태와 무관한 암호 연산**(서명 수학 검사)과 **저렴하고 상태를 갖는 인가**(이 계정이 이 키를 받아들이는가?)입니다. 모든 것이 상태를 읽을 수 있는 계정 코드로 실행되기 때문에, 빌더와 시퀀서는 비싼 부분에 상한을 두거나 캐시하거나 배치 처리하기 어렵습니다.\n\nEIP-8397은 비싼 부분만 고정 gas 예산으로 프로토콜 검증으로 옮기고, 신뢰 결정은 계정에 남겨 둡니다.\n\n## 어떻게 동작하나요?\n\n새로운 서명 방식 `AUTHENTICATOR`(`0x03`):\n\n```text\nsigner    = authenticator contract address (20 bytes)\nsignature = key_id (32 bytes) || proof (variable)\n```\n\n1. **프로토콜 인증.** 어떤 프레임이 실행되기 전에 프로토콜은 authenticator 컨트랙트의 `authenticate(digest, proof)`를 정확히 50,000 gas(`AUTHENTICATOR_GAS_LIMIT`)로 호출합니다. 컨트랙트는 트랜잭션 다이제스트에 대해 증명을 확인하고, 증명한 `key_id`를 반환합니다. 이 값이 주장된 `key_id`와 같아야만 서명이 유효합니다.\n2. **순수 컨텍스트.** 호출은 정적 모드로 실행되며, 스토리지, 잔액, 다른 코드 읽기가 없고, 블록이나 origin 데이터가 없으며, 로그도 생성도 없고, `STATICCALL`은 프리컴파일에만 가능합니다. 금지된 연산, revert, 잘못된 반환은 서명을 무효로 만듭니다.\n3. **고정 비용.** 이런 서명은 모두 `COLD_ACCOUNT_ACCESS_COST + 50,000`(현재 요금표로는 52,600)이 들며 전액 청구됩니다. 서명 바이트는 서명된 해시에 포함되지 않으므로 0이 아닌 바이트 요율로 가격이 매겨집니다.\n4. **계정 인가.** 계정은 `VERIFY` 프레임에서 `SIGPARAM(0x00)`(authenticator 주소)을 읽고 그것을 신뢰하는지 확인합니다. 키별 규칙을 위해 새로운 `SIGPARAM(0x04)`로 인증된 `key_id`를 읽을 수도 있습니다.\n\nauthenticator는 일반적으로 배포된 코드여야 합니다. 프리컴파일도, [EIP-7702](/eip-7702/)로 위임된 계정도 안 됩니다. 그 코드 읽기는 [EIP-7928](/eip-7928/) block access list에 기록되지만 [EIP-2929](/eip-2929/)에서 해당 주소를 warm하게 만들지는 않습니다.\n\n## 샘플 코드\n\nauthenticator 인터페이스와 계정 쪽 스케치:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IFrameAuthenticator {\n    /// Must derive keyId from the proof itself, never echo an input value.\n    function authenticate(bytes32 digest, bytes calldata proof)\n        external view returns (bytes32 keyId);\n}\n\n// Account VERIFY logic (conceptual; SIGPARAM / APPROVE are EIP-8141 opcodes):\n//\n//   require(SIGPARAM(0x01, i) == 0x03);          // scheme == AUTHENTICATOR\n//   require(SIGPARAM(0x02, i) == 0);             // signs the canonical tx hash\n//   address auth = address(SIGPARAM(0x00, i));\n//   require(isAuthorized[auth]);\n//   // optional: bytes32 keyId = SIGPARAM(0x04, i); enforce per-key policy\n//   APPROVE(scope);\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 그 자체로 Draft인 [EIP-8141](/eip-8141/)에 대한 델타이며, 전체 테스트 벡터는 아직 작성되지 않았습니다.\n- **authenticator를 신뢰한다는 것은 그것이 받아들이는 모든 자격 증명을 신뢰한다는 뜻입니다.** 계정이 `key_id`도 확인하지 않는 한, 관대한 authenticator는 그 전부를 인가합니다. 증명에 묶이지 않은 `key_id`를 반환하는 authenticator는 절대 인가해서는 안 됩니다.\n- 코드는 주소에 고정되어 있지 않습니다. 주소가 다른 코드로 재배포될 수 있는 authenticator는 피하세요. 노드 캐시는 코드 해시를 키로 써야 합니다.\n- 두 개의 `AUTHENTICATOR` 서명(예: 발신자와 스폰서)은 105,200 gas가 들어 EIP-8141의 100,000 `MAX_VERIFY_GAS` mempool 한도를 넘으므로, 그런 트랜잭션은 온체인에서는 유효하더라도 공개적으로 전파되지 않을 수 있습니다.\n- 비어 있지 않은 명시적 `msg`가 반드시 트랜잭션에 커밋하는 것은 아닙니다. 계정은 그 커밋먼트를 직접 검증하지 않는 한 승인에서 이를 거부해야 합니다.\n"},"zh":{"lang":"zh","tldr":"为 EIP-8141 的 frame 交易增加 AUTHENTICATOR 签名方案：由合约在纯净、固定 gas 的上下文中验证自定义签名（passkey、后量子等），账户只需决定信任哪些 authenticator。","tags":["account-abstraction","signatures","frame-transactions","mempool","core"],"related":[8141,7928,2929,7702,8209],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8397/","markdown":"## 它解决什么问题？\n\n[EIP-8141](/eip-8141/) 的 frame 交易让协议可以原生验证 secp256k1 和 P-256 签名。任何其他方案都必须作为 `ARBITRARY` 签名，由 `VERIFY` frame 内的账户代码来检查。\n\n这把两项截然不同的工作混在了一起：**昂贵且与状态无关的密码学运算**（检查签名的数学部分）和**廉价且有状态的授权**（这个账户是否接受这个密钥？）。由于这一切都作为可读取状态的账户代码运行，构建者和排序者很难对昂贵的部分设限、缓存或批处理。\n\nEIP-8397 只把昂贵的部分移入协议验证，并给予固定的 gas 预算，而把信任决策留给账户。\n\n## 它如何运作\n\n一种新的签名方案 `AUTHENTICATOR`（`0x03`）：\n\n```text\nsigner    = authenticator contract address (20 bytes)\nsignature = key_id (32 bytes) || proof (variable)\n```\n\n1. **协议认证。** 在任何 frame 运行之前，协议以恰好 50,000 gas（`AUTHENTICATOR_GAS_LIMIT`）调用 authenticator 合约的 `authenticate(digest, proof)`。合约根据交易摘要检查证明，并返回它所证明的 `key_id`。只有当它与所声称的 `key_id` 相等时，签名才有效。\n2. **纯净上下文。** 该调用在静态模式下运行：不读取存储、余额或其他代码，没有区块或 origin 数据，没有日志，没有创建，且只能对预编译执行 `STATICCALL`。任何被禁止的操作、revert 或错误的返回值都会使签名无效。\n3. **固定成本。** 每个这样的签名花费 `COLD_ACCOUNT_ACCESS_COST + 50,000`（按当前价目表为 52,600），全额收取。由于签名字节不在被签名的哈希覆盖范围内，因此按非零字节费率计价。\n4. **账户授权。** 在其 `VERIFY` frame 中，账户读取 `SIGPARAM(0x00)`（authenticator 地址），并检查自己是否信任它。账户还可以通过新增的 `SIGPARAM(0x04)` 读取已认证的 `key_id`，以制定针对每个密钥的规则。\n\nauthenticator 必须是常规已部署的代码：不能是预编译，也不能是 [EIP-7702](/eip-7702/) 委托的账户。它的代码读取会记录在 [EIP-7928](/eip-7928/) 的 block access list 中，但不会在 [EIP-2929](/eip-2929/) 下使该地址变为 warm。\n\n## 示例代码\n\nauthenticator 接口，以及账户一侧的草图：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IFrameAuthenticator {\n    /// Must derive keyId from the proof itself, never echo an input value.\n    function authenticate(bytes32 digest, bytes calldata proof)\n        external view returns (bytes32 keyId);\n}\n\n// Account VERIFY logic (conceptual; SIGPARAM / APPROVE are EIP-8141 opcodes):\n//\n//   require(SIGPARAM(0x01, i) == 0x03);          // scheme == AUTHENTICATOR\n//   require(SIGPARAM(0x02, i) == 0);             // signs the canonical tx hash\n//   address auth = address(SIGPARAM(0x00, i));\n//   require(isAuthorized[auth]);\n//   // optional: bytes32 keyId = SIGPARAM(0x04, i); enforce per-key policy\n//   APPROVE(scope);\n```\n\n## 需要注意\n\n- **状态：Draft。** 它是对本身也是 Draft 的 [EIP-8141](/eip-8141/) 的增量修改，完整的测试向量尚待编写。\n- **信任一个 authenticator，就意味着信任它接受的每一个凭据。** 除非账户同时检查 `key_id`，否则宽松的 authenticator 会授权所有凭据。返回的 `key_id` 未与证明绑定的 authenticator 绝不能被授权。\n- 代码并未固定在地址上。避免使用其地址可以用不同代码重新部署的 authenticator；节点缓存必须以代码哈希为键。\n- 两个 `AUTHENTICATOR` 签名（例如发送方加赞助方）花费 105,200 gas，超过了 EIP-8141 的 100,000 `MAX_VERIFY_GAS` mempool 限制，因此这类交易可能在链上有效，却不会被公开传播。\n- 非空的显式 `msg` 不一定承诺了该交易；除非账户自己验证该承诺，否则必须在批准时拒绝它。\n"}}}
