function · Browser and Node

# identityFromSeed

Builds an Ed25519 did:key identity and derives its X25519 encryption keys. The returned identity holds secret key bytes in memory; the caller owns their storage and lifetime.

`@toip-tools/trust-core` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/trust-core/src/identity.ts#L33)

Import:

```ts
import { identityFromSeed } from "@toip-tools/trust-core";
```

## Declaration

Signature:

```ts
identityFromSeed(seed: Uint8Array): Identity;
```

### Parameters

**`seed` (required)**

`Uint8Array<ArrayBufferLike>`

Seed whose first 32 bytes become the Ed25519 signing secret. Supply at least 32 bytes.

### Returns

`Identity`

The DID, signing and encryption key pairs, and a Data Integrity signer.

## Throws

If the selected seed bytes are not a valid Ed25519 secret key length.

[Usage guide](https://toip.tools/toolkit/trust-core/#usage) · [Error handling](https://toip.tools/toolkit/trust-core/#errors) · [All exports](https://toip.tools/toolkit/trust-core/api/)

---

This is the Markdown version of https://toip.tools/toolkit/trust-core/api/identityFromSeed/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
