dposlib.ark.ldgr

This module contains functions to interoperate with Ledger hard wallet.

parseBip44Path

def parseBip44Path(path)

Parse a BIP44 derivation path.

Arguments:

  • path str - the derivation path.

Returns:

  • bytes - parsed bip44 path.

getPublicKey

def getPublicKey(path=None, debug=False)

Compute the public key associated to a derivation path.

Arguments:

  • path str - derivation path.
  • debug bool - flag to activate debug messages from ledger key.

Returns:

  • hex - secp256k1-compressed publicKey.

signMessage

def signMessage(msg, path=None, schnorr=True, debug=False)

Compute schnorr or ecdsa signature of msg according to derivation path.

Arguments:

  • msg str or bytes - message to sign.
  • path str - derivation path.
  • schnorr bool - use schnorr signature if True else ecdsa.
  • debug bool - flag to activate debug messages from ledger key.

Returns:

  • hex - message signature.

signTransaction

def signTransaction(tx, path=None, schnorr=True, debug=False)

Append sender public key and signature into transaction according to derivation path.

Arguments:

  • tx dposlib.ark.tx.Transaction - transaction.
  • path str - derivation path.
  • schnorr bool - use schnorr signature if True else ecdsa.
  • debug bool - flag to activate debug messages from ledger key.

Returns:

  • hex - transaction signature. Signature is also added to transaction object as signature item.