# privkey_to_pubkey · Rell standard library · Chromia Docs (concept)

> pure function privkey_ to_ pubkey(privkey: byte_array , [compressed: boolean ]): byte_array Compute a public key from a 32-byte private key. The optional b

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/crypto/privkey_to_pubkey/

FUNCTION

# privkey\_to\_pubkey

```signature
pure function privkey_to_pubkey(privkey: byte_array, [compressed: boolean]): byte_array
```

Compute a public key from a 32-byte private key.

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.

**Parameters**

* **privkey** — the 32-byte private key
* **compressed** — whether or not the public should be compressed; defaults to false (uncompressed)

**Returns**

a 65-byte public key in uncompressed mode, or a 33-byte public key in compressed mode

**Throws**

* `exception` — if `privkey` is not `32` bytes

Since 0.10.6

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/crypto/privkey_to_pubkey.html)Generated API reference, mirrored from the live docs
