secp256k1_point_coincurve

Module for secp256k1 point based on coincurve library.

class Secp256k1PointCoincurve(point_obj: PublicKey)

Bases: IPoint

Secp256k1 point class. In coincurve library, all the point functions (e.g. add, multiply) are coded inside the PublicKey class. For this reason, a PublicKey is used as underlying object.

classmethod FromBytes(point_bytes: bytes) IPoint

Construct class from point bytes.

Parameters:

point_bytes (bytes) – Point bytes

Returns:

IPoint object

Return type:

IPoint

classmethod FromCoordinates(x: int, y: int) IPoint

Construct class from point coordinates.

Parameters:
  • x (int) – X coordinate of the point

  • y (int) – Y coordinate of the point

Returns:

IPoint object

Return type:

IPoint

m_pub_key: PublicKey
static CurveType() EllipticCurveTypes

Get the elliptic curve type.

Returns:

Elliptic curve type

Return type:

EllipticCurveTypes

static CoordinateLength() int

Get the coordinate length.

Returns:

Coordinate key length

Return type:

int

UnderlyingObject() Any

Get the underlying object.

Returns:

Underlying object

Return type:

Any

X() int

Get point X coordinate.

Returns:

Point X coordinate

Return type:

int

Y() int

Get point Y coordinate.

Returns:

Point Y coordinate

Return type:

int

Raw() DataBytes

Return the point raw bytes.

Returns:

DataBytes object

Return type:

DataBytes object

RawEncoded() DataBytes

Return the encoded point raw bytes.

Returns:

DataBytes object

Return type:

DataBytes object

RawDecoded() DataBytes

Return the decoded point raw bytes.

Returns:

DataBytes object

Return type:

DataBytes object

__add__(point: IPoint) IPoint

Add point to another point.

Parameters:

point (IPoint object) – IPoint object

Returns:

IPoint object

Return type:

IPoint object

__radd__(point: IPoint) IPoint

Add point to another point.

Parameters:

point (IPoint object) – IPoint object

Returns:

IPoint object

Return type:

IPoint object

__mul__(scalar: int) IPoint

Multiply point by a scalar.

Parameters:

scalar (int) – scalar

Returns:

IPoint object

Return type:

IPoint object

__rmul__(scalar: int) IPoint

Multiply point by a scalar.

Parameters:

scalar (int) – scalar

Returns:

IPoint object

Return type:

IPoint object