{"eip":1895,"title":"Support for an Elliptic Curve Cycle","description":"The EVM currently supports elliptic curves operations for curve alt-bn128 thanks to precompiles ecadd and ecmul and ecpairing. The classes MNT4 and 6 contain cycles of curves. Those cycles enable doing operations on one curve inside a SNARK on the other curve (and reversely).","authors":["Alexandre Belling \u003calexandrebelling8@gmail.com\u003e"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2018-03-31","discussionsTo":"https://ethresear.ch/t/reducing-the-verification-cost-of-a-snark-through-hierarchical-aggregation/5128","repo":"EIPs","label":"EIP-1895","officialUrl":"https://eips.ethereum.org/EIPS/eip-1895","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1895.md","url":"https://eips.huatuo.xyz/eip-1895/","tldr":{"en":"Proposed EVM precompiles for addition, multiplication and pairings on the MNT4 curve, part of a pairing-friendly curve cycle that would let SNARKs verify other SNARKs recursively.","ja":"MNT4 曲線上での加算、乗算、ペアリングを行う EVM プリコンパイルを提案した。SNARK が他の SNARK を再帰的に検証できるようにする、ペアリングフレンドリーな曲線サイクルの一部。","ko":"MNT4 곡선에서의 덧셈, 곱셈, 페어링을 위한 EVM 프리컴파일을 제안했다. SNARK가 다른 SNARK를 재귀적으로 검증할 수 있게 하는, 페어링 친화적 곡선 사이클의 일부다.","zh":"提议在 MNT4 曲线上提供加法、乘法和配对的 EVM 预编译，它是配对友好曲线环的一部分，可让 SNARK 递归地验证其他 SNARK。"},"tags":["precompile","cryptography","zk-snark","elliptic-curves","core"],"explainers":{"en":{"lang":"en","tldr":"Proposed EVM precompiles for addition, multiplication and pairings on the MNT4 curve, part of a pairing-friendly curve cycle that would let SNARKs verify other SNARKs recursively.","tags":["precompile","cryptography","zk-snark","elliptic-curves","core"],"related":[196,197,1962,2537],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1895/","markdown":"## What problem does it solve?\n\nThe EVM's elliptic-curve precompiles ([EIP-196](/eip-196/) add/mul and [EIP-197](/eip-197/) pairing) only support the alt_bn128 (BN254) curve. That is enough to verify a single zk-SNARK, but verifying thousands of proofs on-chain would be far too expensive.\n\n**Recursive SNARKs** solve this by proving \"I verified these proofs\" inside another proof, so many proofs collapse into one. Doing that efficiently needs a *cycle* of pairing-friendly curves, where each curve's group order matches the other's field size. BN254 has no such partner. The MNT4 and MNT6 families are the known pairing-friendly curves that form cycles, so EIP-1895 proposes adding MNT4 support to the EVM.\n\n## How it works\n\n- Three new precompiles: `ecadd`, `ecmul` and `ecpairing` on **MNT4**, mirroring the existing BN254 set.\n- The spec lists the curve parameters: prime field `p` and group order `q` of about 298 bits, the curve `Y^2 = X^3 + aX + b` with `a = 2`, generator points for G1 and G2 (G2 over a quadratic extension field).\n- Points would use a compressed encoding: the X coordinate plus a byte `s` marking the point at infinity (`0x00`) or whether Y is even (`0x02`) or odd (`0x03`).\n- Gas costs were left as \"to be estimated\" pending benchmarks.\n\n## Sample code\n\nHow a contract would call such a precompile. The address and input layout below are placeholders, because the spec never assigned them:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Mnt4Caller {\n    // Placeholder only: EIP-1895 did not assign a precompile address.\n    address constant MNT4_ADD = address(0);\n\n    function add(bytes calldata p1, bytes calldata p2) external view returns (bytes memory out) {\n        (bool ok, bytes memory ret) = MNT4_ADD.staticcall(abi.encodePacked(p1, p2));\n        require(ok, \"precompile failed\");\n        return ret;\n    }\n}\n```\n\n## Things to know\n\n- Status: **Stagnant**. The precompiles were never added to Ethereum.\n- The spec is incomplete: precompile addresses, input encoding details and gas prices are missing, and part of the G2 field definition is marked \"to be completed\".\n- The author notes the proposed MNT4 curve offers only about 80 bits of security, and that field elements exceed 256 bits.\n- A generic approach covering many curves was proposed in [EIP-1962](/eip-1962/). The curve precompiles Ethereum did eventually adopt were for BLS12-381 via [EIP-2537](/eip-2537/).\n"},"ja":{"lang":"ja","tldr":"MNT4 曲線上での加算、乗算、ペアリングを行う EVM プリコンパイルを提案した。SNARK が他の SNARK を再帰的に検証できるようにする、ペアリングフレンドリーな曲線サイクルの一部。","tags":["precompile","cryptography","zk-snark","elliptic-curves","core"],"related":[196,197,1962,2537],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1895/","markdown":"## 何を解決するのか\n\nEVM の楕円曲線プリコンパイル（[EIP-196](/eip-196/) の加算/乗算と [EIP-197](/eip-197/) のペアリング）は、alt_bn128（BN254）曲線しかサポートしていません。単一の zk-SNARK を検証するには十分ですが、何千もの証明をオンチェーンで検証するのはあまりにも高コストです。\n\n**再帰的 SNARK** は、「これらの証明を検証した」ことを別の証明の中で証明することで、多数の証明を 1 つにまとめて解決します。これを効率的に行うには、ペアリングフレンドリーな曲線の*サイクル*が必要です。そこでは各曲線の群の位数が、もう一方の体のサイズと一致します。BN254 にはそのような相方がいません。MNT4 と MNT6 のファミリーは、サイクルを形成することが知られているペアリングフレンドリーな曲線であるため、EIP-1895 は EVM への MNT4 サポートの追加を提案しています。\n\n## 仕組み\n\n- 新しいプリコンパイルが 3 つ: **MNT4** 上の `ecadd`、`ecmul`、`ecpairing`。既存の BN254 のセットを踏襲しています。\n- 仕様には曲線パラメータが記載されています。約 298 ビットの素体 `p` と群の位数 `q`、曲線 `Y^2 = X^3 + aX + b`（`a = 2`）、G1 と G2 の生成元（G2 は二次拡大体上）です。\n- 点には圧縮エンコーディングが使われます。X 座標に、無限遠点（`0x00`）か、Y が偶数（`0x02`）か奇数（`0x03`）かを示すバイト `s` を加えたものです。\n- ガスコストは、ベンチマークを待って「要見積もり」のままにされていました。\n\n## サンプルコード\n\nコントラクトがこのようなプリコンパイルをどう呼び出すかの例です。仕様ではアドレスが割り当てられていないため、以下のアドレスと入力レイアウトはプレースホルダーです。\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Mnt4Caller {\n    // Placeholder only: EIP-1895 did not assign a precompile address.\n    address constant MNT4_ADD = address(0);\n\n    function add(bytes calldata p1, bytes calldata p2) external view returns (bytes memory out) {\n        (bool ok, bytes memory ret) = MNT4_ADD.staticcall(abi.encodePacked(p1, p2));\n        require(ok, \"precompile failed\");\n        return ret;\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータス: **Stagnant**。このプリコンパイルが Ethereum に追加されることはありませんでした。\n- 仕様は未完成です。プリコンパイルのアドレス、入力エンコーディングの詳細、ガス価格が欠けており、G2 の体の定義の一部には「要補完」と記されています。\n- 作者は、提案された MNT4 曲線のセキュリティは約 80 ビット程度にすぎず、体の要素が 256 ビットを超えることを指摘しています。\n- 多くの曲線をカバーする汎用的なアプローチは [EIP-1962](/eip-1962/) で提案されました。Ethereum が最終的に採用した曲線プリコンパイルは、[EIP-2537](/eip-2537/) による BLS12-381 向けのものでした。\n"},"ko":{"lang":"ko","tldr":"MNT4 곡선에서의 덧셈, 곱셈, 페어링을 위한 EVM 프리컴파일을 제안했다. SNARK가 다른 SNARK를 재귀적으로 검증할 수 있게 하는, 페어링 친화적 곡선 사이클의 일부다.","tags":["precompile","cryptography","zk-snark","elliptic-curves","core"],"related":[196,197,1962,2537],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1895/","markdown":"## 어떤 문제를 해결하나요?\n\nEVM의 타원 곡선 프리컴파일([EIP-196](/eip-196/)의 덧셈/곱셈과 [EIP-197](/eip-197/)의 페어링)은 alt_bn128(BN254) 곡선만 지원합니다. 단일 zk-SNARK를 검증하기에는 충분하지만, 수천 개의 증명을 온체인에서 검증하기에는 비용이 너무 큽니다.\n\n**재귀적 SNARK**는 \"나는 이 증명들을 검증했다\"를 또 다른 증명 안에서 증명함으로써 이 문제를 풀고, 많은 증명을 하나로 합칩니다. 이를 효율적으로 하려면 페어링 친화적 곡선의 *사이클(cycle)*이 필요하며, 여기서는 각 곡선의 군 위수(group order)가 다른 곡선의 체(field) 크기와 일치합니다. BN254에는 그런 짝이 없습니다. MNT4와 MNT6 계열은 사이클을 이루는 것으로 알려진 페어링 친화적 곡선이므로, EIP-1895는 EVM에 MNT4 지원을 추가하자고 제안합니다.\n\n## 어떻게 동작하나요?\n\n- 세 가지 새 프리컴파일: **MNT4**에서의 `ecadd`, `ecmul`, `ecpairing`. 기존 BN254 세트를 그대로 따릅니다.\n- 명세에는 곡선 매개변수가 나열되어 있습니다. 약 298비트의 소수체 `p`와 군 위수 `q`, 곡선 `Y^2 = X^3 + aX + b`(`a = 2`), G1과 G2의 생성점(G2는 2차 확장체 위)입니다.\n- 점은 압축 인코딩을 사용합니다. X 좌표에 무한원점(`0x00`)이거나 Y가 짝수(`0x02`)인지 홀수(`0x03`)인지를 표시하는 바이트 `s`를 덧붙입니다.\n- 가스 비용은 벤치마크를 기다리며 \"추정 예정\"으로 남겨졌습니다.\n\n## 샘플 코드\n\n컨트랙트가 이런 프리컴파일을 어떻게 호출할지를 보여 줍니다. 명세가 주소를 할당한 적이 없으므로 아래의 주소와 입력 레이아웃은 자리 표시자입니다.\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Mnt4Caller {\n    // Placeholder only: EIP-1895 did not assign a precompile address.\n    address constant MNT4_ADD = address(0);\n\n    function add(bytes calldata p1, bytes calldata p2) external view returns (bytes memory out) {\n        (bool ok, bytes memory ret) = MNT4_ADD.staticcall(abi.encodePacked(p1, p2));\n        require(ok, \"precompile failed\");\n        return ret;\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태: **Stagnant**. 이 프리컴파일은 이더리움에 추가된 적이 없습니다.\n- 명세는 미완성입니다. 프리컴파일 주소, 입력 인코딩 세부 사항, 가스 가격이 빠져 있고, G2 체 정의의 일부는 \"추후 보완\"으로 표시되어 있습니다.\n- 작성자는 제안된 MNT4 곡선이 약 80비트 정도의 보안만 제공하며 체의 원소가 256비트를 넘는다고 지적합니다.\n- 여러 곡선을 아우르는 범용적 접근은 [EIP-1962](/eip-1962/)에서 제안되었습니다. 이더리움이 결국 채택한 곡선 프리컴파일은 [EIP-2537](/eip-2537/)을 통한 BLS12-381용이었습니다.\n"},"zh":{"lang":"zh","tldr":"提议在 MNT4 曲线上提供加法、乘法和配对的 EVM 预编译，它是配对友好曲线环的一部分，可让 SNARK 递归地验证其他 SNARK。","tags":["precompile","cryptography","zk-snark","elliptic-curves","core"],"related":[196,197,1962,2537],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1895/","markdown":"## 它解决什么问题？\n\nEVM 的椭圆曲线预编译（[EIP-196](/eip-196/) 的加法/乘法和 [EIP-197](/eip-197/) 的配对）只支持 alt_bn128（BN254）曲线。这足以验证单个 zk-SNARK，但在链上验证成千上万个证明则会过于昂贵。\n\n**递归 SNARK** 通过在另一个证明内部证明“我验证了这些证明”来解决这个问题，使许多证明合并成一个。要高效地做到这一点，需要一个配对友好曲线的*环（cycle）*，其中每条曲线的群阶与另一条曲线的域大小相匹配。BN254 没有这样的搭档。MNT4 和 MNT6 家族是已知能形成这种环的配对友好曲线，因此 EIP-1895 提议为 EVM 增加 MNT4 支持。\n\n## 它如何运作\n\n- 三个新的预编译：**MNT4** 上的 `ecadd`、`ecmul` 和 `ecpairing`，与现有的 BN254 那一套相对应。\n- 规范列出了曲线参数：约 298 位的素数域 `p` 和群阶 `q`，曲线 `Y^2 = X^3 + aX + b`（`a = 2`），以及 G1 和 G2 的生成元（G2 位于二次扩域上）。\n- 点将使用压缩编码：X 坐标加上一个字节 `s`，用来标记无穷远点（`0x00`），或表示 Y 是偶数（`0x02`）还是奇数（`0x03`）。\n- gas 成本在等待基准测试期间保留为“待估算”。\n\n## 示例代码\n\n合约会如何调用这样的预编译。下面的地址和输入布局只是占位符，因为规范从未分配过它们：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Mnt4Caller {\n    // Placeholder only: EIP-1895 did not assign a precompile address.\n    address constant MNT4_ADD = address(0);\n\n    function add(bytes calldata p1, bytes calldata p2) external view returns (bytes memory out) {\n        (bool ok, bytes memory ret) = MNT4_ADD.staticcall(abi.encodePacked(p1, p2));\n        require(ok, \"precompile failed\");\n        return ret;\n    }\n}\n```\n\n## 需要注意\n\n- 状态：**Stagnant**。这些预编译从未被加入以太坊。\n- 规范并不完整：缺少预编译地址、输入编码细节和 gas 价格，G2 域定义的一部分被标注为“待补全”。\n- 作者指出，所提议的 MNT4 曲线只提供约 80 位的安全性，而且域元素超过 256 位。\n- [EIP-1962](/eip-1962/) 提出了一种涵盖多种曲线的通用方案。以太坊最终采用的曲线预编译是通过 [EIP-2537](/eip-2537/) 加入的 BLS12-381。\n"}}}
