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

> pure function pubkey_ to_ xy(pubkey: byte_array ): ( big_integer , big_integer ) Extract the x and y coordinates from an EC point public key. The extracted

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

FUNCTION

# pubkey\_to\_xy

```signature
pure function pubkey_to_xy(pubkey: byte_array): (big_integer, big_integer)
```

Extract the `x` and `y` coordinates from an EC point public key. The extracted point is a tuple
containing two `big_integer`s, which are the `x` and `y` coordinates of the given public key, a
point on the secp256k1 elliptic curve.

Inverse of `crypto.xy_to_pubkey()`.

Accepts valid `33`, `64` or `65` byte public keys. Note that not all byte arrays of acceptable
length constitute valid public keys.

**Parameters**

* **pubkey** — the public key

**Returns**

the EC point `x` and `y` coordinates of the given public key

**Throws**

* `exception` — when - the given byte array does not have length `33`, `64` or `65` - the given byte array is not a valid public key

Since 0.13.5

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