Module grumpkin

Module grumpkin 

Source
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.