# Ed25519.createKeyPair

Creates a new Ed25519 key pair consisting of a private key and its corresponding public key.

## Imports

:::code-group
```ts [Named]
import { Ed25519 } from 'ox'
```

```ts [Entrypoint]
import * as Ed25519 from 'ox/Ed25519'
```
:::

## Examples

```ts twoslash
import { Ed25519 } from 'ox'

const { privateKey, publicKey } = Ed25519.createKeyPair()
```

## Definition

```ts
function createKeyPair<as>(
  options?: createKeyPair.Options<as>,
): createKeyPair.ReturnType<as>
```

**Source:** [src/core/Ed25519.ts](https://github.com/wevm/ox/blob/main/src/core/Ed25519.ts#L348)

## Parameters

### options

* **Type:** `createKeyPair.Options<as>`
* **Optional**

The options to generate the key pair.

#### options.as

* **Type:** `"Bytes" | "Hex" | as`
* **Optional**

Format of the returned private and public keys.

## Return Type

The generated key pair containing both private and public keys.

`createKeyPair.ReturnType<as>`
