{"eip":3026,"title":"BW6-761 curve operations","description":"Precompiles for BW6-761 curve operations","authors":["Youssef El Housni (@yelhousni)","Michael Connor (@iAmMichaelConnor)","Aurore Guillevic \u003caurore.guillevic@inria.fr\u003e","hujw77 (@hujw77)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2020-10-05","requires":[2539],"discussionsTo":"https://ethereum-magicians.org/t/eip-3026-bw6-761-curve-operations/4790","repo":"EIPs","label":"EIP-3026","officialUrl":"https://eips.ethereum.org/EIPS/eip-3026","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3026.md","url":"https://eips.huatuo.xyz/eip-3026/","tldr":{"en":"Proposes seven precompiles for the BW6-761 pairing-friendly curve so contracts can efficiently verify 'proofs of proofs': SNARKs that check other SNARKs built on BLS12-377.","ja":"ペアリングに適した曲線 BW6-761 向けに 7 つのプリコンパイルを提案し、コントラクトが「証明の証明」、つまり BLS12-377 上に構築された他の SNARK を検証する SNARK を効率的に検証できるようにする。","ko":"페어링 친화적 곡선 BW6-761을 위한 프리컴파일 7개를 제안해, 컨트랙트가 '증명의 증명', 즉 BLS12-377 위에 만들어진 다른 SNARK를 검증하는 SNARK를 효율적으로 검증할 수 있게 한다.","zh":"为 BW6-761 配对友好曲线提出七个预编译，使合约能够高效验证\"证明的证明\"：即检查其他建立在 BLS12-377 上的 SNARK 的 SNARK。"},"tags":["precompile","cryptography","zk-snark","pairing","elliptic-curve"],"explainers":{"en":{"lang":"en","tldr":"Proposes seven precompiles for the BW6-761 pairing-friendly curve so contracts can efficiently verify 'proofs of proofs': SNARKs that check other SNARKs built on BLS12-377.","tags":["precompile","cryptography","zk-snark","pairing","elliptic-curve"],"related":[2539,2537,197,1962],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-3026/","markdown":"## What problem does it solve?\n\nRecursive or composed zk-SNARKs let one proof attest that another proof is valid. To do this efficiently you need a pair of curves where the scalar field of the \"inner\" curve equals the base field of the \"outer\" curve. BLS12-377 (proposed for Ethereum in [EIP-2539](/eip-2539/)) is a common inner curve; BW6-761 is a matching outer curve.\n\nThe spec states BW6-761 replaces the earlier CP6-782 outer curve used by Zexe and is much faster, citing Groth16 verification about 30× faster than with CP6-782. Without native support, verifying such outer proofs in EVM bytecode would be prohibitively expensive, so this EIP adds them as precompiles.\n\n## How it works\n\nSeven precompiles, following the same design as the BLS12 precompile proposals:\n\n| Precompile | Proposed address | Input | Gas |\n| --- | --- | --- | --- |\n| `BW6_G1_ADD` | `0x1e` | 2 × G1 point (384 bytes) | 180 |\n| `BW6_G1_MUL` | `0x1f` | G1 point + scalar (256 bytes) | 64000 |\n| `BW6_G1_MULTIEXP` | `0x20` | k × (point + scalar) | discounted per k |\n| `BW6_G2_ADD` | `0x21` | 2 × G2 point | 180 |\n| `BW6_G2_MUL` | `0x22` | G2 point + scalar | 64000 |\n| `BW6_G2_MULTIEXP` | `0x23` | k × (point + scalar) | discounted per k |\n| `BW6_PAIRING` | `0x24` | k × (G1, G2) pairs (384 bytes each) | `120000·k + 320000` |\n\nEncoding rules:\n\n- Base-field elements are 96-byte big-endian integers that must be less than the field modulus.\n- A point is `x ‖ y`, 192 bytes. Because both G1 and G2 live over the base field (the G2 twist is defined over `Fp`), they share the same size. The point at infinity is encoded as all zeros.\n- Scalars are 64 bytes (the group order is only 377 bits, but 64 bytes keeps the ABI 32-byte aligned).\n- The pairing returns 32 bytes: `1` if the product of pairings is the identity, else `0`. Points must be on the curve and, for pairing, in the right subgroup.\n- On any error, the call consumes all gas allotted for the operation.\n\nMulti-exponentiation exists separately because one call is far cheaper than many `CALL`s to MUL and ADD.\n\n## Sample code\n\nCalling the proposed pairing precompile from Solidity (address as proposed in the spec; it does not exist on mainnet):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nlibrary BW6Pairing {\n    address constant BW6_PAIRING = address(0x24); // proposed, not deployed\n\n    /// @param input concatenation of k (G1 || G2) pairs, 384 bytes each\n    function check(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) = BW6_PAIRING.staticcall(input);\n        require(ok \u0026\u0026 out.length == 32, \"pairing failed\");\n        return abi.decode(out, (uint256)) == 1;\n    }\n}\n```\n\n## Things to know\n\n- **Status: Stagnant.** These precompiles are not active on Ethereum mainnet, and the addresses listed are only proposals.\n- It depends on BLS12-377 support ([EIP-2539](/eip-2539/)), which is also not on mainnet. Ethereum instead added BLS12-381 precompiles via [EIP-2537](/eip-2537/), a different curve family.\n- The gas numbers come from benchmark timings using the [EIP-1962](/eip-1962/) estimation approach, and the spec notes they do not yet fully include ABI parsing and encoding overhead.\n"},"ja":{"lang":"ja","tldr":"ペアリングに適した曲線 BW6-761 向けに 7 つのプリコンパイルを提案し、コントラクトが「証明の証明」、つまり BLS12-377 上に構築された他の SNARK を検証する SNARK を効率的に検証できるようにする。","tags":["precompile","cryptography","zk-snark","pairing","elliptic-curve"],"related":[2539,2537,197,1962],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-3026/","markdown":"## 何を解決するのか\n\n再帰的あるいは合成された zk-SNARK では、1 つの証明が別の証明の正しさを証明できます。これを効率的に行うには、「内側」の曲線のスカラー体が「外側」の曲線の基礎体と等しくなる曲線のペアが必要です。BLS12-377（[EIP-2539](/eip-2539/) で Ethereum 向けに提案）は一般的な内側の曲線で、BW6-761 はそれに対応する外側の曲線です。\n\n仕様は、BW6-761 が Zexe で使われていた以前の外側の曲線 CP6-782 に置き換わるもので、はるかに高速だと述べており、Groth16 の検証が CP6-782 の場合より約 30 倍速いことを挙げています。ネイティブのサポートがなければ、このような外側の証明を EVM バイトコードで検証するのは非現実的なほど高価になるため、この EIP はそれらをプリコンパイルとして追加します。\n\n## 仕組み\n\nBLS12 プリコンパイルの提案と同じ設計の、7 つのプリコンパイルがあります。\n\n| プリコンパイル | 提案アドレス | 入力 | ガス |\n| --- | --- | --- | --- |\n| `BW6_G1_ADD` | `0x1e` | G1 の点 2 つ（384 バイト） | 180 |\n| `BW6_G1_MUL` | `0x1f` | G1 の点 + スカラー（256 バイト） | 64000 |\n| `BW6_G1_MULTIEXP` | `0x20` | k × （点 + スカラー） | k に応じて割引 |\n| `BW6_G2_ADD` | `0x21` | G2 の点 2 つ | 180 |\n| `BW6_G2_MUL` | `0x22` | G2 の点 + スカラー | 64000 |\n| `BW6_G2_MULTIEXP` | `0x23` | k × （点 + スカラー） | k に応じて割引 |\n| `BW6_PAIRING` | `0x24` | k × （G1, G2）のペア（各 384 バイト） | `120000·k + 320000` |\n\nエンコーディングのルール：\n\n- 基礎体の要素は 96 バイトのビッグエンディアン整数で、体の法より小さくなければなりません。\n- 点は `x ‖ y` の 192 バイトです。G1 も G2 も基礎体上にある（G2 のツイストが `Fp` 上で定義される）ため、同じサイズになります。無限遠点はすべてゼロでエンコードされます。\n- スカラーは 64 バイトです（群の位数は 377 ビットしかありませんが、64 バイトにすると ABI が 32 バイト境界に揃います）。\n- ペアリングは 32 バイトを返します。ペアリングの積が単位元なら `1`、そうでなければ `0` です。点は曲線上にあり、ペアリングの場合は正しい部分群に属していなければなりません。\n- エラーが起きると、呼び出しはその演算に割り当てられたガスをすべて消費します。\n\n多重べき乗が別に用意されているのは、1 回の呼び出しのほうが、MUL と ADD への多数の `CALL` よりはるかに安いからです。\n\n## サンプルコード\n\nSolidity から提案されたペアリングのプリコンパイルを呼び出す例です（アドレスは仕様で提案されたものです。メインネットには存在しません）。\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nlibrary BW6Pairing {\n    address constant BW6_PAIRING = address(0x24); // proposed, not deployed\n\n    /// @param input concatenation of k (G1 || G2) pairs, 384 bytes each\n    function check(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) = BW6_PAIRING.staticcall(input);\n        require(ok \u0026\u0026 out.length == 32, \"pairing failed\");\n        return abi.decode(out, (uint256)) == 1;\n    }\n}\n```\n\n## 知っておくべきこと\n\n- **ステータス：Stagnant。** これらのプリコンパイルは Ethereum メインネットでは有効ではなく、記載されているアドレスは提案にすぎません。\n- BLS12-377 のサポート（[EIP-2539](/eip-2539/)）に依存していますが、こちらもメインネットにはありません。Ethereum は代わりに、別の曲線ファミリーである BLS12-381 のプリコンパイルを [EIP-2537](/eip-2537/) で追加しました。\n- ガスの数値は、[EIP-1962](/eip-1962/) の見積もり手法を使ったベンチマークの計測値から得られたもので、ABI の解析とエンコードのオーバーヘッドはまだ完全には含まれていないと仕様は述べています。\n"},"ko":{"lang":"ko","tldr":"페어링 친화적 곡선 BW6-761을 위한 프리컴파일 7개를 제안해, 컨트랙트가 '증명의 증명', 즉 BLS12-377 위에 만들어진 다른 SNARK를 검증하는 SNARK를 효율적으로 검증할 수 있게 한다.","tags":["precompile","cryptography","zk-snark","pairing","elliptic-curve"],"related":[2539,2537,197,1962],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-3026/","markdown":"## 어떤 문제를 해결하나요?\n\n재귀적 또는 합성 zk-SNARK는 하나의 증명이 다른 증명이 유효하다는 것을 증명하게 해 줍니다. 이를 효율적으로 하려면 \"안쪽\" 곡선의 스칼라 체가 \"바깥쪽\" 곡선의 기저체와 같은 곡선 쌍이 필요합니다. BLS12-377([EIP-2539](/eip-2539/)에서 이더리움용으로 제안됨)은 흔한 안쪽 곡선이고, BW6-761은 이에 짝이 되는 바깥쪽 곡선입니다.\n\n명세는 BW6-761이 Zexe에서 쓰던 이전의 바깥쪽 곡선 CP6-782를 대체하며 훨씬 빠르다고 밝히면서, Groth16 검증이 CP6-782보다 약 30배 빠르다고 인용합니다. 네이티브 지원이 없으면 이런 바깥쪽 증명을 EVM 바이트코드로 검증하는 것은 엄두도 못 낼 만큼 비싸므로, 이 EIP는 이를 프리컴파일로 추가합니다.\n\n## 어떻게 동작하나요?\n\nBLS12 프리컴파일 제안들과 같은 설계를 따르는 프리컴파일 7개가 있습니다.\n\n| 프리컴파일 | 제안된 주소 | 입력 | 가스 |\n| --- | --- | --- | --- |\n| `BW6_G1_ADD` | `0x1e` | G1 점 2개(384바이트) | 180 |\n| `BW6_G1_MUL` | `0x1f` | G1 점 + 스칼라(256바이트) | 64000 |\n| `BW6_G1_MULTIEXP` | `0x20` | k × (점 + 스칼라) | k에 따라 할인 |\n| `BW6_G2_ADD` | `0x21` | G2 점 2개 | 180 |\n| `BW6_G2_MUL` | `0x22` | G2 점 + 스칼라 | 64000 |\n| `BW6_G2_MULTIEXP` | `0x23` | k × (점 + 스칼라) | k에 따라 할인 |\n| `BW6_PAIRING` | `0x24` | k × (G1, G2) 쌍(각 384바이트) | `120000·k + 320000` |\n\n인코딩 규칙:\n\n- 기저체 원소는 96바이트 빅 엔디언 정수이며 체의 모듈러스보다 작아야 합니다.\n- 점은 `x ‖ y`로 192바이트입니다. G1과 G2 모두 기저체 위에 있으므로(G2 트위스트가 `Fp` 위에서 정의됨) 크기가 같습니다. 무한원점은 모두 0으로 인코딩됩니다.\n- 스칼라는 64바이트입니다(군의 위수는 377비트뿐이지만 64바이트로 하면 ABI가 32바이트로 정렬됩니다).\n- 페어링은 32바이트를 반환합니다. 페어링 곱이 항등원이면 `1`, 아니면 `0`입니다. 점은 곡선 위에 있어야 하고, 페어링의 경우 올바른 부분군에 속해야 합니다.\n- 어떤 오류가 나든 호출은 해당 연산에 할당된 가스를 모두 소비합니다.\n\n다중 거듭제곱이 따로 있는 것은 MUL과 ADD에 대한 여러 번의 `CALL`보다 한 번의 호출이 훨씬 저렴하기 때문입니다.\n\n## 샘플 코드\n\nSolidity에서 제안된 페어링 프리컴파일을 호출하는 예시입니다(주소는 명세에서 제안한 것이며 메인넷에는 존재하지 않습니다).\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nlibrary BW6Pairing {\n    address constant BW6_PAIRING = address(0x24); // proposed, not deployed\n\n    /// @param input concatenation of k (G1 || G2) pairs, 384 bytes each\n    function check(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) = BW6_PAIRING.staticcall(input);\n        require(ok \u0026\u0026 out.length == 32, \"pairing failed\");\n        return abi.decode(out, (uint256)) == 1;\n    }\n}\n```\n\n## 알아둘 점\n\n- **상태: Stagnant.** 이 프리컴파일들은 이더리움 메인넷에서 활성화되어 있지 않으며, 나열된 주소는 제안일 뿐입니다.\n- BLS12-377 지원([EIP-2539](/eip-2539/))에 의존하는데, 이것 역시 메인넷에 없습니다. 이더리움은 대신 다른 곡선 계열인 BLS12-381 프리컴파일을 [EIP-2537](/eip-2537/)로 추가했습니다.\n- 가스 수치는 [EIP-1962](/eip-1962/)의 추정 방식을 사용한 벤치마크 측정값에서 나왔으며, 명세는 ABI 파싱과 인코딩 오버헤드가 아직 완전히 반영되지 않았다고 언급합니다.\n"},"zh":{"lang":"zh","tldr":"为 BW6-761 配对友好曲线提出七个预编译，使合约能够高效验证\"证明的证明\"：即检查其他建立在 BLS12-377 上的 SNARK 的 SNARK。","tags":["precompile","cryptography","zk-snark","pairing","elliptic-curve"],"related":[2539,2537,197,1962],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-3026/","markdown":"## 它解决什么问题？\n\n递归或组合式 zk-SNARK 让一个证明可以证明另一个证明有效。要高效地做到这一点，需要一对曲线，其中\"内层\"曲线的标量域等于\"外层\"曲线的基域。BLS12-377（在 [EIP-2539](/eip-2539/) 中被提议用于以太坊）是常见的内层曲线；BW6-761 是与之匹配的外层曲线。\n\n规范指出，BW6-761 取代了 Zexe 所用的早期外层曲线 CP6-782，并且快得多，引用的数据是 Groth16 验证比使用 CP6-782 快约 30 倍。没有原生支持的话，在 EVM 字节码中验证这类外层证明的成本将高得无法承受，所以这份 EIP 把它们作为预编译加入。\n\n## 它如何运作\n\n七个预编译，设计与 BLS12 预编译提案相同：\n\n| 预编译 | 提议地址 | 输入 | Gas |\n| --- | --- | --- | --- |\n| `BW6_G1_ADD` | `0x1e` | 2 个 G1 点（384 字节） | 180 |\n| `BW6_G1_MUL` | `0x1f` | G1 点 + 标量（256 字节） | 64000 |\n| `BW6_G1_MULTIEXP` | `0x20` | k × （点 + 标量） | 随 k 打折 |\n| `BW6_G2_ADD` | `0x21` | 2 个 G2 点 | 180 |\n| `BW6_G2_MUL` | `0x22` | G2 点 + 标量 | 64000 |\n| `BW6_G2_MULTIEXP` | `0x23` | k × （点 + 标量） | 随 k 打折 |\n| `BW6_PAIRING` | `0x24` | k 对 （G1, G2）（每对 384 字节） | `120000·k + 320000` |\n\n编码规则：\n\n- 基域元素是 96 字节的大端整数，必须小于域模数。\n- 一个点是 `x ‖ y`，共 192 字节。由于 G1 和 G2 都定义在基域上（G2 的扭曲定义在 `Fp` 上），它们大小相同。无穷远点编码为全零。\n- 标量为 64 字节（群的阶只有 377 位，但 64 字节能让 ABI 保持 32 字节对齐）。\n- 配对返回 32 字节：如果配对的乘积是单位元则为 `1`，否则为 `0`。点必须在曲线上，且对于配对来说，必须在正确的子群中。\n- 出现任何错误时，调用会消耗为该运算分配的全部 gas。\n\n多标量乘法单独存在，是因为一次调用比多次 `CALL` MUL 和 ADD 便宜得多。\n\n## 示例代码\n\n从 Solidity 调用所提议的配对预编译（地址为规范中提议的地址；主网上并不存在）：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nlibrary BW6Pairing {\n    address constant BW6_PAIRING = address(0x24); // proposed, not deployed\n\n    /// @param input concatenation of k (G1 || G2) pairs, 384 bytes each\n    function check(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) = BW6_PAIRING.staticcall(input);\n        require(ok \u0026\u0026 out.length == 32, \"pairing failed\");\n        return abi.decode(out, (uint256)) == 1;\n    }\n}\n```\n\n## 需要注意\n\n- **状态：Stagnant。** 这些预编译没有在以太坊主网上激活，所列的地址只是提议。\n- 它依赖 BLS12-377 的支持（[EIP-2539](/eip-2539/)），后者同样不在主网上。以太坊转而通过 [EIP-2537](/eip-2537/) 添加了 BLS12-381 预编译，这是另一个曲线族。\n- gas 数值来自使用 [EIP-1962](/eip-1962/) 估算方法的基准测试耗时，规范指出它们尚未完全包含 ABI 解析和编码的开销。\n"}}}
