Skip to content

BLS12_G2ADD

Elliptic curve

Point addition in the BLS12-381 G2 group.

Address0x000000000000000000000000000000000000000d
NameBLS12_G2ADD
Minimum gas600
Input512 bytes
Output256 bytes
Available sincePrague

Input

point_a256 B
point_b256 B
OffsetLengthFieldDescription
0256point_aFirst G2 point: x and y, each a pair of 64-byte field elements.
256256point_bSecond G2 point.

Output

The sum, a 256-byte G2 point.

Gas

600

Failure behaviour

  • Reverts if the input is not exactly 512 bytes.
  • Reverts on non-canonical field elements or points not on the curve.

Calling it

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

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

Specification

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