Skip to content

BLS12_G1MSM

Elliptic curve

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

Address0x000000000000000000000000000000000000000c
NameBLS12_G1MSM
Minimum gas12,000
Inputa multiple of 160 bytes
Output128 bytes
Available sincePrague

Input

point128 B
scalar32 B
OffsetLengthFieldDescription
0128pointA G1 point.
12832scalarThe scalar for that point, big-endian.

Output

The resulting 128-byte G1 point.

Gas

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

The discount table rewards batching: a single pair pays full price, and the per-pair price falls as k grows, bottoming out for large batches.

Failure behaviour

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

Specification

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