Elliptic Curve Cryptographys

class hdwallet.eccs.ECCS

A class that manages a dictionary of ecc classes.

This class provides methods to retrieve names and classes of various entropy implementations, as well as methods to validate and access specific ecc classes by name.

Here are available ecc names and classes:

classmethod names() List[str]

Get the names from the class’s dictionary.

Returns:

A list of names stored as keys in the dictionary.

Return type:

List[str]

classmethod classes() List[Type[IEllipticCurveCryptography]]

Get the list of elliptic curve cryptography (ECC) classes from the class’s dictionary.

Returns:

A list of ECC classes stored as values in the dictionary.

Return type:

List[Type[IEllipticCurveCryptography]]

classmethod ecc(name: str) Type[IEllipticCurveCryptography]

Retrieve an elliptic curve cryptography (ECC) class by name.

Parameters:

name (str) – The name of the ECC class to retrieve.

Returns:

The ECC class corresponding to the given name.

Return type:

Type[IEllipticCurveCryptography]

classmethod is_ecc(name: str) bool

Check if the given name is a valid ECC class name.

Parameters:

name (str) – The name to check.

Returns:

True if the name is a valid ECC class name, False otherwise.

Return type:

bool

class hdwallet.eccs.iecc.IEllipticCurveCryptography

Interface for Elliptic Curve Cryptography (ECC) representation.

This interface defines the key components and attributes required for elliptic curve cryptography operations. It is intended to be implemented by specific ECC classes.

class hdwallet.eccs.kholaw.ed25519.KholawEd25519ECC
POINT

alias of KholawEd25519Point

PUBLIC_KEY

alias of KholawEd25519PublicKey

PRIVATE_KEY

alias of KholawEd25519PrivateKey

class hdwallet.eccs.kholaw.ed25519.point.KholawEd25519Point(point: bytes)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

class hdwallet.eccs.kholaw.ed25519.private_key.KholawEd25519PrivateKey(private_key: IPrivateKey, extended_key: bytes)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(private_key: bytes) IPrivateKey

Creates an instance of the private key from a byte sequence.

Parameters:

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

Returns:

An instance of the private key.

Return type:

IPrivateKey

static length() int

Returns the length of the private key in bytes.

This method retrieves the constant value representing the byte length of the private key for the KholawEd25519 algorithm.

Returns:

The length of the private key in bytes.

Return type:

int

underlying_object() Any

Retrieves the underlying object of the signing key.

Returns:

The underlying object of the signing key.

Return type:

Any

raw() bytes

Returns the raw byte representation of the signing key combined with the extended key.

Returns:

The raw byte sequence of the signing key and extended key.

Return type:

bytes

public_key() IPublicKey

Generates the public key corresponding to the signing key.

Returns:

The generated public key.

Return type:

IPublicKey

