Class PrivateKey

ECDSA (secp256k1) private key.

Hierarchy

  • PrivateKey

Constructors

  • Parameters

    • key: Buffer

    Returns PrivateKey

Methods

  • Derive the public key for this private key.

    Parameters

    • Optional prefix: string

    Returns PublicKey

  • Used by utils.inspect and console.log in node.js. Does not show the full key to get the full encoded key you need to explicitly call toString.

    Returns string

  • Sign message.

    Parameters

    • message: Buffer

      32-byte message.

    Returns Signature

  • Return a WIF-encoded representation of the key.

    Returns string

  • Convenience to create a new instance from WIF string or buffer.

    Parameters

    • value: string | Buffer

    Returns PrivateKey

  • Create key from username and password.

    Parameters

    • username: string
    • password: string
    • role: KeyRole = 'active'

    Returns PrivateKey

  • Create a new instance from a seed.

    Parameters

    • seed: string

    Returns PrivateKey

  • Create a new instance from a WIF-encoded key.

    Parameters

    • wif: string

    Returns PrivateKey

Generated using TypeDoc