Skip to content

BLS12_G2MSM

Elliptic curve

Multi-scalar multiplication in the BLS12-381 G2 group.

Address0x000000000000000000000000000000000000000e
NameBLS12_G2MSM
Minimum gas22,500
Inputa multiple of 288 bytes
Output256 bytes
Available sincePrague

Input

point256 B
scalar32 B
OffsetLengthFieldDescription
0256pointA G2 point.
25632scalarThe scalar for that point, big-endian.

Output

The resulting 256-byte G2 point.

Gas

k × 22500 × discount(k) / 1000, where k is the number of (point, scalar) pairs

Failure behaviour

  • Reverts on empty input or an input length that is not a positive multiple of 288.
  • 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_G2MSM at 0x0e
(bool ok, bytes memory out) = address(0x0e).staticcall(input);
require(ok, "BLS12_G2MSM reverted");

Specification

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