BN254_MUL
Elliptic curve
Scalar multiplication on the alt_bn128 (BN254) curve.
| Address | 0x0000000000000000000000000000000000000007 |
|---|---|
| Name | BN254_MUL |
| Minimum gas | 6,000 |
| Input | 96 bytes |
| Output | 64 bytes |
| Available since | Byzantium; repriced at Istanbul (EIP-1108) |
Input
x32 B
y32 B
scalar32 B
| Offset | Length | Field | Description |
|---|---|---|---|
| 0 | 32 | x | X coordinate of the point. |
| 32 | 32 | y | Y coordinate of the point. |
| 64 | 32 | scalar | The scalar multiplier, big-endian. |
Output
The product point as (x, y), 64 bytes.
Gas
6000
Failure behaviour
- Reverts if the input point is not on the curve.
- Input shorter than the expected length is right-padded with zero bytes rather than rejected.
Calling it
Precompiles have no ABI and no function selector: the input is raw bytes at the exact offsets above. Call with staticcall.
// BN254_MUL at 0x07(bool ok, bytes memory out) = address(0x07).staticcall(input);require(ok, "BN254_MUL reverted");