# Ed25519.fromPrf

Derives an Ed25519 private key from a 32-byte WebAuthn PRF output.

The permanent derivation contract uses the PRF output as the HMAC-SHA256 key. Its message is the UTF-8 bytes of `ox.ed25519.fromPrf.v1` followed by a 32-bit big-endian counter set to zero.

## Imports

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

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

## Examples

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

const privateKey = Ed25519.fromPrf(
  '0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f'
)
```

## Definition

```ts
function fromPrf<as>(
  value: Hex.Hex | Bytes.Bytes,
  options?: fromPrf.Options<as>,
): fromPrf.ReturnType<as>
```

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

## Parameters

### value

* **Type:** `Hex.Hex | Bytes.Bytes`

A 32-byte WebAuthn PRF output.

### options

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

Options.

#### options.as

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

Format of the returned private key.

## Return Type

An Ed25519 private key.

`fromPrf.ReturnType<as>`
