Secp256k1

class bip38.secp256k1.point.Point(point_obj: PointJacobi)
classmethod from_bytes(point: bytes) Point

Creates a point from its byte representation.

Parameters:

point (bytes) – The byte representation of the point.

Returns:

An instance of IPoint representing the decoded point.

Return type:

IPoint

classmethod from_coordinates(x: int, y: int) Point

Creates a point from x and y.

Parameters:
  • x (int) – The x of the point.

  • y (int) – The y of the point.

Returns:

An instance of IPoint representing the point with the given coordinates.

Return type:

IPoint

underlying_object() Any

Returns the underlying point object.

Returns:

The underlying point object.

Return type:

Any

x() int

Returns the x of the point.

Returns:

The x of the point.

Return type:

int

y() int

Returns the y of the point.

Returns:

The y of the point.

Return type:

int

raw() bytes

Returns the raw bytes representation of the point.

Returns:

The raw bytes representation of the point.

Return type:

bytes

raw_encoded() bytes

Returns the raw encoded bytes of the point.

Returns:

The raw encoded bytes of the point.

Return type:

bytes

raw_decoded() bytes

Returns the raw decoded bytes of the point.

Returns:

The raw bytes of the point.

Return type:

bytes

class bip38.secp256k1.public_key.PublicKey(verify_key: VerifyingKey)
classmethod from_bytes(public_key: bytes) PublicKey

Create a public key instance from bytes representation.

Parameters:

public_key (bytes) – The bytes representation of the public key.

Returns:

An instance of the public key derived from the given bytes.

Return type:

PublicKey

classmethod from_point(point: Point) PublicKey

Create a public key instance from an elliptic curve point.

Parameters:

point (Point) – The elliptic curve point representing the public key.

Returns:

An instance of the public key derived from the given point.

Return type:

PublicKey

static compressed_length() int

Returns the length of a compressed public key in bytes.

Returns:

The length of a compressed public key in bytes.

Return type:

int

static uncompressed_length() int

Returns the length of an uncompressed public key in bytes.

Returns:

The length of an uncompressed public key in bytes.

Return type:

int

underlying_object() Any

Returns the underlying verification key object.

Returns:

The underlying verification key object.

Return type:

Any

raw(public_key_type: str) bytes

Retrieves the raw compressed representation of the public key.

Returns:

The compressed public key bytes.

Return type:

bytes

raw_compressed() bytes

Retrieves the raw compressed representation of the public key.

Returns:

The compressed public key bytes.

Return type:

bytes

raw_uncompressed() bytes

Retrieves the raw uncompressed representation of the public key.

Returns:

The uncompressed public key bytes.

Return type:

bytes

point() Point

Retrieves the point object associated with the public key.

Returns:

The point object implementing the Point interface.

Return type:

Point

class bip38.secp256k1.private_key.PrivateKey(signing_key: SigningKey)
classmethod from_bytes(private_key: bytes) PrivateKey

Creates a private key instance from the given bytes.

Parameters:

private_key (bytes) – The bytes representing the private key.

Returns:

An instance of PrivateKey corresponding to the given bytes.

Return type:

PrivateKey

static length() int

Returns the length of the private key in bytes for SECP256k1 curve.

Returns:

Length of the private key in bytes.

Return type:

int

underlying_object() Any

Return the underlying signing key object.

Returns:

The underlying signing key object.

Return type:

Any

raw() bytes

Return the raw bytes representation of the private key.

Returns:

The raw bytes of the private key.

Return type:

bytes

public_key() PublicKey

Retrieve the public key associated with this private key instance.

Returns:

The public key object.

Return type:

IPublicKey