# Ed25519.randomPrivateKey

Generates a random Ed25519 private 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 = Ed25519.randomPrivateKey()
```

## Definition

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

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

## Parameters

### options

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

The options to generate the private key.

#### options.as

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

Format of the returned private key.

## Return Type

The generated private key.

`randomPrivateKey.ReturnType<as>`
