{"eip":2537,"title":"Precompile for BLS12-381 curve operations","description":"Adds operation on BLS12-381 curve as a precompile in a set necessary to efficiently perform operations such as BLS signature verification.","authors":["Alex Vlasov (@shamatar)","Kelly Olson (@ineffectualproperty)","Alex Stokes (@ralexstokes)","Antonio Sanso (@asanso)"],"status":"Final","type":"Standards Track","category":"Core","created":"2020-02-21","discussionsTo":"https://ethereum-magicians.org/t/eip2537-bls12-precompile-discussion-thread/4187","repo":"EIPs","label":"EIP-2537","officialUrl":"https://eips.ethereum.org/EIPS/eip-2537","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2537.md","url":"https://eips.huatuo.xyz/eip-2537/","tldr":{"en":"Seven precompiles for the BLS12-381 pairing curve, giving the EVM cheap, ~128-bit-secure BLS signature verification and zk-proof operations.","ja":"BLS12-381 ペアリング曲線向けの 7 つのプリコンパイル。EVM に、約 128 ビット安全性の BLS 署名検証と zk 証明の演算を低コストで提供する。","ko":"BLS12-381 페어링 곡선을 위한 7개의 프리컴파일. EVM에 약 128비트 보안 수준의 BLS 서명 검증과 zk 증명 연산을 저렴하게 제공한다.","zh":"针对 BLS12-381 配对曲线的七个预编译，为 EVM 提供低成本、约 128 位安全强度的 BLS 签名验证和零知识证明运算。"},"tags":["precompile","bls","cryptography","pairing","core"],"explainers":{"en":{"lang":"en","tldr":"Seven precompiles for the BLS12-381 pairing curve, giving the EVM cheap, ~128-bit-secure BLS signature verification and zk-proof operations.","tags":["precompile","bls","cryptography","pairing","core"],"related":[196,197,2333,2335,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-2537/","markdown":"## What problem does it solve?\n\nThe EVM has had pairing-friendly curve precompiles since 2017, but only for BN254 ([EIP-196](/eip-196/), [EIP-197](/eip-197/)), whose security is now estimated at roughly 80 bits. Meanwhile Ethereum's consensus layer signs everything with BLS signatures on **BLS12-381**, a curve with 120+ bits of security. Without a precompile, verifying those signatures or BLS12-381 zk proofs in a contract is far too expensive.\n\nEIP-2537 adds native BLS12-381 operations so contracts can verify validator signatures, aggregate public keys and check pairing-based proofs at a reasonable gas cost.\n\n## How it works\n\nSeven precompiles are added:\n\n| Address | Name | Gas |\n| --- | --- | --- |\n| `0x0b` | `BLS12_G1ADD` | 375 |\n| `0x0c` | `BLS12_G1MSM` | discounted, per pair |\n| `0x0d` | `BLS12_G2ADD` | 600 |\n| `0x0e` | `BLS12_G2MSM` | discounted, per pair |\n| `0x0f` | `BLS12_PAIRING_CHECK` | `32600 * k + 37700` |\n| `0x10` | `BLS12_MAP_FP_TO_G1` | 5500 |\n| `0x11` | `BLS12_MAP_FP2_TO_G2` | 23800 |\n\n**Encoding**\n\n- A base field element is 64 bytes big-endian (the top 16 bytes must be zero, and the value must be below the modulus).\n- An Fp2 element is two of those: 128 bytes.\n- A G1 point is 128 bytes (`x || y`); a G2 point is 256 bytes. All-zero bytes encode the point at infinity.\n- Scalars are 32 bytes and need not be reduced.\n\n**Operations**\n\n- **MSM** (multi-scalar multiplication) takes `k` (point, scalar) pairs and returns `Σ sᵢ·Pᵢ`. It replaces separate \"multiply\" precompiles; a single multiplication is an MSM with `k = 1`. Gas uses a per-`k` discount table, so batching is cheaper per pair.\n- **Pairing check** takes `k` (G1, G2) pairs and returns 32 bytes ending in `0x01` if `e(P1,Q1)·…·e(Pk,Qk) == 1`, else `0x00`.\n- **Map to curve** turns a field element into a curve point. Hashing a message to a field element is left to the caller.\n\nMSM and pairing inputs are subgroup-checked; the ADD precompiles are not. Any error (bad length, invalid encoding, point off the curve) burns all gas passed to the call. Empty inputs are an error.\n\n## Sample code\n\nCalling the pairing precompile from Solidity, e.g. to verify a BLS signature as `e(pk, H(m)) · e(-G1, sig) == 1`:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nlibrary BLS12 {\n    address constant PAIRING = address(0x0f);\n\n    /// @param input concatenation of k slices: 128-byte G1 point || 256-byte G2 point\n    function pairingCheck(bytes memory input) internal view returns (bool) {\n        require(input.length \u003e 0 \u0026\u0026 input.length % 384 == 0, \"bad length\");\n        (bool ok, bytes memory out) = PAIRING.staticcall(input);\n        require(ok, \"pairing precompile failed\");\n        return out.length == 32 \u0026\u0026 uint8(out[31]) == 1;\n    }\n}\n```\n\n## Things to know\n\n- Status is **Final**. The precompiles went live on mainnet with the Pectra upgrade.\n- The spec does not include hash-to-field. To verify standard BLS signatures you must implement the hash-to-field step yourself (typically following the IETF hash-to-curve construction) before calling the map precompile.\n- Because ADD precompiles skip subgroup checks, do not treat their output as validated input. MSM and pairing do check.\n- Keep the BN254 precompiles for existing proof systems; BLS12-381 is preferred for new designs that need higher security or compatibility with consensus-layer signatures.\n"},"ja":{"lang":"ja","tldr":"BLS12-381 ペアリング曲線向けの 7 つのプリコンパイル。EVM に、約 128 ビット安全性の BLS 署名検証と zk 証明の演算を低コストで提供する。","tags":["precompile","bls","cryptography","pairing","core"],"related":[196,197,2333,2335,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-2537/","markdown":"## 何を解決するのか\n\nEVM には 2017 年からペアリングに適した曲線のプリコンパイルがありましたが、対象は BN254（[EIP-196](/eip-196/)、[EIP-197](/eip-197/)）だけで、その安全性は現在およそ 80 ビット程度と見積もられています。一方、Ethereum のコンセンサスレイヤーは、120 ビット以上の安全性を持つ曲線 **BLS12-381** 上の BLS 署名ですべてに署名しています。プリコンパイルがなければ、コントラクト内でこれらの署名や BLS12-381 の zk 証明を検証するのは、コストが高すぎて現実的ではありません。\n\nEIP-2537 はネイティブの BLS12-381 演算を追加し、コントラクトがバリデーターの署名の検証、公開鍵の集約、ペアリングベースの証明の確認を、妥当なガスコストで行えるようにします。\n\n## 仕組み\n\n7 つのプリコンパイルが追加されます。\n\n| アドレス | 名前 | ガス |\n| --- | --- | --- |\n| `0x0b` | `BLS12_G1ADD` | 375 |\n| `0x0c` | `BLS12_G1MSM` | 割引あり、ペアごと |\n| `0x0d` | `BLS12_G2ADD` | 600 |\n| `0x0e` | `BLS12_G2MSM` | 割引あり、ペアごと |\n| `0x0f` | `BLS12_PAIRING_CHECK` | `32600 * k + 37700` |\n| `0x10` | `BLS12_MAP_FP_TO_G1` | 5500 |\n| `0x11` | `BLS12_MAP_FP2_TO_G2` | 23800 |\n\n**エンコーディング**\n\n- 基礎体の要素は 64 バイトのビッグエンディアンです（上位 16 バイトは 0 で、値は法より小さくなければなりません）。\n- Fp2 の要素は、それを 2 つ並べた 128 バイトです。\n- G1 の点は 128 バイト（`x || y`）、G2 の点は 256 バイトです。すべてゼロのバイト列は無限遠点を表します。\n- スカラーは 32 バイトで、簡約されている必要はありません。\n\n**演算**\n\n- **MSM**（multi-scalar multiplication、複数スカラー乗算）は `k` 個の（点、スカラー）のペアを受け取り、`Σ sᵢ·Pᵢ` を返します。個別の「乗算」プリコンパイルの代わりとなるもので、単一の乗算は `k = 1` の MSM です。ガスは `k` ごとの割引テーブルを使うため、バッチ化するとペアあたりのコストが下がります。\n- **ペアリングチェック**は `k` 個の（G1、G2）のペアを受け取り、`e(P1,Q1)·…·e(Pk,Qk) == 1` なら末尾が `0x01` の 32 バイトを、そうでなければ `0x00` を返します。\n- **曲線へのマッピング**は、体の要素を曲線上の点に変換します。メッセージを体の要素にハッシュする処理は、呼び出し側に委ねられています。\n\nMSM とペアリングの入力は部分群チェックの対象ですが、ADD のプリコンパイルは対象外です。どんなエラー（長さの不正、無効なエンコーディング、曲線上にない点）でも、呼び出しに渡されたガスをすべて消費します。空の入力はエラーです。\n\n## サンプルコード\n\nSolidity からペアリングのプリコンパイルを呼び出す例です。たとえば BLS 署名を `e(pk, H(m)) · e(-G1, sig) == 1` として検証する場合:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nlibrary BLS12 {\n    address constant PAIRING = address(0x0f);\n\n    /// @param input concatenation of k slices: 128-byte G1 point || 256-byte G2 point\n    function pairingCheck(bytes memory input) internal view returns (bool) {\n        require(input.length \u003e 0 \u0026\u0026 input.length % 384 == 0, \"bad length\");\n        (bool ok, bytes memory out) = PAIRING.staticcall(input);\n        require(ok, \"pairing precompile failed\");\n        return out.length == 32 \u0026\u0026 uint8(out[31]) == 1;\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Final** です。このプリコンパイルは Pectra アップグレードでメインネットに導入されました。\n- 仕様には hash-to-field は含まれていません。標準的な BLS 署名を検証するには、マッピングのプリコンパイルを呼び出す前に、hash-to-field のステップを自分で実装する必要があります（通常は IETF の hash-to-curve の構成に従います）。\n- ADD のプリコンパイルは部分群チェックを行わないため、その出力を検証済みの入力として扱わないでください。MSM とペアリングはチェックを行います。\n- 既存の証明システム向けには BN254 のプリコンパイルを残しておきます。より高い安全性やコンセンサスレイヤーの署名との互換性が必要な新しい設計には、BLS12-381 が推奨されます。\n"},"ko":{"lang":"ko","tldr":"BLS12-381 페어링 곡선을 위한 7개의 프리컴파일. EVM에 약 128비트 보안 수준의 BLS 서명 검증과 zk 증명 연산을 저렴하게 제공한다.","tags":["precompile","bls","cryptography","pairing","core"],"related":[196,197,2333,2335,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-2537/","markdown":"## 어떤 문제를 해결하나요?\n\nEVM에는 2017년부터 페어링 친화적 곡선의 프리컴파일이 있었지만 BN254([EIP-196](/eip-196/), [EIP-197](/eip-197/))에 한정되었고, 그 보안 수준은 현재 약 80비트로 추정됩니다. 한편 이더리움 합의 계층은 120비트 이상의 보안을 가진 곡선 **BLS12-381** 위의 BLS 서명으로 모든 것을 서명합니다. 프리컴파일이 없으면 컨트랙트에서 이러한 서명이나 BLS12-381 zk 증명을 검증하는 비용이 너무 비쌉니다.\n\nEIP-2537은 네이티브 BLS12-381 연산을 추가해, 컨트랙트가 검증자 서명을 검증하고, 공개 키를 집계하고, 페어링 기반 증명을 합리적인 가스 비용으로 확인할 수 있게 합니다.\n\n## 어떻게 동작하나요?\n\n7개의 프리컴파일이 추가됩니다.\n\n| 주소 | 이름 | 가스 |\n| --- | --- | --- |\n| `0x0b` | `BLS12_G1ADD` | 375 |\n| `0x0c` | `BLS12_G1MSM` | 할인 적용, 쌍당 |\n| `0x0d` | `BLS12_G2ADD` | 600 |\n| `0x0e` | `BLS12_G2MSM` | 할인 적용, 쌍당 |\n| `0x0f` | `BLS12_PAIRING_CHECK` | `32600 * k + 37700` |\n| `0x10` | `BLS12_MAP_FP_TO_G1` | 5500 |\n| `0x11` | `BLS12_MAP_FP2_TO_G2` | 23800 |\n\n**인코딩**\n\n- 기저 체 원소는 64바이트 빅 엔디언입니다(상위 16바이트는 0이어야 하며, 값은 모듈러스보다 작아야 합니다).\n- Fp2 원소는 그런 원소 두 개로, 128바이트입니다.\n- G1 점은 128바이트(`x || y`), G2 점은 256바이트입니다. 모두 0인 바이트는 무한원점을 나타냅니다.\n- 스칼라는 32바이트이며 축약되어 있지 않아도 됩니다.\n\n**연산**\n\n- **MSM**(multi-scalar multiplication, 다중 스칼라 곱셈)은 `k`개의 (점, 스칼라) 쌍을 받아 `Σ sᵢ·Pᵢ`를 반환합니다. 별도의 \"곱셈\" 프리컴파일을 대체하며, 단일 곱셈은 `k = 1`인 MSM입니다. 가스는 `k`별 할인 표를 사용하므로 묶어서 처리하면 쌍당 비용이 줄어듭니다.\n- **페어링 검사**는 `k`개의 (G1, G2) 쌍을 받아 `e(P1,Q1)·…·e(Pk,Qk) == 1`이면 `0x01`로 끝나는 32바이트를, 아니면 `0x00`을 반환합니다.\n- **곡선으로 매핑**은 체 원소를 곡선 위의 점으로 바꿉니다. 메시지를 체 원소로 해시하는 일은 호출자에게 맡겨져 있습니다.\n\nMSM과 페어링의 입력은 부분군 검사를 하지만 ADD 프리컴파일은 하지 않습니다. 어떤 오류(잘못된 길이, 유효하지 않은 인코딩, 곡선 위에 없는 점)든 호출에 전달된 가스를 모두 소진합니다. 빈 입력은 오류입니다.\n\n## 샘플 코드\n\nSolidity에서 페어링 프리컴파일 호출하기. 예를 들어 BLS 서명을 `e(pk, H(m)) · e(-G1, sig) == 1`로 검증하는 경우:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nlibrary BLS12 {\n    address constant PAIRING = address(0x0f);\n\n    /// @param input concatenation of k slices: 128-byte G1 point || 256-byte G2 point\n    function pairingCheck(bytes memory input) internal view returns (bool) {\n        require(input.length \u003e 0 \u0026\u0026 input.length % 384 == 0, \"bad length\");\n        (bool ok, bytes memory out) = PAIRING.staticcall(input);\n        require(ok, \"pairing precompile failed\");\n        return out.length == 32 \u0026\u0026 uint8(out[31]) == 1;\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Final**입니다. 이 프리컴파일은 Pectra 업그레이드와 함께 메인넷에 적용되었습니다.\n- 명세에는 hash-to-field가 포함되어 있지 않습니다. 표준 BLS 서명을 검증하려면 매핑 프리컴파일을 호출하기 전에 hash-to-field 단계를 직접 구현해야 합니다(보통 IETF hash-to-curve 구성을 따릅니다).\n- ADD 프리컴파일은 부분군 검사를 건너뛰므로 그 출력을 검증된 입력으로 취급하지 마세요. MSM과 페어링은 검사를 합니다.\n- 기존 증명 시스템을 위해 BN254 프리컴파일은 그대로 두세요. 더 높은 보안이나 합의 계층 서명과의 호환성이 필요한 새 설계에는 BLS12-381이 권장됩니다.\n"},"zh":{"lang":"zh","tldr":"针对 BLS12-381 配对曲线的七个预编译，为 EVM 提供低成本、约 128 位安全强度的 BLS 签名验证和零知识证明运算。","tags":["precompile","bls","cryptography","pairing","core"],"related":[196,197,2333,2335,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-2537/","markdown":"## 它解决什么问题？\n\n自 2017 年起，EVM 就有了配对友好曲线的预编译，但只针对 BN254（[EIP-196](/eip-196/)、[EIP-197](/eip-197/)），其安全强度目前估计只有约 80 位。与此同时，以太坊共识层用 **BLS12-381** 上的 BLS 签名对一切进行签名，这条曲线的安全强度超过 120 位。没有预编译，在合约中验证这些签名或 BLS12-381 零知识证明的成本太高了。\n\nEIP-2537 增加了原生的 BLS12-381 运算，使合约能以合理的 gas 成本验证验证者签名、聚合公钥并检查基于配对的证明。\n\n## 它如何运作\n\n新增七个预编译：\n\n| 地址 | 名称 | Gas |\n| --- | --- | --- |\n| `0x0b` | `BLS12_G1ADD` | 375 |\n| `0x0c` | `BLS12_G1MSM` | 有折扣，按每对计算 |\n| `0x0d` | `BLS12_G2ADD` | 600 |\n| `0x0e` | `BLS12_G2MSM` | 有折扣，按每对计算 |\n| `0x0f` | `BLS12_PAIRING_CHECK` | `32600 * k + 37700` |\n| `0x10` | `BLS12_MAP_FP_TO_G1` | 5500 |\n| `0x11` | `BLS12_MAP_FP2_TO_G2` | 23800 |\n\n**编码**\n\n- 基域元素为 64 字节大端序（高 16 字节必须为零，且值必须小于模数）。\n- Fp2 元素由两个这样的元素组成：128 字节。\n- G1 点为 128 字节（`x || y`）；G2 点为 256 字节。全零字节表示无穷远点。\n- 标量为 32 字节，无需约化。\n\n**运算**\n\n- **MSM**（multi-scalar multiplication，多标量乘法）接收 `k` 个（点，标量）对，返回 `Σ sᵢ·Pᵢ`。它取代了单独的\"乘法\"预编译；单次乘法就是 `k = 1` 的 MSM。Gas 使用按 `k` 划分的折扣表，因此批量处理时每对的成本更低。\n- **配对检查**接收 `k` 个（G1，G2）对，如果 `e(P1,Q1)·…·e(Pk,Qk) == 1`，则返回以 `0x01` 结尾的 32 字节，否则返回 `0x00`。\n- **映射到曲线**把域元素转换为曲线上的点。把消息哈希为域元素的工作留给调用者。\n\nMSM 和配对的输入会做子群检查；ADD 预编译则不会。任何错误（长度不对、编码无效、点不在曲线上）都会烧光传给该调用的全部 gas。空输入属于错误。\n\n## 示例代码\n\n在 Solidity 中调用配对预编译，例如把 BLS 签名验证为 `e(pk, H(m)) · e(-G1, sig) == 1`：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nlibrary BLS12 {\n    address constant PAIRING = address(0x0f);\n\n    /// @param input concatenation of k slices: 128-byte G1 point || 256-byte G2 point\n    function pairingCheck(bytes memory input) internal view returns (bool) {\n        require(input.length \u003e 0 \u0026\u0026 input.length % 384 == 0, \"bad length\");\n        (bool ok, bytes memory out) = PAIRING.staticcall(input);\n        require(ok, \"pairing precompile failed\");\n        return out.length == 32 \u0026\u0026 uint8(out[31]) == 1;\n    }\n}\n```\n\n## 需要注意\n\n- 状态为 **Final**。这些预编译已随 Pectra 升级在主网上线。\n- 规范不包含 hash-to-field。要验证标准的 BLS 签名，你必须在调用映射预编译之前自行实现 hash-to-field 这一步（通常遵循 IETF 的 hash-to-curve 构造）。\n- 由于 ADD 预编译跳过子群检查，不要把它们的输出当作已验证的输入。MSM 和配对会做检查。\n- 现有证明系统仍可保留使用 BN254 预编译；对于需要更高安全强度或需要与共识层签名兼容的新设计，更推荐 BLS12-381。\n"}},"requiredBy":[7600]}
