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

    Class ECPublicKey

    An interface for elliptic curve public keys that can provide their uncompressed form.

    This interface extends ECKey to provide a method for obtaining the uncompressed representation of a public key. Elliptic curve public keys can be represented in both compressed (33 bytes) and uncompressed (65 bytes) formats:

    • Compressed format: Uses a single byte prefix (0x02 or 0x03) followed by the x-coordinate (32 bytes), with the prefix indicating the parity of the y-coordinate.

    • Uncompressed format: Uses a byte prefix (0x04) followed by both x and y coordinates (32 bytes each), for a total of 65 bytes.

    The compressed format is more space-efficient and is recommended for most applications, but some legacy systems require the uncompressed format.

    Implements

    Index

    Properties

    KEY_SIZE: 33 = ECDSA_PUBLIC_KEY_SIZE

    Methods

    • Verify an ECDSA signature.

      Parameters

      • signature: Uint8Array

        The 64-byte signature to verify

      • message: Uint8Array

        The message that was signed

      Returns boolean

      true if the signature is valid

    • Returns the untagged CBOR encoding.

      Format: { 3: h'<33-byte-key>' } Note: No key 2 indicates this is a public key

      Returns Cbor

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

      Returns UR