xy_to_pubkey
Construct a public key from EC point x
and y
coordinates. The given x
and y
coordinates must encode a point on the secp256k1 elliptic curve in order to constitute a public key.
Inverse of crypto.pubkey_to_xy()
.
The optional boolean flag compressed
determines whether a compressed (33-byte), or uncompressed (65-byte) public key, is returned. Defaults to false (uncompressed) if not provided.
Return
a 65-byte public key if uncompressed mode is used, or an equivalent 33-byte public key if compressed mode is used
Since
0.13.5
Parameters
the x-coordinate
the y-coordinate
whether the returned public key should be compressed, defaults to false
Throws
if the given x
and y
coordinates do not encode a point on the secp256k1 elliptic curve (and therefore do not constitute a valid public key)