Compresses an uncompressed public key to its compressed format following SEC1 standards.
In SEC1, a compressed public key consists of a prefix (02 or 03) followed by the x-coordinate.
The prefix indicates whether the y-coordinate is even (02) or odd (03).
Parameters
uncompressedPubKeySEC1: `04${string}`
The uncompressed public key in hex format, with or without '04' prefix
Returns string
The compressed public key in hex format
Throws
Error if the uncompressed public key length is invalid
Compresses an uncompressed public key to its compressed format following SEC1 standards. In SEC1, a compressed public key consists of a prefix (02 or 03) followed by the x-coordinate. The prefix indicates whether the y-coordinate is even (02) or odd (03).