toip.tools

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-coreView source
TypeScriptImport
import { identityFromSeed } from "@toip-tools/trust-core";

Declaration

TypeScriptSignature
identityFromSeed(seed: Uint8Array): Identity;

Parameters

seedrequired
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.