{"eip":7932,"title":"Secondary Signature Algorithms","description":"Introduces a precompile and registry for handling alternative signature algorithms","authors":["James Kempton (@SirSpudlington)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2025-04-12","discussionsTo":"https://ethereum-magicians.org/t/eip-7932-secondary-signature-algorithms/23514","repo":"EIPs","label":"EIP-7932","officialUrl":"https://eips.ethereum.org/EIPS/eip-7932","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7932.md","url":"https://eips.huatuo.xyz/eip-7932/","tldr":{"en":"Creates a registry of signature algorithms beyond secp256k1, a common address-derivation rule and a sigrecover precompile, as groundwork for post-quantum and other signature schemes.","ja":"secp256k1 以外の署名アルゴリズムのレジストリ、共通のアドレス導出ルール、sigrecover プリコンパイルを定義する。ポスト量子などの署名方式に向けた土台となる。","ko":"secp256k1 이외의 서명 알고리즘 레지스트리, 공통 주소 파생 규칙, sigrecover 프리컴파일을 만든다. 양자 내성 등 다른 서명 방식을 위한 기반 작업이다.","zh":"创建一个 secp256k1 之外的签名算法注册表、一条通用的地址派生规则以及一个 sigrecover 预编译，作为后量子及其他签名方案的基础。"},"tags":["signatures","post-quantum","precompile","core","accounts"],"explainers":{"en":{"lang":"en","tldr":"Creates a registry of signature algorithms beyond secp256k1, a common address-derivation rule and a sigrecover precompile, as groundwork for post-quantum and other signature schemes.","tags":["signatures","post-quantum","precompile","core","accounts"],"related":[4337,7702,8141],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7932/","markdown":"## What problem does it solve?\n\nEvery Ethereum externally owned account is tied to secp256k1 ECDSA. Quantum computers are expected to break that curve eventually, and many applications would also like other schemes (passkeys, BLS, post-quantum lattices). Post-quantum signatures, however, tend to have large keys, large signatures or slow verification, and each one has different quirks.\n\nAdding them one by one with bespoke rules would fragment the protocol. EIP-7932 instead defines **one registry and one interface** that future algorithm EIPs plug into, so the protocol, smart accounts and tooling can treat \"a signature\" generically.\n\n## How it works\n\n- **Algorithm interface.** Each algorithm, specified in its own EIP, defines an `ALG_TYPE` byte, a fixed signature `SIZE`, a `gas_cost` relative to secp256k1, and `validate`, `verify` (returns the signer's public key) and `merge_detached_signature` functions. Algorithm EIPs must include a security analysis, benchmarks and a discussion of malleability.\n- **Registry.** `algorithm_registry` maps a type byte to an entry, tracking which algorithms a hard fork has activated. Type `0x7F` is reserved as invalid; types must be below 127.\n- **secp256k1 is type `0x00`.** Its signature is 66 bytes (type byte + r, s, y-parity), with low-`s` enforced.\n- **Address derivation.** `0x00` keeps today's rule (`keccak(pubkey)[12:]`). Other algorithms hash `algorithm_id || public_key`, with an extra separator for 63-byte keys to avoid collisions with legacy addresses.\n- **`sigrecover` precompile** at address `0x12`. Input is `signature || signing_data`, where the first byte selects the algorithm. It charges 3000 gas plus the algorithm's penalty and returns the signer's address left-padded to 32 bytes, or empty output on failure.\n\n## Sample code\n\nCalling the precompile from Solidity with a secp256k1 signature:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\nlibrary SigRecover {\n    address constant SIGRECOVER = address(0x12);\n\n    /// sig = 0x00 || r (32) || s (32) || yParity (1)  -\u003e 66 bytes\n    function recover(bytes memory sig, bytes32 digest) internal view returns (address signer) {\n        (bool ok, bytes memory out) = SIGRECOVER.staticcall(abi.encodePacked(sig, digest));\n        require(ok \u0026\u0026 out.length == 32, \"sigrecover failed\");\n        signer = abi.decode(out, (address));\n    }\n}\n```\n\nAddress derivation, as in the spec:\n\n```python\ndef pubkey_to_address(public_key: bytes, algorithm_id: int) -\u003e bytes:\n    if algorithm_id == 0x00:\n        return keccak(public_key[1:])[12:]          # legacy secp256k1\n    if len(public_key) == 63:\n        return keccak(bytes([algorithm_id, 0x00]) + public_key)[12:]\n    return keccak(bytes([algorithm_id]) + public_key)[12:]\n```\n\n## Things to know\n\n- **Status: Draft.** The precompile address, gas values and interface may change.\n- This EIP defines only the framework and the secp256k1 entry. Actual post-quantum algorithms need their own EIPs and a hard fork.\n- A precompile (rather than a contract) is used so transaction-level verification can use the registry without entering the EVM. The authors describe it as compatible with [ERC-4337](/eip-4337/) smart accounts, which can call the precompile for consistent address derivation.\n- The spec notes that allowing more ways to derive addresses for one account may reduce that account's security; each new algorithm needs careful review.\n"},"ja":{"lang":"ja","tldr":"secp256k1 以外の署名アルゴリズムのレジストリ、共通のアドレス導出ルール、sigrecover プリコンパイルを定義する。ポスト量子などの署名方式に向けた土台となる。","tags":["signatures","post-quantum","precompile","core","accounts"],"related":[4337,7702,8141],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7932/","markdown":"## 何を解決するのか\n\nEthereum のすべての外部所有アカウントは secp256k1 の ECDSA に結び付いています。量子コンピューターはいずれこの曲線を破ると予想されており、多くのアプリケーションは他の方式（パスキー、BLS、ポスト量子の格子ベース方式）も使いたいと考えています。しかしポスト量子署名は、鍵が大きい、署名が大きい、検証が遅いといった傾向があり、それぞれ癖も異なります。\n\nこれらを独自のルールで 1 つずつ追加していくと、プロトコルが断片化してしまいます。そこで EIP-7932 は、将来のアルゴリズム EIP がつながる**1 つのレジストリと 1 つのインターフェース**を定義し、プロトコル、スマートアカウント、ツールが「署名」を汎用的に扱えるようにします。\n\n## 仕組み\n\n- **アルゴリズムのインターフェース。** 各アルゴリズムは、それぞれの EIP で仕様化され、`ALG_TYPE` バイト、固定の署名 `SIZE`、secp256k1 との相対的な `gas_cost`、そして `validate`、`verify`（署名者の公開鍵を返す）、`merge_detached_signature` 関数を定義します。アルゴリズム EIP には、セキュリティ分析、ベンチマーク、malleability に関する議論を含めなければなりません。\n- **レジストリ。** `algorithm_registry` はタイプバイトをエントリに対応付け、ハードフォークでどのアルゴリズムが有効化されたかを管理します。タイプ `0x7F` は無効として予約されており、タイプは 127 未満でなければなりません。\n- **secp256k1 はタイプ `0x00`。** その署名は 66 バイト（タイプバイト + r、s、y-parity）で、low-`s` が強制されます。\n- **アドレスの導出。** `0x00` は現在のルール（`keccak(pubkey)[12:]`）を維持します。他のアルゴリズムは `algorithm_id || public_key` をハッシュし、63 バイトの鍵にはレガシーアドレスとの衝突を避けるために追加の区切りを入れます。\n- **`sigrecover` プリコンパイル**はアドレス `0x12` にあります。入力は `signature || signing_data` で、先頭バイトがアルゴリズムを選びます。3000 gas にアルゴリズムごとのペナルティを加えて課金し、署名者のアドレスを 32 バイトに左パディングして返します。失敗時は空の出力を返します。\n\n## サンプルコード\n\nSolidity から secp256k1 署名でプリコンパイルを呼び出す例：\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\nlibrary SigRecover {\n    address constant SIGRECOVER = address(0x12);\n\n    /// sig = 0x00 || r (32) || s (32) || yParity (1)  -\u003e 66 bytes\n    function recover(bytes memory sig, bytes32 digest) internal view returns (address signer) {\n        (bool ok, bytes memory out) = SIGRECOVER.staticcall(abi.encodePacked(sig, digest));\n        require(ok \u0026\u0026 out.length == 32, \"sigrecover failed\");\n        signer = abi.decode(out, (address));\n    }\n}\n```\n\n仕様にあるアドレスの導出：\n\n```python\ndef pubkey_to_address(public_key: bytes, algorithm_id: int) -\u003e bytes:\n    if algorithm_id == 0x00:\n        return keccak(public_key[1:])[12:]          # legacy secp256k1\n    if len(public_key) == 63:\n        return keccak(bytes([algorithm_id, 0x00]) + public_key)[12:]\n    return keccak(bytes([algorithm_id]) + public_key)[12:]\n```\n\n## 知っておくべきこと\n\n- **ステータス：Draft。** プリコンパイルのアドレス、gas の値、インターフェースは変わる可能性があります。\n- この EIP が定義するのは、枠組みと secp256k1 のエントリだけです。実際のポスト量子アルゴリズムには、それぞれの EIP とハードフォークが必要です。\n- トランザクションレベルの検証が EVM に入らずにレジストリを使えるようにするため、（コントラクトではなく）プリコンパイルが使われます。著者は、これを [ERC-4337](/eip-4337/) のスマートアカウントと互換性があるとしており、スマートアカウントはプリコンパイルを呼び出して一貫したアドレス導出を行えます。\n- 仕様は、1 つのアカウントに対してアドレスを導出する方法を増やすと、そのアカウントのセキュリティが低下する可能性があると指摘しています。新しいアルゴリズムはそれぞれ慎重なレビューが必要です。\n"},"ko":{"lang":"ko","tldr":"secp256k1 이외의 서명 알고리즘 레지스트리, 공통 주소 파생 규칙, sigrecover 프리컴파일을 만든다. 양자 내성 등 다른 서명 방식을 위한 기반 작업이다.","tags":["signatures","post-quantum","precompile","core","accounts"],"related":[4337,7702,8141],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7932/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움의 모든 외부 소유 계정은 secp256k1 ECDSA에 묶여 있습니다. 양자 컴퓨터가 결국 이 곡선을 깰 것으로 예상되고, 많은 애플리케이션이 다른 방식(패스키, BLS, 양자 내성 격자 기반)도 쓰고 싶어 합니다. 하지만 양자 내성 서명은 키가 크거나, 서명이 크거나, 검증이 느린 경향이 있고 방식마다 특성도 다릅니다.\n\n이들을 맞춤 규칙으로 하나씩 추가하면 프로토콜이 파편화됩니다. 그래서 EIP-7932는 앞으로의 알고리즘 EIP가 끼워 넣을 **하나의 레지스트리와 하나의 인터페이스**를 정의해, 프로토콜, 스마트 계정, 도구가 \"서명\"을 일반적으로 다룰 수 있게 합니다.\n\n## 어떻게 동작하나요?\n\n- **알고리즘 인터페이스.** 각 알고리즘은 자체 EIP에서 명세되며, `ALG_TYPE` 바이트, 고정된 서명 `SIZE`, secp256k1 대비 `gas_cost`, 그리고 `validate`, `verify`(서명자의 공개키를 반환), `merge_detached_signature` 함수를 정의합니다. 알고리즘 EIP에는 보안 분석, 벤치마크, 가변성(malleability)에 대한 논의가 포함되어야 합니다.\n- **레지스트리.** `algorithm_registry`는 타입 바이트를 항목에 매핑하며, 하드포크가 어떤 알고리즘을 활성화했는지 추적합니다. 타입 `0x7F`는 무효로 예약되어 있고, 타입은 127보다 작아야 합니다.\n- **secp256k1은 타입 `0x00`입니다.** 서명은 66바이트(타입 바이트 + r, s, y-parity)이며 low-`s`가 강제됩니다.\n- **주소 파생.** `0x00`은 현재 규칙(`keccak(pubkey)[12:]`)을 유지합니다. 다른 알고리즘은 `algorithm_id || public_key`를 해시하며, 63바이트 키에는 레거시 주소와의 충돌을 피하기 위해 구분자를 하나 더 둡니다.\n- **`sigrecover` 프리컴파일**은 주소 `0x12`에 있습니다. 입력은 `signature || signing_data`이고 첫 바이트가 알고리즘을 선택합니다. 3000 gas에 알고리즘별 페널티를 더해 부과하고, 32바이트로 왼쪽 패딩한 서명자 주소를 반환하며, 실패하면 빈 출력을 반환합니다.\n\n## 샘플 코드\n\nSolidity에서 secp256k1 서명으로 프리컴파일 호출하기:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\nlibrary SigRecover {\n    address constant SIGRECOVER = address(0x12);\n\n    /// sig = 0x00 || r (32) || s (32) || yParity (1)  -\u003e 66 bytes\n    function recover(bytes memory sig, bytes32 digest) internal view returns (address signer) {\n        (bool ok, bytes memory out) = SIGRECOVER.staticcall(abi.encodePacked(sig, digest));\n        require(ok \u0026\u0026 out.length == 32, \"sigrecover failed\");\n        signer = abi.decode(out, (address));\n    }\n}\n```\n\n스펙의 주소 파생:\n\n```python\ndef pubkey_to_address(public_key: bytes, algorithm_id: int) -\u003e bytes:\n    if algorithm_id == 0x00:\n        return keccak(public_key[1:])[12:]          # legacy secp256k1\n    if len(public_key) == 63:\n        return keccak(bytes([algorithm_id, 0x00]) + public_key)[12:]\n    return keccak(bytes([algorithm_id]) + public_key)[12:]\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 프리컴파일 주소, gas 값, 인터페이스는 바뀔 수 있습니다.\n- 이 EIP는 프레임워크와 secp256k1 항목만 정의합니다. 실제 양자 내성 알고리즘에는 각자의 EIP와 하드포크가 필요합니다.\n- (컨트랙트가 아니라) 프리컴파일을 쓰는 이유는 트랜잭션 수준 검증이 EVM에 들어가지 않고도 레지스트리를 사용할 수 있게 하기 위해서입니다. 저자들은 이것이 [ERC-4337](/eip-4337/) 스마트 계정과 호환된다고 설명하며, 스마트 계정은 프리컴파일을 호출해 일관된 주소 파생을 얻을 수 있습니다.\n- 스펙은 한 계정에 대해 주소를 파생하는 방법을 더 허용하면 그 계정의 보안이 낮아질 수 있다고 지적합니다. 새 알고리즘마다 신중한 검토가 필요합니다.\n"},"zh":{"lang":"zh","tldr":"创建一个 secp256k1 之外的签名算法注册表、一条通用的地址派生规则以及一个 sigrecover 预编译，作为后量子及其他签名方案的基础。","tags":["signatures","post-quantum","precompile","core","accounts"],"related":[4337,7702,8141],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7932/","markdown":"## 它解决什么问题？\n\n以太坊的每个外部拥有账户都绑定在 secp256k1 ECDSA 上。预计量子计算机最终会破解这条曲线，许多应用也希望使用其他方案（passkey、BLS、后量子格密码）。然而后量子签名往往密钥大、签名大或验证慢，而且每一种都有各自的特点。\n\n用各自定制的规则逐个添加它们，会让协议碎片化。因此 EIP-7932 定义了**一个注册表和一个接口**，供未来的算法 EIP 接入，使协议、智能账户和工具可以通用地处理“一个签名”。\n\n## 它如何运作\n\n- **算法接口。** 每个算法在各自的 EIP 中规定，并定义一个 `ALG_TYPE` 字节、固定的签名 `SIZE`、相对于 secp256k1 的 `gas_cost`，以及 `validate`、`verify`（返回签名者的公钥）和 `merge_detached_signature` 函数。算法 EIP 必须包含安全分析、基准测试以及对可延展性（malleability）的讨论。\n- **注册表。** `algorithm_registry` 把类型字节映射到条目，记录某次硬分叉激活了哪些算法。类型 `0x7F` 保留为无效；类型必须小于 127。\n- **secp256k1 是类型 `0x00`。** 其签名为 66 字节（类型字节 + r、s、y-parity），并强制使用 low-`s`。\n- **地址派生。** `0x00` 保持现行规则（`keccak(pubkey)[12:]`）。其他算法对 `algorithm_id || public_key` 做哈希，对 63 字节的密钥额外加一个分隔符，以避免与传统地址冲突。\n- **`sigrecover` 预编译**位于地址 `0x12`。输入为 `signature || signing_data`，其中第一个字节选择算法。它收取 3000 gas 加上该算法的附加费用，并返回左填充到 32 字节的签名者地址，失败时返回空输出。\n\n## 示例代码\n\n在 Solidity 中使用 secp256k1 签名调用该预编译：\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\nlibrary SigRecover {\n    address constant SIGRECOVER = address(0x12);\n\n    /// sig = 0x00 || r (32) || s (32) || yParity (1)  -\u003e 66 bytes\n    function recover(bytes memory sig, bytes32 digest) internal view returns (address signer) {\n        (bool ok, bytes memory out) = SIGRECOVER.staticcall(abi.encodePacked(sig, digest));\n        require(ok \u0026\u0026 out.length == 32, \"sigrecover failed\");\n        signer = abi.decode(out, (address));\n    }\n}\n```\n\n规范中的地址派生：\n\n```python\ndef pubkey_to_address(public_key: bytes, algorithm_id: int) -\u003e bytes:\n    if algorithm_id == 0x00:\n        return keccak(public_key[1:])[12:]          # legacy secp256k1\n    if len(public_key) == 63:\n        return keccak(bytes([algorithm_id, 0x00]) + public_key)[12:]\n    return keccak(bytes([algorithm_id]) + public_key)[12:]\n```\n\n## 需要注意\n\n- **状态：Draft。** 预编译地址、gas 数值和接口都可能变化。\n- 本 EIP 只定义框架和 secp256k1 条目。实际的后量子算法需要各自的 EIP 和一次硬分叉。\n- 之所以使用预编译（而不是合约），是为了让交易级验证无需进入 EVM 就能使用注册表。作者称其与 [ERC-4337](/eip-4337/) 智能账户兼容，后者可以调用该预编译以获得一致的地址派生。\n- 规范指出，为同一个账户允许更多种地址派生方式，可能会降低该账户的安全性；每个新算法都需要仔细审查。\n"}},"requiredBy":[6404,7980,8030,8051,8052]}
