Skip to content

Add BLS12-381 precompiles & update precompiles#138

Merged
YoshihitoAso merged 1 commit intodev-2.7from
activate-bls12381
Mar 17, 2026
Merged

Add BLS12-381 precompiles & update precompiles#138
YoshihitoAso merged 1 commit intodev-2.7from
activate-bls12381

Conversation

@YoshihitoAso
Copy link
Copy Markdown
Member

@YoshihitoAso YoshihitoAso commented Mar 17, 2026

close #137

This pull request introduces improvements and fixes to the precompiled contract address handling, and adds support for BLS12-381 signature verification precompiles.

BLS12-381 precompile support:

  • Added BLS12-381 signature verification precompile contracts to core/vm/contracts.go, including G1Add, G1MultiExp, G2Add, G2MultiExp, Pairing, MapG1, and MapG2.
  • Updated subgroup checks for G1 and G2 points in multi-exponentiation precompiles to ensure only valid points are processed. [1] [2]

Removal of unused precompiles:

  • Removed the G1Mul and G2Mul precompile implementations and their references from both code and tests, as they are no longer used.

Register EIP-2537 BLS12-381 precompiles and update precompile setup and tests.

Changes include:
- Add bls12-381 precompiles (G1/G2 add, multi-exp, pairing, map) and export PrecompiledContractsBLS.
- Remove legacy G1/G2 Mul precompiles and associated test fixtures.
- Normalize precompile addresses to explicit hex byte forms and update tests/benchmarks accordingly.
- Rename and use separate discount tables for G1/G2 multi-exp gas calculations and adjust gas math.
- Add subgroup validation for points in multi-exponentiation implementations.
- Update test vectors' gas values and testdata JSONs to match new pricing and addresses.
- Update README to mention bls12-381 support and AWS Secrets Manager/KMS node key support.
- Misc: adjust protocol params and fuzzing test to align with the new precompile set.

These changes implement BLS precompile support and keep tests and benchmarks consistent with the new contract set and gas parameters.
@YoshihitoAso YoshihitoAso merged commit 6c16488 into dev-2.7 Mar 17, 2026
5 checks passed
@YoshihitoAso YoshihitoAso deleted the activate-bls12381 branch March 17, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Activate bls12381 precompiles

2 participants