{"eip":2539,"title":"BLS12-377 curve operations","description":"Precompiles for BLS12-377 curve operations","authors":["Alex Vlasov (@shamatar)","hujw77 (@hujw77)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2020-02-26","requires":[1109,2046],"discussionsTo":"https://ethereum-magicians.org/t/eip-2539-bls12-377-precompile-discussion-thread/4659","repo":"EIPs","label":"EIP-2539","officialUrl":"https://eips.ethereum.org/EIPS/eip-2539","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2539.md","url":"https://eips.huatuo.xyz/eip-2539/","tldr":{"en":"A stagnant proposal for nine precompiles performing arithmetic and pairings on the BLS12-377 curve, aimed at cheap BLS signature checks and recursive SNARK verification.","ja":"BLS12-377 曲線上の演算とペアリングを行う 9 つのプリコンパイルの、停滞中の提案。低コストな BLS 署名検証と再帰的 SNARK 検証を狙う。","ko":"BLS12-377 곡선에서 연산과 페어링을 수행하는 프리컴파일 아홉 개에 대한, 정체된 제안. 저렴한 BLS 서명 검증과 재귀 SNARK 검증을 겨냥한다.","zh":"一项已停滞的提案：新增九个在 BLS12-377 曲线上执行运算和配对的预编译，目标是低成本的 BLS 签名检查和递归 SNARK 验证。"},"tags":["core","precompile","cryptography","bls","zk","stagnant"],"explainers":{"en":{"lang":"en","tldr":"A stagnant proposal for nine precompiles performing arithmetic and pairings on the BLS12-377 curve, aimed at cheap BLS signature checks and recursive SNARK verification.","tags":["core","precompile","cryptography","bls","zk","stagnant"],"related":[2537,1109,2046,196,197],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-2539/","markdown":"## What problem does it solve?\n\nEthereum's original pairing precompiles ([EIP-196](/eip-196/), [EIP-197](/eip-197/)) work on the BN254 curve, whose security the spec puts at roughly 80 bits. Protocols that want stronger, modern pairing-friendly curves had to implement them in Solidity, which is far too expensive.\n\nBLS12-377 (from the Zexe paper) offers 120+ bits of security and has a special property: pairings over it can be checked efficiently inside another SNARK. That makes it attractive for one-step recursive proof aggregation and for verifying BLS signatures produced by systems built on this curve.\n\n## How it works\n\nThe proposal adds nine precompiles at proposed addresses `0x15`–`0x1d`:\n\n| Precompile | Operation |\n| --- | --- |\n| `G1ADD`, `G1MUL`, `G1MULTIEXP` | Add, scalar-multiply, multi-scalar-multiply points in G1 |\n| `G2ADD`, `G2MUL`, `G2MULTIEXP` | Same operations in G2 (over Fp2) |\n| `PAIRING` | Check whether the product of pairings of `k` (G1, G2) pairs is 1 |\n| `MAP_FP_TO_G1`, `MAP_FP2_TO_G2` | Map a field element to a curve point (for hash-to-curve) |\n\nEncoding follows the same pattern as the BLS12-381 precompile proposal:\n\n- A base-field element is 64 bytes, big-endian, with the top 16 bytes zero (keeps 32-byte ABI alignment). An Fp2 element is two of these (128 bytes).\n- A G1 point is 128 bytes (`x || y`), a G2 point 256 bytes. `(0, 0)` encodes the point at infinity.\n- Scalars are 32 bytes and need not be reduced modulo the group order.\n- Pairing input is `k` slices of 384 bytes; output is 32 bytes ending in `0x01` (true) or `0x00`. Subgroup checks are mandatory for pairing inputs.\n\nProposed gas: G1ADD 600, G1MUL 12000, G2ADD 4500, G2MUL 55000, pairing `55000*k + 65000`, map-to-G1 5500, map-to-G2 75000. Multi-exponentiation gets a discount table for larger `k`. Any error must consume all gas supplied to the call.\n\n## Sample code\n\nCalling the proposed G1 addition precompile from Solidity (illustrative: the address is only proposed and is not active on mainnet):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nlibrary BLS12377 {\n    address constant G1ADD = address(0x15); // proposed, not deployed\n\n    // p and q are 128-byte encoded G1 points (x||y, each 64 bytes big-endian)\n    function g1Add(bytes memory p, bytes memory q) internal view returns (bytes memory out) {\n        require(p.length == 128 \u0026\u0026 q.length == 128, \"bad length\");\n        (bool ok, bytes memory res) = G1ADD.staticcall(bytes.concat(p, q));\n        require(ok \u0026\u0026 res.length == 128, \"G1ADD failed\");\n        return res;\n    }\n}\n```\n\n## Things to know\n\n- Status: **Stagnant**. It has not been scheduled for any network upgrade.\n- The related BLS12-381 precompiles of [EIP-2537](/eip-2537/) are the ones that were adopted on Ethereum (in the Pectra upgrade). If you need BLS on mainnet, that is the curve available.\n- The spec explicitly does **not** require constant-time implementations.\n- It builds on [EIP-1109](/eip-1109/) (cheaper precompile calls) and [EIP-2046](/eip-2046/) (reduced STATICCALL cost to precompiles), both of which it lists as requirements and both of which are themselves stagnant.\n"},"ja":{"lang":"ja","tldr":"BLS12-377 曲線上の演算とペアリングを行う 9 つのプリコンパイルの、停滞中の提案。低コストな BLS 署名検証と再帰的 SNARK 検証を狙う。","tags":["core","precompile","cryptography","bls","zk","stagnant"],"related":[2537,1109,2046,196,197],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-2539/","markdown":"## 何を解決するのか\n\nEthereum 最初のペアリング用プリコンパイル（[EIP-196](/eip-196/)、[EIP-197](/eip-197/)）は BN254 曲線上で動作し、仕様はその安全性をおよそ 80 ビットとしています。より強力で現代的なペアリングフレンドリーな曲線を使いたいプロトコルは、それらを Solidity で実装する必要がありましたが、それはあまりにも高コストです。\n\nBLS12-377（Zexe 論文由来）は 120 ビット以上の安全性を提供し、その上のペアリングを別の SNARK の内部で効率的に検証できるという特別な性質があります。そのため、1 段階の再帰的な証明集約や、この曲線上に構築されたシステムが生成する BLS 署名の検証に魅力的です。\n\n## 仕組み\n\nこの提案は、`0x15`〜`0x1d` の提案アドレスに 9 つのプリコンパイルを追加します。\n\n| プリコンパイル | 演算 |\n| --- | --- |\n| `G1ADD`、`G1MUL`、`G1MULTIEXP` | G1 上の点の加算、スカラー倍、マルチスカラー倍 |\n| `G2ADD`、`G2MUL`、`G2MULTIEXP` | G2（Fp2 上）での同じ演算 |\n| `PAIRING` | `k` 個の (G1, G2) ペアのペアリングの積が 1 かどうかを確認 |\n| `MAP_FP_TO_G1`、`MAP_FP2_TO_G2` | 体の元を曲線上の点に写像（hash-to-curve 用） |\n\nエンコーディングは BLS12-381 プリコンパイル提案と同じパターンに従います。\n\n- 基礎体の元は 64 バイトのビッグエンディアンで、上位 16 バイトはゼロです（32 バイトの ABI アラインメントを保つため）。Fp2 の元はこれが 2 つ（128 バイト）です。\n- G1 の点は 128 バイト（`x || y`）、G2 の点は 256 バイトです。`(0, 0)` は無限遠点をエンコードします。\n- スカラーは 32 バイトで、群の位数で剰余を取って縮約されている必要はありません。\n- ペアリングの入力は 384 バイトのスライス `k` 個で、出力は末尾が `0x01`（真）または `0x00` の 32 バイトです。ペアリングの入力では部分群チェックが必須です。\n\n提案されているガス: G1ADD 600、G1MUL 12000、G2ADD 4500、G2MUL 55000、ペアリング `55000*k + 65000`、map-to-G1 5500、map-to-G2 75000。マルチ指数演算には、大きな `k` 向けの割引テーブルがあります。エラーが起きた場合は、呼び出しに渡されたガスをすべて消費しなければなりません。\n\n## サンプルコード\n\nSolidity から、提案されている G1 加算プリコンパイルを呼び出す例（説明用。アドレスは提案されているだけで、メインネットでは有効ではありません）:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nlibrary BLS12377 {\n    address constant G1ADD = address(0x15); // proposed, not deployed\n\n    // p and q are 128-byte encoded G1 points (x||y, each 64 bytes big-endian)\n    function g1Add(bytes memory p, bytes memory q) internal view returns (bytes memory out) {\n        require(p.length == 128 \u0026\u0026 q.length == 128, \"bad length\");\n        (bool ok, bytes memory res) = G1ADD.staticcall(bytes.concat(p, q));\n        require(ok \u0026\u0026 res.length == 128, \"G1ADD failed\");\n        return res;\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータス: **Stagnant**。どのネットワークアップグレードにも予定されていません。\n- Ethereum で採用された（Pectra アップグレードで）のは、関連する [EIP-2537](/eip-2537/) の BLS12-381 プリコンパイルです。メインネットで BLS が必要な場合は、その曲線を使うことになります。\n- 仕様は、定数時間の実装を要求**しない**と明記しています。\n- [EIP-1109](/eip-1109/)（プリコンパイル呼び出しの低コスト化）と [EIP-2046](/eip-2046/)（プリコンパイルへの STATICCALL コストの削減）に依拠しており、両方を要件として挙げています。どちらも自身が Stagnant です。\n"},"ko":{"lang":"ko","tldr":"BLS12-377 곡선에서 연산과 페어링을 수행하는 프리컴파일 아홉 개에 대한, 정체된 제안. 저렴한 BLS 서명 검증과 재귀 SNARK 검증을 겨냥한다.","tags":["core","precompile","cryptography","bls","zk","stagnant"],"related":[2537,1109,2046,196,197],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-2539/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움 최초의 페어링 프리컴파일([EIP-196](/eip-196/), [EIP-197](/eip-197/))은 BN254 곡선에서 동작하며, 명세는 그 보안 강도를 약 80비트로 봅니다. 더 강력하고 현대적인 페어링 친화적 곡선을 쓰고 싶은 프로토콜은 이를 Solidity로 구현해야 했는데, 비용이 너무 큽니다.\n\nBLS12-377(Zexe 논문에서 유래)은 120비트 이상의 보안 강도를 제공하며, 이 곡선의 페어링을 다른 SNARK 안에서 효율적으로 검증할 수 있다는 특별한 성질이 있습니다. 그래서 한 단계 재귀 증명 집계와, 이 곡선 위에 만들어진 시스템이 생성하는 BLS 서명 검증에 매력적입니다.\n\n## 어떻게 동작하나요?\n\n이 제안은 제안된 주소 `0x15`–`0x1d`에 프리컴파일 아홉 개를 추가합니다.\n\n| 프리컴파일 | 연산 |\n| --- | --- |\n| `G1ADD`, `G1MUL`, `G1MULTIEXP` | G1의 점 덧셈, 스칼라 곱, 다중 스칼라 곱 |\n| `G2ADD`, `G2MUL`, `G2MULTIEXP` | G2(Fp2 위)에서의 같은 연산 |\n| `PAIRING` | `k`개의 (G1, G2) 쌍에 대한 페어링의 곱이 1인지 확인 |\n| `MAP_FP_TO_G1`, `MAP_FP2_TO_G2` | 체의 원소를 곡선 위의 점으로 매핑(hash-to-curve용) |\n\n인코딩은 BLS12-381 프리컴파일 제안과 같은 패턴을 따릅니다.\n\n- 기저체 원소는 64바이트 빅엔디언이며 상위 16바이트는 0입니다(32바이트 ABI 정렬 유지). Fp2 원소는 이것 두 개(128바이트)입니다.\n- G1 점은 128바이트(`x || y`), G2 점은 256바이트입니다. `(0, 0)`은 무한원점을 인코딩합니다.\n- 스칼라는 32바이트이며 군의 위수로 나머지를 취해 줄여 둘 필요는 없습니다.\n- 페어링 입력은 384바이트 조각 `k`개이고, 출력은 끝이 `0x01`(참) 또는 `0x00`인 32바이트입니다. 페어링 입력에는 부분군 검사가 필수입니다.\n\n제안된 가스: G1ADD 600, G1MUL 12000, G2ADD 4500, G2MUL 55000, 페어링 `55000*k + 65000`, map-to-G1 5500, map-to-G2 75000. 다중 지수 연산에는 더 큰 `k`에 대한 할인 표가 있습니다. 오류가 나면 호출에 제공된 가스를 모두 소모해야 합니다.\n\n## 샘플 코드\n\nSolidity에서 제안된 G1 덧셈 프리컴파일을 호출하는 예(설명용. 이 주소는 제안일 뿐이며 메인넷에서는 활성화되어 있지 않습니다):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nlibrary BLS12377 {\n    address constant G1ADD = address(0x15); // proposed, not deployed\n\n    // p and q are 128-byte encoded G1 points (x||y, each 64 bytes big-endian)\n    function g1Add(bytes memory p, bytes memory q) internal view returns (bytes memory out) {\n        require(p.length == 128 \u0026\u0026 q.length == 128, \"bad length\");\n        (bool ok, bytes memory res) = G1ADD.staticcall(bytes.concat(p, q));\n        require(ok \u0026\u0026 res.length == 128, \"G1ADD failed\");\n        return res;\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태: **Stagnant**. 어떤 네트워크 업그레이드에도 예정되어 있지 않습니다.\n- 이더리움에서(Pectra 업그레이드로) 채택된 것은 관련 [EIP-2537](/eip-2537/)의 BLS12-381 프리컴파일입니다. 메인넷에서 BLS가 필요하다면 쓸 수 있는 곡선은 그쪽입니다.\n- 명세는 상수 시간 구현을 요구하지 **않는다**고 명시합니다.\n- [EIP-1109](/eip-1109/)(더 저렴한 프리컴파일 호출)와 [EIP-2046](/eip-2046/)(프리컴파일에 대한 STATICCALL 비용 감소)을 기반으로 하며, 둘 다 요구 사항으로 나열합니다. 둘 다 그 자체로 Stagnant입니다.\n"},"zh":{"lang":"zh","tldr":"一项已停滞的提案：新增九个在 BLS12-377 曲线上执行运算和配对的预编译，目标是低成本的 BLS 签名检查和递归 SNARK 验证。","tags":["core","precompile","cryptography","bls","zk","stagnant"],"related":[2537,1109,2046,196,197],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-2539/","markdown":"## 它解决什么问题？\n\n以太坊最初的配对预编译（[EIP-196](/eip-196/)、[EIP-197](/eip-197/)）运行在 BN254 曲线上，规范认为其安全强度约为 80 位。想使用更强、更现代的配对友好曲线的协议只能用 Solidity 来实现，成本高得无法接受。\n\nBLS12-377（出自 Zexe 论文）提供 120 位以上的安全强度，并有一个特殊性质：其上的配对可以在另一个 SNARK 内部高效地验证。这使它对一步式递归证明聚合，以及对基于该曲线构建的系统所产生的 BLS 签名的验证很有吸引力。\n\n## 它如何运作\n\n该提案在提议的地址 `0x15`–`0x1d` 上新增九个预编译：\n\n| 预编译 | 运算 |\n| --- | --- |\n| `G1ADD`、`G1MUL`、`G1MULTIEXP` | G1 中点的加法、标量乘法、多标量乘法 |\n| `G2ADD`、`G2MUL`、`G2MULTIEXP` | G2（在 Fp2 上）中的同样运算 |\n| `PAIRING` | 检查 `k` 对 (G1, G2) 的配对之积是否为 1 |\n| `MAP_FP_TO_G1`、`MAP_FP2_TO_G2` | 把域元素映射为曲线上的点（用于 hash-to-curve） |\n\n编码方式沿用 BLS12-381 预编译提案的模式：\n\n- 基域元素为 64 字节大端序，最高 16 字节为零（保持 32 字节的 ABI 对齐）。Fp2 元素由两个这样的元素组成（128 字节）。\n- G1 点为 128 字节（`x || y`），G2 点为 256 字节。`(0, 0)` 编码无穷远点。\n- 标量为 32 字节，无需对群的阶取模约简。\n- 配对的输入是 `k` 个 384 字节的片段；输出是 32 字节，末尾为 `0x01`（真）或 `0x00`。配对输入必须进行子群检查。\n\n提议的 gas：G1ADD 600，G1MUL 12000，G2ADD 4500，G2MUL 55000，配对 `55000*k + 65000`，map-to-G1 5500，map-to-G2 75000。多重指数运算在 `k` 较大时有折扣表。任何错误都必须消耗调用所提供的全部 gas。\n\n## 示例代码\n\n从 Solidity 调用提议中的 G1 加法预编译（示意：该地址只是提议，并未在主网激活）：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nlibrary BLS12377 {\n    address constant G1ADD = address(0x15); // proposed, not deployed\n\n    // p and q are 128-byte encoded G1 points (x||y, each 64 bytes big-endian)\n    function g1Add(bytes memory p, bytes memory q) internal view returns (bytes memory out) {\n        require(p.length == 128 \u0026\u0026 q.length == 128, \"bad length\");\n        (bool ok, bytes memory res) = G1ADD.staticcall(bytes.concat(p, q));\n        require(ok \u0026\u0026 res.length == 128, \"G1ADD failed\");\n        return res;\n    }\n}\n```\n\n## 需要注意\n\n- 状态：**Stagnant**。它没有被排入任何网络升级。\n- 以太坊上（在 Pectra 升级中）被采纳的是相关的 [EIP-2537](/eip-2537/) 中的 BLS12-381 预编译。如果你在主网上需要 BLS，可用的就是那条曲线。\n- 规范明确**不**要求常数时间的实现。\n- 它建立在 [EIP-1109](/eip-1109/)（更便宜的预编译调用）和 [EIP-2046](/eip-2046/)（降低对预编译的 STATICCALL 成本）之上，并把两者列为前置要求，而这两个 EIP 本身也都是 Stagnant 状态。\n"}},"requiredBy":[3026]}
