Point

class blsct.Point(obj: Any = None)

Represents an element in the BLS12-381 G1 curve group. A wrapper of MclG1Point in navio-core.

Instantiating a Point object without a parameter returns the base point of the BLS12-381 G1 curve.

>>> from blsct import Point, Scalar
>>> Point()
Point(a4eb0bfafd459d032737596...)
>>> Point.random()
Point(b45f2b49f894ec369133766...)
>>> Point.base()
Point(97f1d3a73197d7942695638...)
>>> s = Scalar()
>>> Point.from_scalar(s)
Point(b83378b6c0b2cb416dc7391...)
>>> p = Point()
>>> p.is_valid()
True
>>> q = Point()
>>> p == p
True
>>> p == q
False
>>> ser = p.serialize()
>>> deser = Point.deserialize(ser)
>>> ser == deser.serialize()
True
classmethod base() → Self

Get the base point of the BLS12-381 G1 curve

classmethod deserialize(hex: str) → Self

Deserialize the point from a hexadecimal string

is_valid() → bool

Check if the point is valid

pretty_print() → str

Convert the point to a string representation

classmethod random() → Self

Generate a random point

scalar_multiply(n: Scalar) → Self

Multiply the point by a scalar

serialize() → str

Serialize the point to a hexadecimal string