>>> from hdwallet.eccs.kholaw.ed25519.private_key import KholawEd25519PrivateKey
>>> from hdwallet.utils import get_bytes
>>> KholawEd25519PrivateKey.name()
'Kholaw-Ed25519'
>>> KholawEd25519PrivateKey.length()
64
>>> private_key = KholawEd25519PrivateKey.from_bytes(
...     get_bytes("8061879a8fc9e7c685cb89b7014c85a6c4a2a8f3b6fa4964381d0751baf8fb5ff97530b002426a6eb1308e01372905d4c19c2b52a939bccd24c99a5826b9f87c")
... )
>>> private_key.raw().hex()
'8061879a8fc9e7c685cb89b7014c85a6c4a2a8f3b6fa4964381d0751baf8fb5ff97530b002426a6eb1308e01372905d4c19c2b52a939bccd24c99a5826b9f87c'
>>> private_key.public_key().raw_compressed().hex()
'00e55487c92c1913439f336b1b2dc316da6e88c02a157208f98781494b87f27eb8'
>>> private_key.public_key().raw_uncompressed().hex()
'00e55487c92c1913439f336b1b2dc316da6e88c02a157208f98781494b87f27eb8'
class hdwallet.eccs.kholaw.ed25519.public_key.KholawEd25519PublicKey(verify_key: VerifyKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

point() IPoint

Returns the point corresponding to the public key.

Returns:

The point on the Ed25519 curve corresponding to the public key.

Return type:

IPoint

>>> from hdwallet.eccs.kholaw.ed25519 import KholawEd25519PublicKey
>>> from hdwallet.utils import get_bytes
>>> KholawEd25519PublicKey.name()
'Kholaw-Ed25519'
>>> public_key = KholawEd25519PublicKey.from_bytes(
...     get_bytes("00e55487c92c1913439f336b1b2dc316da6e88c02a157208f98781494b87f27eb8")
... )
>>> public_key.raw_compressed().hex()
'00e55487c92c1913439f336b1b2dc316da6e88c02a157208f98781494b87f27eb8'
>>> public_key.point().raw_encoded().hex()
'e55487c92c1913439f336b1b2dc316da6e88c02a157208f98781494b87f27eb8'
>>> public_key.point().x()
18529038270296824438026848489315401829943202020841826252456650783397010322849
class hdwallet.eccs.slip10.ed25519.blake2b.SLIP10Ed25519Blake2bECC
POINT

alias of SLIP10Ed25519Blake2bPoint

PUBLIC_KEY

alias of SLIP10Ed25519Blake2bPublicKey

PRIVATE_KEY

alias of SLIP10Ed25519Blake2bPrivateKey

class hdwallet.eccs.slip10.ed25519.blake2b.point.SLIP10Ed25519Blake2bPoint(point: bytes)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

class hdwallet.eccs.slip10.ed25519.blake2b.private_key.SLIP10Ed25519Blake2bPrivateKey(signing_key: SigningKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(private_key: bytes) IPrivateKey

Creates an instance of the private key from its byte representation.

Parameters:

private_key (bytes) – The byte representation of the private key.

Returns:

An instance of the private key.

Return type:

IPrivateKey

static length() int

Returns the length of the private key in bytes.

Returns:

The length of the private key in bytes.

Return type:

int

underlying_object() Any

Returns the underlying object of the signing key.

Returns:

The underlying object of the signing key.

Return type:

Any

raw() bytes

Returns the raw bytes representation of the signing key.

Returns:

The raw bytes of the signing key.

Return type:

bytes

public_key() IPublicKey

Returns the public key associated with this signing key.

Returns:

The public key as an instance of IPublicKey.

Return type:

IPublicKey

>>> from hdwallet.eccs.slip10.ed25519.blake2b import SLIP10Ed25519Blake2bPrivateKey
>>> from hdwallet.utils import get_bytes
>>> SLIP10Ed25519Blake2bPrivateKey.name()
'SLIP10-Ed25519-Blake2b'
>>> SLIP10Ed25519Blake2bPrivateKey.length()
32
>>> private_key = SLIP10Ed25519Blake2bPrivateKey.from_bytes(
...     get_bytes("bb37794073e5094ebbfcfa070e9254fe6094b56e7cccb094a2304c5eccccdc07")
... )
>>> private_key.raw().hex()
'bb37794073e5094ebbfcfa070e9254fe6094b56e7cccb094a2304c5eccccdc07'
>>> private_key.public_key().raw_compressed().hex()
'006aea61eeed872052377ab16b0fc5d9b9f142be59ac1488e6610645dedb4da45c'
>>> private_key.public_key().raw_uncompressed().hex()
'006aea61eeed872052377ab16b0fc5d9b9f142be59ac1488e6610645dedb4da45c'
class hdwallet.eccs.slip10.ed25519.blake2b.public_key.SLIP10Ed25519Blake2bPublicKey(verify_key: VerifyingKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(public_key: bytes) IPublicKey

Constructs an instance of the public key from its byte representation.

Parameters:

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

Returns:

An instance of IPublicKey.

Return type:

IPublicKey

classmethod from_point(point: IPoint) IPublicKey

Converts a point representation of a public key to an instance of IPublicKey.

Parameters:

point (IPoint) – The point object representing the public key.

Returns:

An instance of IPublicKey.

Return type:

IPublicKey

static compressed_length() int

Returns the compressed length of the public key.

Returns:

The compressed length of the public key.

Return type:

int

static uncompressed_length() int

Returns the uncompressed length of the public key.

Returns:

The uncompressed length of the public key.

Return type:

int

underlying_object() Any

Retrieves the underlying object representing the public key.

Returns:

The underlying object representing the public key.

Return type:

Any

raw_compressed() bytes

Retrieves the raw compressed representation of the public key.

This method returns the raw bytes of the compressed public key. It prepends the public key prefix defined in SLIP10_ED25519_CONST to the compressed key.

Returns:

The raw compressed bytes of the public key.

Return type:

bytes

raw_uncompressed() bytes

Retrieves the raw uncompressed representation of the public key.

Returns:

The raw uncompressed bytes of the public key.

Return type:

bytes

point() IPoint

Retrieves the SLIP10 Ed25519 Blake2b point corresponding to the public key.

Returns:

The point corresponding to the public key.

Return type:

IPoint

>>> from hdwallet.eccs.slip10.ed25519.blake2b import SLIP10Ed25519Blake2bPublicKey
>>> from hdwallet.utils import get_bytes
>>> SLIP10Ed25519Blake2bPublicKey.name()
'SLIP10-Ed25519-Blake2b'
>>> public_key = SLIP10Ed25519Blake2bPublicKey.from_bytes(
...     get_bytes("00d14696583ee9144878635b557d515a502b04366818dfe7765737746b4f57978d")
... )
>>> public_key.raw_compressed().hex()
'00d14696583ee9144878635b557d515a502b04366818dfe7765737746b4f57978d'
>>> public_key.point().raw_encoded().hex()
'd14696583ee9144878635b557d515a502b04366818dfe7765737746b4f57978d'
>>> public_key.point().x()
35008547582340824597639173221735807482318787407965447203743372716499096148063
class hdwallet.eccs.slip10.ed25519.monero.SLIP10Ed25519MoneroECC
POINT

alias of SLIP10Ed25519MoneroPoint

PUBLIC_KEY

alias of SLIP10Ed25519MoneroPublicKey

PRIVATE_KEY

alias of SLIP10Ed25519MoneroPrivateKey

class hdwallet.eccs.slip10.ed25519.monero.point.SLIP10Ed25519MoneroPoint(point: bytes)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

class hdwallet.eccs.slip10.ed25519.monero.private_key.SLIP10Ed25519MoneroPrivateKey(signing_key: SigningKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(private_key: bytes) IPrivateKey

Creates an IPrivateKey instance from a byte sequence.

Parameters:

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

Returns:

An instance of IPrivateKey created from the provided byte sequence.

Return type:

IPrivateKey

public_key() IPublicKey

Derives the public key from the private key.

Returns:

The public key derived from the private key.

Return type:

IPublicKey

>>> from hdwallet.eccs.slip10.ed25519.monero import SLIP10Ed25519MoneroPrivateKey
>>> from hdwallet.utils import get_bytes
>>> SLIP10Ed25519MoneroPrivateKey.name()
'SLIP10-Ed25519-Monero'
>>> SLIP10Ed25519MoneroPrivateKey.length()
32
>>> private_key = SLIP10Ed25519MoneroPrivateKey.from_bytes(
...     get_bytes("bb37794073e5094ebbfcfa070e9254fe6094b56e7cccb094a2304c5eccccdc07")
... )
>>> private_key.raw().hex()
'bb37794073e5094ebbfcfa070e9254fe6094b56e7cccb094a2304c5eccccdc07'
>>> private_key.public_key().raw_compressed().hex()
'628247d3de93857cdd360fee4aef9a67ecfebedfe8eaec9cf6be35eacc895ca7'
>>> private_key.public_key().raw_uncompressed().hex()
'628247d3de93857cdd360fee4aef9a67ecfebedfe8eaec9cf6be35eacc895ca7'
class hdwallet.eccs.slip10.ed25519.monero.public_key.SLIP10Ed25519MoneroPublicKey(verify_key: VerifyKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

static compressed_length() int

Returns the compressed length of the Ed25519 Monero public key.

Returns:

The compressed length of the Ed25519 Monero public key.

Return type:

int

static uncompressed_length() int

Returns the uncompressed length of the Ed25519 Monero public key.

Returns:

The uncompressed length of the Ed25519 Monero public key.

Return type:

int

raw_compressed() bytes

Retrieves the raw compressed public key bytes.

Returns:

The raw compressed public key bytes.

Return type:

bytes

raw_uncompressed() bytes

Retrieves the raw uncompressed public key bytes.

Returns:

The raw compressed public key bytes.

Return type:

bytes

point() IPoint

Retrieves the point on the elliptic curve corresponding to the public key.

Returns:

The elliptic curve point corresponding to the public key.

Return type:

IPoint

>>> from hdwallet.eccs.slip10.ed25519.monero import SLIP10Ed25519MoneroPublicKey
>>> from hdwallet.utils import get_bytes
>>> SLIP10Ed25519MoneroPublicKey.name()
'SLIP10-Ed25519-Monero'
>>> public_key = SLIP10Ed25519MoneroPublicKey.from_bytes(
...     get_bytes("628247d3de93857cdd360fee4aef9a67ecfebedfe8eaec9cf6be35eacc895ca7")
... )
>>> public_key.raw_compressed().hex()
'628247d3de93857cdd360fee4aef9a67ecfebedfe8eaec9cf6be35eacc895ca7'
>>> public_key.point().raw_encoded().hex()
'628247d3de93857cdd360fee4aef9a67ecfebedfe8eaec9cf6be35eacc895ca7'
>>> public_key.point().x()
29078407399097928298542937704975150613766572636435642857509307729044618011935
class hdwallet.eccs.slip10.ed25519.SLIP10Ed25519ECC
POINT

alias of SLIP10Ed25519Point

PUBLIC_KEY

alias of SLIP10Ed25519PublicKey

PRIVATE_KEY

alias of SLIP10Ed25519PrivateKey

class hdwallet.eccs.slip10.ed25519.point.SLIP10Ed25519Point(point: bytes)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(point: bytes) IPoint

Creates an instance of the Ed25519 point from its byte representation.

Parameters:

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

Returns:

An instance of the Ed25519 point.

Return type:

IPoint

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

Creates an instance of the Ed25519 point from x and y coordinates.

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

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

Returns:

An instance of the Ed25519 point.

Return type:

IPoint

underlying_object() Any

Returns the underlying object representing the Ed25519 Monero point.

Returns:

The underlying object representing the Ed25519 Monero point.

Return type:

Any

x() int

Returns the x-coordinate of the Ed25519 Monero public key point.

Returns:

The x-coordinate of the Ed25519 Monero public key point.

Return type:

int

y() int

Returns the y-coordinate of the Ed25519 point.

Returns:

The y-coordinate of the Ed25519 point.

Return type:

int

raw_encoded() bytes

Returns the raw encoded point data.

Returns:

The raw encoded point as bytes.

Return type:

bytes

raw_decoded() bytes

Returns the decoded raw bytes representation of the point coordinates.

Returns:

The raw decoded bytes of the point coordinates.

Return type:

bytes

class hdwallet.eccs.slip10.ed25519.private_key.SLIP10Ed25519PrivateKey(signing_key: SigningKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(private_key: bytes) IPrivateKey

Creates an instance of the class from a byte representation of a private key.

Parameters:

private_key (bytes) – The byte representation of the private key.

Returns:

An instance of the class initialized with the provided private key.

Return type:

IPrivateKey

static length() int

Returns the length of the private key in bytes.

Returns:

The length of the private key in bytes.

Return type:

int

underlying_object() Any

Retrieves the underlying signing key object.

Returns:

The underlying signing key object.

Return type:

Any

raw() bytes

Retrieves the raw bytes representation of the signing key.

Returns:

Raw bytes of the signing key.

Return type:

bytes

public_key() IPublicKey

Derives the public key from the signing key.

Returns:

The public key corresponding to the signing key.

Return type:

IPublicKey

>>> from hdwallet.eccs.slip10.ed25519.private_key import SLIP10Ed25519PrivateKey
>>> from hdwallet.utils import get_bytes
>>> SLIP10Ed25519PrivateKey.name()
'SLIP10-Ed25519'
>>> SLIP10Ed25519PrivateKey.length()
32
>>> private_key = SLIP10Ed25519PrivateKey.from_bytes(
...     get_bytes("bb37794073e5094ebbfcfa070e9254fe6094b56e7cccb094a2304c5eccccdc07")
... )
>>> private_key.raw().hex()
'bb37794073e5094ebbfcfa070e9254fe6094b56e7cccb094a2304c5eccccdc07'
>>> private_key.public_key().raw_compressed().hex()
'00d14696583ee9144878635b557d515a502b04366818dfe7765737746b4f57978d'
>>> private_key.public_key().raw_uncompressed().hex()
'00d14696583ee9144878635b557d515a502b04366818dfe7765737746b4f57978d'
class hdwallet.eccs.slip10.ed25519.public_key.SLIP10Ed25519PublicKey(verify_key: VerifyKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(public_key: bytes) IPublicKey

Create an instance of the class from raw bytes representing a public key.

This method verifies and parses the provided public key bytes.

Parameters:

public_key (bytes) – The bytes representing the public key.

Returns:

An instance of IPublicKey.

Return type:

IPublicKey

classmethod from_point(point: IPoint) IPublicKey

Calculate the length of the compressed public key.

Returns:

The length of the compressed public key in bytes.

Return type:

int

static compressed_length() int

Returns the total length of the compressed Ed25519 public key, including the prefix.

Returns:

The total length of the compressed public key.

Return type:

int

static uncompressed_length() int

Retrieve the underlying object representing the public key.

Returns:

The underlying object of the public key.

Return type:

Any

underlying_object() Any

Returns the underlying verify key object associated with this Ed25519 Monero public key.

Returns:

The underlying verify key object.

Return type:

Any

raw_compressed() bytes

Retrieve the compressed raw representation of the public key.

Returns:

Compressed raw bytes of the public key.

Return type:

bytes

raw_uncompressed() bytes

Retrieve the uncompressed raw representation of the public key.

Returns:

Uncompressed raw bytes of the public key.

Return type:

bytes

point() IPoint

Retrieve the point representation of the public key.

Returns:

An instance of IPoint representing the public key point.

Return type:

IPoint

>>> from hdwallet.eccs.slip10.ed25519.public_key import SLIP10Ed25519PublicKey
>>> from hdwallet.utils import get_bytes
>>> SLIP10Ed25519PublicKey.name()
'SLIP10-Ed25519'
>>> public_key = SLIP10Ed25519PublicKey.from_bytes(
...     get_bytes("00d14696583ee9144878635b557d515a502b04366818dfe7765737746b4f57978d")
... )
>>> public_key.raw_compressed().hex()
'00d14696583ee9144878635b557d515a502b04366818dfe7765737746b4f57978d'
>>> public_key.point().raw_encoded().hex()
'd14696583ee9144878635b557d515a502b04366818dfe7765737746b4f57978d'
>>> public_key.point().x()
35008547582340824597639173221735807482318787407965447203743372716499096148063
class hdwallet.eccs.slip10.nist256p1.SLIP10Nist256p1ECC
POINT

alias of SLIP10Nist256p1Point

PUBLIC_KEY

alias of SLIP10Nist256p1PublicKey

PRIVATE_KEY

alias of SLIP10Nist256p1PrivateKey

class hdwallet.eccs.slip10.nist256p1.point.SLIP10Nist256p1Point(point: PointJacobi)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(point: bytes) IPoint

Create an instance of SLIP10Nist256p1Point from bytes encoding.

Parameters:

point (bytes) – The bytes encoding the point coordinates.

Returns:

An instance of SLIP10Nist256p1Point representing the decoded point.

Return type:

SLIP10Nist256p1Point

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

Create an instance of SLIP10Nist256p1Point from x and y coordinates.

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

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

Returns:

An instance of SLIP10Nist256p1Point representing the specified coordinates.

Return type:

SLIP10Nist256p1Point

underlying_object() Any

Retrieve the underlying elliptic curve point object.

This method returns the underlying elliptic curve point object represented by this instance.

Returns:

The underlying elliptic curve point object.

Return type:

Any

x() int

Get the x-coordinate of the elliptic curve point.

Returns:

The x-coordinate of the elliptic curve point.

Return type:

int

y() int

Get the y-coordinate of the elliptic curve point.

Returns:

The y-coordinate of the elliptic curve point.

Return type:

int

raw_encoded() bytes

Get the encoded bytes representation of the point.

Returns:

Encoded bytes representation of the elliptic curve point.

Return type:

bytes

raw_decoded() bytes

Get the decoded bytes representation of the point.

Returns:

Decoded bytes representation of the elliptic curve point.

Return type:

bytes

class hdwallet.eccs.slip10.nist256p1.private_key.SLIP10Nist256p1PrivateKey(signing_key: SigningKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(private_key: bytes) IPrivateKey

Create a private key object from a byte string.

Parameters:

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

Returns:

An instance of the private key.

Return type:

IPrivateKey

static length() int

Get the length of the private key in bytes.

Returns:

The private key length in bytes.

Return type:

int

underlying_object() Any

Retrieve the underlying signing key object.

Returns:

The underlying signing key object.

Return type:

Any

raw() bytes

Retrieve the raw byte representation of the signing key.

Returns:

The raw bytes of the signing key.

Return type:

bytes

public_key() IPublicKey

Retrieve the corresponding public key for the signing key.

Returns:

The public key associated with the signing key.

Return type:

IPublicKey

>>> from hdwallet.eccs.slip10.nist256p1.private_key import SLIP10Nist256p1PrivateKey
>>> from hdwallet.utils import get_bytes
>>> SLIP10Nist256p1PrivateKey.name()
'SLIP10-Nist256p1'
>>> SLIP10Nist256p1PrivateKey.length()
32
>>> private_key = SLIP10Nist256p1PrivateKey.from_bytes(
...     get_bytes("f79495fda777197ce73551bcd8e162ceca19167575760d3cc2bced4bf2a213dc")
... )
>>> private_key.raw().hex()
'f79495fda777197ce73551bcd8e162ceca19167575760d3cc2bced4bf2a213dc'
>>> private_key.public_key().raw_compressed().hex()
'02e4bd97a82a8f3e575a9a35b7cca19cd730addd499a2bd4e9a9811df8bfc35e51'
>>> private_key.public_key().raw_uncompressed().hex()
'04e4bd97a82a8f3e575a9a35b7cca19cd730addd499a2bd4e9a9811df8bfc35e51c68c3bed41d47d4d05ae880250e4432cc6480b417597f1cffc5ed7d28991d164'
class hdwallet.eccs.slip10.nist256p1.public_key.SLIP10Nist256p1PublicKey(verify_key: VerifyingKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(public_key: bytes) IPublicKey

Create a public key instance from the given byte representation.

Parameters:

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

Returns:

An instance of IPublicKey.

Return type:

IPublicKey

classmethod from_point(point: IPoint) IPublicKey

Create a public key instance from a given point.

Parameters:

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

Returns:

An instance of IPublicKey.

Return type:

IPublicKey

static compressed_length() int

Get the length of the compressed public key in bytes.

Returns:

The length of the compressed public key.

Return type:

int

static uncompressed_length() int

Get the length of the uncompressed public key in bytes.

Returns:

The length of the uncompressed public key.

Return type:

int

underlying_object() Any

Get the underlying object of the public key.

Returns:

The underlying object representing the public key.

Return type:

Any

raw_compressed() bytes

Get the compressed raw bytes representation of the public key.

Returns:

The compressed raw bytes of the public key.

Return type:

bytes

raw_uncompressed() bytes

Get the uncompressed raw bytes representation of the public key.

Returns:

The uncompressed raw bytes of the public key.

Return type:

bytes

point() IPoint

Get the elliptic curve point corresponding to the public key.

Returns:

The elliptic curve point.

Return type:

IPoint

>>> from hdwallet.eccs.slip10.nist256p1.public_key import SLIP10Nist256p1PublicKey
>>> from hdwallet.utils import get_bytes
>>> SLIP10Nist256p1PublicKey.name()
'SLIP10-Nist256p1'
>>> public_key = SLIP10Nist256p1PublicKey.from_bytes(
...     get_bytes("02e4bd97a82a8f3e575a9a35b7cca19cd730addd499a2bd4e9a9811df8bfc35e51")
... )
>>> public_key.raw_compressed().hex()
'02e4bd97a82a8f3e575a9a35b7cca19cd730addd499a2bd4e9a9811df8bfc35e51'
>>> public_key.point().raw_encoded().hex()
'02e4bd97a82a8f3e575a9a35b7cca19cd730addd499a2bd4e9a9811df8bfc35e51'
>>> public_key.point().x()
103462310269679299860340333843259692621316029910306332627414876684344367472209
hdwallet.eccs.slip10.secp256k1.SLIP10Secp256k1ECC

alias of SLIP10Secp256k1ECCCoincurve

class hdwallet.eccs.slip10.secp256k1.SLIP10Secp256k1ECCCoincurve
POINT

alias of SLIP10Secp256k1PointCoincurve

PUBLIC_KEY

alias of SLIP10Secp256k1PublicKeyCoincurve

PRIVATE_KEY

alias of SLIP10Secp256k1PrivateKeyCoincurve

class hdwallet.eccs.slip10.secp256k1.point.SLIP10Secp256k1PointCoincurve(public_key: PublicKey)
static name() str

Returns the name of the ecc class.

Returns:

The name of the class.

Return type:

str

classmethod from_bytes(point_bytes: bytes) IPoint

Creates a point object from bytes.

Parameters:
  • cls (Type) – The class object.

  • point_bytes (bytes) – The bytes representing the point.

Returns:

A point object created from the provided bytes.

Return type:

IPoint

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

Creates a point object from x and y coordinates.

Parameters:
  • cls (Type) – The class object.

  • x (int) – The x-coordinate of the point.

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

Returns:

A point object representing the coordinates (x, y).

Return type:

IPoint

underlying_object() Any

Returns the underlying public key object.

Returns:

The underlying public key 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_encoded() bytes

Returns the encoded raw bytes representation of the public key, including any necessary prefix.

Returns:

The encoded raw bytes of the public key.

Return type:

bytes

raw_decoded() bytes

Returns the decoded raw bytes representation of the public key, excluding any prefix.

Returns:

The decoded raw bytes of the public key.

Return type:

bytes

class hdwallet.eccs.slip10.secp256k1.private_key.SLIP10Secp256k1PrivateKeyCoincurve(private_key: PrivateKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(private_key: bytes) IPrivateKey

Creates an instance of SLIP10 Secp256k1 private key from bytes.

Parameters:

private_key (bytes) – The private key bytes.

Returns:

An instance implementing the IPrivateKey interface.

Return type:

IPrivateKey

static length() int

Returns the length of the SLIP10 Secp256k1 private key in bytes.

Returns:

The length of the private key in bytes.

Return type:

int

underlying_object() Any

Retrieves the underlying signing key object.

Returns:

The underlying signing key object.

Return type:

Any

raw() bytes

Retrieves the raw secret bytes of the signing key.

Returns:

The raw secret bytes of the signing key.

Return type:

bytes

public_key() IPublicKey

Retrieve the public key associated with this private key instance.

Returns:

The public key object.

Return type:

IPublicKey

>>> from hdwallet.eccs.slip10.secp256k1.private_key import SLIP10Secp256k1PrivateKeyCoincurve
>>> from hdwallet.utils import get_bytes
>>> SLIP10Secp256k1PrivateKeyCoincurve.name()
'SLIP10-Secp256k1'
>>> SLIP10Secp256k1PrivateKeyCoincurve.length()
32
>>> private_key = SLIP10Secp256k1PrivateKeyCoincurve.from_bytes(
...     get_bytes("b66022fff8b6322f8b8fa444d6d097457b6b9e7bb05add5b75f9c827df7bd3b6")
... )
>>> private_key.raw().hex()
'b66022fff8b6322f8b8fa444d6d097457b6b9e7bb05add5b75f9c827df7bd3b6'
>>> private_key.public_key().raw_compressed().hex()
'0374a436044b4904bbd7a074b098d65fad39fc5b66f28da8440f10dbcf86568429'
>>> private_key.public_key().raw_uncompressed().hex()
'0474a436044b4904bbd7a074b098d65fad39fc5b66f28da8440f10dbcf86568429aae5b09b4de9cee5d2f9f98044f688aa98f910134a8e87eff28ec5ba35ddf273'
class hdwallet.eccs.slip10.secp256k1.public_key.SLIP10Secp256k1PublicKeyCoincurve(public_key: PublicKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(public_key: bytes) IPublicKey

Create a public key instance from a byte representation.

Parameters:

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

Returns:

An instance of the public key created from the byte representation.

Return type:

IPublicKey

classmethod from_point(point: IPoint) IPublicKey

Create a public key instance from a given elliptic curve point.

Parameters:

point (IPoint) – The elliptic curve point containing x and y coordinates.

Returns:

An instance of the public key derived from the elliptic curve point.

Return type:

IPublicKey

static compressed_length() int

Get the length of the compressed public key in bytes.

Returns:

Length of the 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_compressed() bytes

Retrieves the raw compressed representation of the public key.

Returns:

The compressed public key bytes.

Return type:

bytes

raw_uncompressed() bytes

Get the uncompressed raw representation of the verifying key.

Returns:

Uncompressed raw bytes of the verifying key.

Return type:

bytes

point() IPoint

Get the cryptographic point associated with the verifying key.

Returns:

The cryptographic point.

Return type:

IPoint

>>> from hdwallet.eccs.slip10.secp256k1.public_key import SLIP10Secp256k1PublicKeyCoincurve
>>> from hdwallet.utils import get_bytes
>>> SLIP10Secp256k1PublicKeyCoincurve.name()
'SLIP10-Secp256k1'
>>> public_key = SLIP10Secp256k1PublicKeyCoincurve.from_bytes(
...     get_bytes("0374a436044b4904bbd7a074b098d65fad39fc5b66f28da8440f10dbcf86568429")
... )
>>> public_key.raw_compressed().hex()
'0374a436044b4904bbd7a074b098d65fad39fc5b66f28da8440f10dbcf86568429'
>>> public_key.point().raw_encoded().hex()
'0374a436044b4904bbd7a074b098d65fad39fc5b66f28da8440f10dbcf86568429'
>>> public_key.point().x()
52758426164353529380574599868388529660378638078403259786555024244882051335209
class hdwallet.eccs.slip10.secp256k1.SLIP10Secp256k1ECCECDSA
POINT

alias of SLIP10Secp256k1PointECDSA

PUBLIC_KEY

alias of SLIP10Secp256k1PublicKeyECDSA

PRIVATE_KEY

alias of SLIP10Secp256k1PrivateKeyECDSA

class hdwallet.eccs.slip10.secp256k1.point.SLIP10Secp256k1PointECDSA(point_obj: PointJacobi)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(point_bytes: bytes) IPoint

Creates a point from its byte representation.

Parameters:

point_bytes (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) IPoint

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_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 hdwallet.eccs.slip10.secp256k1.private_key.SLIP10Secp256k1PrivateKeyECDSA(signing_key: SigningKey)
static name() str

Returns the name of the SLIP10-Secp256k1 algorithm.

Returns:

The name of the algorithm.

Return type:

str

classmethod from_bytes(key_bytes: bytes) IPrivateKey

Creates a private key instance from the given bytes.

Parameters:

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

Returns:

An instance of IPrivateKey corresponding to the given bytes.

Return type:

IPrivateKey

static length() int

Returns the length of the private key in bytes for SLIP10 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() IPublicKey

Retrieve the public key associated with this private key instance.

Returns:

The public key object.

Return type:

IPublicKey

>>> from hdwallet.eccs.slip10.secp256k1.private_key import SLIP10Secp256k1PrivateKeyECDSA
>>> from hdwallet.utils import get_bytes
>>> SLIP10Secp256k1PrivateKeyECDSA.name()
'SLIP10-Secp256k1'
>>> SLIP10Secp256k1PrivateKeyECDSA.length()
32
>>> private_key = SLIP10Secp256k1PrivateKeyECDSA.from_bytes(
...     get_bytes("b66022fff8b6322f8b8fa444d6d097457b6b9e7bb05add5b75f9c827df7bd3b6")
... )
>>> private_key.raw().hex()
'b66022fff8b6322f8b8fa444d6d097457b6b9e7bb05add5b75f9c827df7bd3b6'
>>> private_key.public_key().raw_compressed().hex()
'0374a436044b4904bbd7a074b098d65fad39fc5b66f28da8440f10dbcf86568429'
>>> private_key.public_key().raw_uncompressed().hex()
'0474a436044b4904bbd7a074b098d65fad39fc5b66f28da8440f10dbcf86568429aae5b09b4de9cee5d2f9f98044f688aa98f910134a8e87eff28ec5ba35ddf273'
class hdwallet.eccs.slip10.secp256k1.public_key.SLIP10Secp256k1PublicKeyECDSA(verify_key: VerifyingKey)
static name() str

Get the name of the ecc class.

Returns:

The name of the ecc class.

Return type:

str

classmethod from_bytes(public_key: bytes) IPublicKey

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:

IPublicKey

classmethod from_point(point: IPoint) IPublicKey

Create a public key instance from an elliptic curve point.

Parameters:

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

Returns:

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

Return type:

IPublicKey

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_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() IPoint

Retrieves the point object associated with the public key.

Returns:

The point object implementing the IPoint interface.

Return type:

IPoint

>>> from hdwallet.eccs.slip10.secp256k1.public_key import SLIP10Secp256k1PublicKeyECDSA
>>> from hdwallet.utils import get_bytes
>>> SLIP10Secp256k1PublicKeyECDSA.name()
'SLIP10-Secp256k1'
>>> public_key = SLIP10Secp256k1PublicKeyECDSA.from_bytes(
...     get_bytes("0374a436044b4904bbd7a074b098d65fad39fc5b66f28da8440f10dbcf86568429")
... )
>>> public_key.raw_compressed().hex()
'0374a436044b4904bbd7a074b098d65fad39fc5b66f28da8440f10dbcf86568429'
>>> public_key.point().raw_encoded().hex()
'0374a436044b4904bbd7a074b098d65fad39fc5b66f28da8440f10dbcf86568429'
>>> public_key.point().x()
52758426164353529380574599868388529660378638078403259786555024244882051335209