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 sourceimport { identityFromSeed } from "@toip-tools/trust-core";
Declaration
identityFromSeed(seed: Uint8Array): Identity;
Parameters
seedrequiredUint8Array<ArrayBufferLike>Seed whose first 32 bytes become the Ed25519 signing secret. Supply at least 32 bytes.
Returns
IdentityThe 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.