Skip to content

BLS12_PAIRING_CHECK

Elliptic curve

Pairing check on BLS12-381.

Address0x000000000000000000000000000000000000000f
NameBLS12_PAIRING_CHECK
Minimum gas37,700
Inputa multiple of 384 bytes
Output32 bytes
Available sincePrague

Input

g1_point128 B
g2_point256 B
OffsetLengthFieldDescription
0128g1_pointA G1 point.
128256g2_pointThe paired G2 point.

Output

A 32-byte word: 1 if the pairing product equals one, 0 otherwise.

Gas

37700 + 32600 × (len(input) / 384)

Failure behaviour

  • Reverts on empty input or an input length that is not a positive multiple of 384.
  • Reverts if any point is not on the curve or not in the correct subgroup.

Calling it

Precompiles have no ABI and no function selector: the input is raw bytes at the exact offsets above. Call with staticcall.

// BLS12_PAIRING_CHECK at 0x0f
(bool ok, bytes memory out) = address(0x0f).staticcall(input);
require(ok, "BLS12_PAIRING_CHECK reverted");

Specification

  • EIP-2537: Precompile for BLS12-381 curve operations