pubkey_encode

function pubkey_encode(pubkey: byte_array, compressed: boolean): byte_array

Converts a public key between compressed (33-byte) and uncompressed (65-byte) formats.

Since

0.13.5

Parameters

pubkey

The public key to be encoded.

compressed

Boolean flag indicating whether to return the compressed (33-byte) or uncompressed (65-byte) public key. Defaults to false (uncompressed).