{"eip":1962,"title":"EC arithmetic and pairings with runtime definitions","description":"This proposal is an extension and formalization of EIP-1829 with an inclusion of pairings. EIP-1109 is required due to low cost of some operations compared to the STATICCALL opcode (more information in the corresponding section below).","authors":["Alex Vlasov (@shamatar)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2019-04-22","requires":[1109],"discussionsTo":"https://ethereum-magicians.org/t/generalised-precompile-for-elliptic-curve-arithmetics-and-pairings-working-group/3208/2","repo":"EIPs","label":"EIP-1962","officialUrl":"https://eips.ethereum.org/EIPS/eip-1962","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1962.md","url":"https://eips.huatuo.xyz/eip-1962/","tldr":{"en":"Proposed one generic set of EVM precompiles for elliptic-curve arithmetic and pairings where the curve parameters are supplied at call time, so new curves would not need a hard fork.","ja":"曲線パラメータを呼び出し時に渡す形で、楕円曲線演算とペアリングを汎用的に扱う EVM プリコンパイルのセットを提案したもの。新しい曲線を追加するためにハードフォークが要らなくなる。","ko":"곡선 매개변수를 호출 시점에 넘기는 방식으로 타원곡선 연산과 페어링을 처리하는 범용 EVM 프리컴파일 묶음을 제안했다. 새 곡선을 추가하려고 하드포크를 할 필요가 없어진다.","zh":"提出一组通用的 EVM 预编译，用于椭圆曲线运算和配对，曲线参数在调用时传入，这样新增曲线就不需要硬分叉。"},"tags":["precompile","cryptography","elliptic-curves","pairings","core"],"explainers":{"en":{"lang":"en","tldr":"Proposed one generic set of EVM precompiles for elliptic-curve arithmetic and pairings where the curve parameters are supplied at call time, so new curves would not need a hard fork.","tags":["precompile","cryptography","elliptic-curves","pairings","core"],"related":[1829,1109,2537,196,197],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1962/","markdown":"## What problem does it solve?\n\nPrivacy and scaling protocols rely on elliptic-curve operations and pairings, but the EVM only had precompiles for one curve, BN254 (addresses `0x06`–`0x08`). Every additional curve, such as BLS12-381 or curves suited to recursive proofs, would need its own EIP and hard fork.\n\nEIP-1962 proposed precompiles where the curve is a **runtime input**: the caller passes the field modulus, coefficients and extension structure along with the points. Developers could then use, and experiment with, new curves without waiting for a network upgrade. It extends [EIP-1829](/eip-1829/) by adding pairings.\n\n## How it works\n\nThe spec defines ten operations:\n\n- On curves over the base field: point addition, scalar multiplication, and multi-exponentiation over N (scalar, point) pairs.\n- The same three operations on curves over quadratic or cubic extension fields (needed for G2).\n- Pairings for four curve families: **BLS12**, **BN**, **MNT4** and **MNT6**.\n\nKey design choices:\n\n- Gas is estimated from the supplied parameters (modulus size, operation type, number of pairs) as early as possible, so nodes can reject over-priced calls quickly.\n- Multi-exponentiation is its own operation because it is much cheaper than repeated multiplications.\n- No point decompression, because square-root cost is hard to price generically.\n- It requires [EIP-1109](/eip-1109/) (`PRECOMPILEDCALL`), since the 700-gas `STATICCALL` cost at the time would dominate cheap operations such as point addition.\n\nAs fallbacks the spec suggests starting with a fixed whitelist of curves (BN254, BLS12-381, BLS12-377 and others).\n\n## Sample code\n\nCalling a generic precompile from Solidity. The address and byte layout are placeholders: the spec delegates the ABI and gas schedule to an external document and left addresses unassigned:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract GenericCurveCaller {\n    address constant EC_PRECOMPILE = address(0); // not assigned by EIP-1962\n\n    function call(bytes calldata curveParamsAndInput) external view returns (bytes memory) {\n        // input = operation id || field modulus || A || B || group order || points/scalars ...\n        (bool ok, bytes memory out) = EC_PRECOMPILE.staticcall(curveParamsAndInput);\n        require(ok, \"EC op failed\");\n        return out;\n    }\n}\n```\n\n## Things to know\n\n- Status: **Stagnant**. It was not included in any upgrade.\n- The detailed binary interface and gas schedule live outside the EIP, in the implementation's documentation, so the EIP alone is not a complete spec.\n- Ethereum instead adopted fixed-curve precompiles for BLS12-381 via [EIP-2537](/eip-2537/), trading flexibility for simpler implementation and pricing.\n- The spec itself flags the difficulty of implementing, debugging and pricing such generic operations, and suggests limiting the initial set of curves.\n"},"ja":{"lang":"ja","tldr":"曲線パラメータを呼び出し時に渡す形で、楕円曲線演算とペアリングを汎用的に扱う EVM プリコンパイルのセットを提案したもの。新しい曲線を追加するためにハードフォークが要らなくなる。","tags":["precompile","cryptography","elliptic-curves","pairings","core"],"related":[1829,1109,2537,196,197],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1962/","markdown":"## 何を解決するのか\n\nプライバシーやスケーリングのプロトコルは楕円曲線演算とペアリングに依存しますが、EVM には 1 つの曲線 BN254（アドレス `0x06`〜`0x08`）のプリコンパイルしかありませんでした。BLS12-381 や再帰的証明に向いた曲線など、曲線を 1 つ追加するたびに専用の EIP とハードフォークが必要になります。\n\nEIP-1962 は、曲線を**実行時の入力**とするプリコンパイルを提案しました。呼び出し側が、点と一緒に体の法、係数、拡大体の構造を渡します。これにより、ネットワークアップグレードを待たずに新しい曲線を使ったり試したりできます。[EIP-1829](/eip-1829/) を拡張してペアリングを加えたものです。\n\n## 仕組み\n\n仕様は 10 個の演算を定義しています。\n\n- 基礎体上の曲線：点の加算、スカラー倍算、N 個の（スカラー, 点）の組に対する多重べき乗（multi-exponentiation）。\n- 2 次または 3 次の拡大体上の曲線での同じ 3 つの演算（G2 に必要）。\n- 4 つの曲線ファミリー **BLS12**、**BN**、**MNT4**、**MNT6** のペアリング。\n\n主な設計上の選択：\n\n- ガスは、渡されたパラメータ（法のサイズ、演算の種類、ペアの数）から可能な限り早い段階で見積もられます。これにより、ノードは割高な呼び出しをすばやく拒否できます。\n- 多重べき乗は、スカラー倍算を繰り返すよりはるかに安いため、独立した演算になっています。\n- 点の展開（decompression）はありません。平方根のコストを汎用的に価格付けするのが難しいためです。\n- [EIP-1109](/eip-1109/)（`PRECOMPILEDCALL`）が必要です。当時の `STATICCALL` のコスト 700 ガスが、点の加算のような安価な演算では支配的になってしまうためです。\n\nフォールバックとして、仕様は固定の曲線ホワイトリスト（BN254、BLS12-381、BLS12-377 など）から始めることを提案しています。\n\n## サンプルコード\n\nSolidity から汎用プリコンパイルを呼び出す例です。アドレスとバイトレイアウトはプレースホルダーです。仕様は ABI とガススケジュールを外部ドキュメントに委ねており、アドレスは未割り当てのままでした。\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract GenericCurveCaller {\n    address constant EC_PRECOMPILE = address(0); // not assigned by EIP-1962\n\n    function call(bytes calldata curveParamsAndInput) external view returns (bytes memory) {\n        // input = operation id || field modulus || A || B || group order || points/scalars ...\n        (bool ok, bytes memory out) = EC_PRECOMPILE.staticcall(curveParamsAndInput);\n        require(ok, \"EC op failed\");\n        return out;\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータス：**Stagnant**。どのアップグレードにも含まれませんでした。\n- 詳細なバイナリインターフェースとガススケジュールは EIP の外、実装側のドキュメントにあります。そのため、この EIP だけでは完全な仕様になりません。\n- Ethereum は代わりに、[EIP-2537](/eip-2537/) で BLS12-381 向けの固定曲線プリコンパイルを採用しました。柔軟性を手放して、実装と価格付けを単純にしています。\n- 仕様自身が、このような汎用演算の実装・デバッグ・価格付けの難しさを指摘しており、最初の曲線セットを限定することを提案しています。\n"},"ko":{"lang":"ko","tldr":"곡선 매개변수를 호출 시점에 넘기는 방식으로 타원곡선 연산과 페어링을 처리하는 범용 EVM 프리컴파일 묶음을 제안했다. 새 곡선을 추가하려고 하드포크를 할 필요가 없어진다.","tags":["precompile","cryptography","elliptic-curves","pairings","core"],"related":[1829,1109,2537,196,197],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1962/","markdown":"## 어떤 문제를 해결하나요?\n\n프라이버시와 확장성 프로토콜은 타원곡선 연산과 페어링에 의존하지만, EVM에는 곡선 하나인 BN254(주소 `0x06`–`0x08`)용 프리컴파일만 있었습니다. BLS12-381이나 재귀 증명에 적합한 곡선 같은 곡선을 하나 추가할 때마다 별도의 EIP와 하드포크가 필요합니다.\n\nEIP-1962는 곡선을 **런타임 입력**으로 받는 프리컴파일을 제안했습니다. 호출자가 점과 함께 체의 모듈러스, 계수, 확장체 구조를 넘깁니다. 그러면 개발자는 네트워크 업그레이드를 기다리지 않고도 새 곡선을 쓰고 실험할 수 있습니다. [EIP-1829](/eip-1829/)에 페어링을 더해 확장한 것입니다.\n\n## 어떻게 동작하나요?\n\n명세는 열 가지 연산을 정의합니다.\n\n- 기저체 위의 곡선: 점 덧셈, 스칼라 곱셈, N개의 (스칼라, 점) 쌍에 대한 다중 거듭제곱(multi-exponentiation).\n- 2차 또는 3차 확장체 위의 곡선에서의 같은 세 연산(G2에 필요).\n- 네 가지 곡선 계열 **BLS12**, **BN**, **MNT4**, **MNT6**의 페어링.\n\n주요 설계 선택:\n\n- 가스는 전달된 매개변수(모듈러스 크기, 연산 종류, 쌍의 개수)로부터 가능한 한 일찍 추정되므로, 노드는 가격이 과하게 책정된 호출을 빠르게 거부할 수 있습니다.\n- 다중 거듭제곱은 스칼라 곱셈을 반복하는 것보다 훨씬 저렴하기 때문에 별도의 연산입니다.\n- 점 압축 해제(decompression)는 없습니다. 제곱근 비용을 범용적으로 책정하기 어렵기 때문입니다.\n- [EIP-1109](/eip-1109/)(`PRECOMPILEDCALL`)가 필요합니다. 당시 `STATICCALL`의 700 가스 비용이 점 덧셈 같은 저렴한 연산에서는 대부분을 차지하게 되기 때문입니다.\n\n대안으로, 명세는 고정된 곡선 화이트리스트(BN254, BLS12-381, BLS12-377 등)로 시작할 것을 제안합니다.\n\n## 샘플 코드\n\nSolidity에서 범용 프리컴파일을 호출하는 예시입니다. 주소와 바이트 레이아웃은 자리 표시자입니다. 명세는 ABI와 가스 일정을 외부 문서에 맡겼고 주소도 할당하지 않았습니다.\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract GenericCurveCaller {\n    address constant EC_PRECOMPILE = address(0); // not assigned by EIP-1962\n\n    function call(bytes calldata curveParamsAndInput) external view returns (bytes memory) {\n        // input = operation id || field modulus || A || B || group order || points/scalars ...\n        (bool ok, bytes memory out) = EC_PRECOMPILE.staticcall(curveParamsAndInput);\n        require(ok, \"EC op failed\");\n        return out;\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태: **Stagnant**. 어떤 업그레이드에도 포함되지 않았습니다.\n- 상세한 바이너리 인터페이스와 가스 일정은 EIP 밖, 구현체의 문서에 있습니다. 따라서 이 EIP만으로는 완전한 명세가 아닙니다.\n- 이더리움은 대신 [EIP-2537](/eip-2537/)로 BLS12-381용 고정 곡선 프리컴파일을 채택했습니다. 유연성을 포기하는 대신 구현과 가격 책정을 단순하게 만든 것입니다.\n- 명세 자체도 이러한 범용 연산을 구현하고 디버깅하고 가격을 매기는 일의 어려움을 지적하며, 초기 곡선 집합을 제한할 것을 제안합니다.\n"},"zh":{"lang":"zh","tldr":"提出一组通用的 EVM 预编译，用于椭圆曲线运算和配对，曲线参数在调用时传入，这样新增曲线就不需要硬分叉。","tags":["precompile","cryptography","elliptic-curves","pairings","core"],"related":[1829,1109,2537,196,197],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1962/","markdown":"## 它解决什么问题？\n\n隐私和扩容协议依赖椭圆曲线运算和配对，但 EVM 只为一条曲线 BN254 提供了预编译（地址 `0x06`–`0x08`）。每增加一条曲线，例如 BLS12-381 或适合递归证明的曲线，都需要单独的 EIP 和一次硬分叉。\n\nEIP-1962 提出的预编译把曲线作为**运行时输入**：调用者在传入点的同时，传入域模数、系数和扩域结构。这样开发者无需等待网络升级，就可以使用和试验新曲线。它在 [EIP-1829](/eip-1829/) 的基础上加入了配对。\n\n## 它如何运作\n\n该规范定义了十种运算：\n\n- 基域上的曲线：点加法、标量乘法，以及对 N 个（标量，点）对的多标量乘法（multi-exponentiation）。\n- 二次或三次扩域上曲线的同样三种运算（G2 需要）。\n- 四个曲线族的配对：**BLS12**、**BN**、**MNT4** 和 **MNT6**。\n\n主要设计选择：\n\n- gas 根据传入的参数（模数大小、运算类型、配对数量）尽早估算，这样节点可以快速拒绝定价过高的调用。\n- 多标量乘法单独作为一种运算，因为它比重复做标量乘法便宜得多。\n- 不支持点解压缩，因为平方根的成本很难通用地定价。\n- 它依赖 [EIP-1109](/eip-1109/)（`PRECOMPILEDCALL`），因为当时 `STATICCALL` 700 gas 的成本会在点加法这类廉价运算中占据主导。\n\n作为备选方案，该规范建议先从一份固定的曲线白名单（BN254、BLS12-381、BLS12-377 等）开始。\n\n## 示例代码\n\n从 Solidity 调用一个通用预编译。地址和字节布局只是占位符：规范把 ABI 和 gas 计划交给了外部文档，并且没有分配地址：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract GenericCurveCaller {\n    address constant EC_PRECOMPILE = address(0); // not assigned by EIP-1962\n\n    function call(bytes calldata curveParamsAndInput) external view returns (bytes memory) {\n        // input = operation id || field modulus || A || B || group order || points/scalars ...\n        (bool ok, bytes memory out) = EC_PRECOMPILE.staticcall(curveParamsAndInput);\n        require(ok, \"EC op failed\");\n        return out;\n    }\n}\n```\n\n## 需要注意\n\n- 状态：**Stagnant**。它没有被纳入任何升级。\n- 详细的二进制接口和 gas 计划位于 EIP 之外，即实现方的文档中，因此仅凭这份 EIP 并不是完整的规范。\n- 以太坊最终通过 [EIP-2537](/eip-2537/) 采用了针对 BLS12-381 的固定曲线预编译，以灵活性换取更简单的实现和定价。\n- 规范本身指出了实现、调试和定价这类通用运算的难度，并建议限制初始支持的曲线集合。\n"}}}
