KeyCompressor interface for converting public keys between compressed and uncompressed form.

interface KeyCompressor {
    compressPublicKey(params): Promise<Uint8Array>;
    decompressPublicKey(params): Promise<Uint8Array>;
}

Methods

  • Converts a public key to its compressed form.

    Parameters

    • params: {
          publicKeyBytes: Uint8Array;
      }

      The parameters for the public key compression.

      • publicKeyBytes: Uint8Array

        The public key as a Uint8Array.

    Returns Promise<Uint8Array>

    A Promise that resolves to the compressed public key as a Uint8Array.

  • Converts a public key to its uncompressed form.

    Parameters

    • params: {
          publicKeyBytes: Uint8Array;
      }

      The parameters for the public key decompression.

      • publicKeyBytes: Uint8Array

        The public key as a Uint8Array.

    Returns Promise<Uint8Array>

    A Promise that resolves to the uncompressed public key as a Uint8Array.