secp256k1_keys_coincurve

Module for secp256k1 keys based on coincurve library.

class Secp256k1PublicKeyCoincurve(key_obj: PublicKey)

Bases: IPublicKey

Secp256k1 public key class.

classmethod FromBytes(key_bytes: bytes) IPublicKey

Construct class from key bytes.

Parameters:

key_bytes (bytes) – Key bytes

Returns:

IPublicKey object

Return type:

IPublicKey

Raises:

ValueError – If key bytes are not valid

classmethod FromPoint(key_point: IPoint) IPublicKey

Construct class from key point.

Parameters:

key_point (IPoint object) – Key point

Returns:

IPublicKey object

Return type:

IPublicKey

Raises:

ValueError – If key point is not valid

m_ver_key: PublicKey
static CurveType() EllipticCurveTypes

Get the elliptic curve type.

Returns:

Elliptic curve type

Return type:

EllipticCurveTypes

static CompressedLength() int

Get the compressed key length.

Returns:

Compressed key length

Return type:

int

static UncompressedLength() int

Get the uncompressed key length.

Returns:

Uncompressed key length

Return type:

int

UnderlyingObject() Any

Get the underlying object.

Returns:

Underlying object

Return type:

Any

RawCompressed() DataBytes

Return raw compressed public key.

Returns:

DataBytes object

Return type:

DataBytes object

RawUncompressed() DataBytes

Return raw uncompressed public key.

Returns:

DataBytes object

Return type:

DataBytes object

Point() IPoint

Get public key point.

Returns:

IPoint object

Return type:

IPoint object

class Secp256k1PrivateKeyCoincurve(key_obj: PrivateKey)

Bases: IPrivateKey

Secp256k1 private key class.

classmethod FromBytes(key_bytes: bytes) IPrivateKey

Construct class from key bytes.

Parameters:

key_bytes (bytes) – Key bytes

Returns:

IPrivateKey object

Return type:

IPrivateKey

Raises:

ValueError – If key bytes are not valid

m_sign_key: PrivateKey
static CurveType() EllipticCurveTypes

Get the elliptic curve type.

Returns:

Elliptic curve type

Return type:

EllipticCurveTypes

static Length() int

Get the key length.

Returns:

Key length

Return type:

int

UnderlyingObject() Any

Get the underlying object.

Returns:

Underlying object

Return type:

Any

Raw() DataBytes

Return raw private key.

Returns:

DataBytes object

Return type:

DataBytes object

PublicKey() IPublicKey

Get the public key correspondent to the private one.

Returns:

IPublicKey object

Return type:

IPublicKey object