Expand description
Minimal Grumpkin curve arithmetic for contract address derivation.
Grumpkin is an embedded curve of BN254 defined by y^2 = x^3 - 17
over BN254’s scalar field (Fr). Only affine point addition and
scalar multiplication are implemented — just enough for
compute_contract_address_from_instance.
Functions§
- generator
- Return the Grumpkin generator point G = (1, y) where y = sqrt(1 - 17).
- has_
positive_ y - Returns whether the affine point uses Aztec’s canonical “positive” y-coordinate.
- point_
add - Add two Grumpkin affine points.
- point_
from_ x - Recover the canonical Grumpkin affine point from an x-coordinate.
- scalar_
mul - Scalar multiplication via double-and-add.