Blockchain Commons Components TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Class ECPrivateKey

    An interface for elliptic curve keys that can derive a public key.

    This interface extends ECKeyBase to provide a method for deriving the corresponding compressed public key. It is implemented by both private keys (where it generates the public key) and public keys (where it may return self or convert between formats).

    Implements

    Index

    Properties

    KEY_SIZE: 32 = ECDSA_PRIVATE_KEY_SIZE

    Methods

    • Sign a message using Schnorr signature (BIP-340).

      Parameters

      • message: Uint8Array

        The message to sign

      Returns Uint8Array

      A 64-byte signature

    • Sign a message using Schnorr signature with custom RNG.

      Parameters

      • message: Uint8Array

        The message to sign

      • rng: RandomNumberGenerator

        Random number generator for auxiliary randomness

      Returns Uint8Array

      A 64-byte signature

    • Returns the UR representation of the ECPrivateKey. Note: URs use untagged CBOR since the type is conveyed by the UR type itself.

      Returns UR