/** * Identity Module * * Ed25519 key pair generation, DID derivation, and local identity storage. * DESIGN.md §6.1 — Every actor is an Identity entity with a cryptographic key pair. * * Private keys are stored locally in `.trellis/identity.json` (never synced). * Public keys and DIDs are graph entities that get replicated to peers. */ export interface IdentityConfig { displayName: string; email?: string; /** Ed25519 public key, base64-encoded. */ publicKey: string; /** Ed25519 private key, base64-encoded (local only, never synced). */ privateKey: string; /** did:key identifier derived from public key. */ did: string; /** Entity ID for use in the EAV store. */ entityId: string; /** ISO timestamp of creation. */ createdAt: string; } export interface PublicIdentity { displayName: string; email?: string; publicKey: string; did: string; entityId: string; createdAt: string; } /** * Generate a new Ed25519 identity. */ export declare function createIdentity(opts: { displayName: string; email?: string; }): IdentityConfig; /** * Sign a message (typically an op hash) with a private key. */ export declare function signMessage(message: string, privateKeyBase64: string): string; /** * Verify a signature against a message and public key. */ export declare function verifySignature(message: string, signatureBase64: string, publicKeyBase64: string): boolean; /** * Save an identity to the local .trellis directory. */ export declare function saveIdentity(trellisDir: string, identity: IdentityConfig): void; /** * Load the local identity from .trellis/identity.json. */ export declare function loadIdentity(trellisDir: string): IdentityConfig | null; /** * Check if a local identity exists. */ export declare function hasIdentity(trellisDir: string): boolean; /** * Extract the public (safe-to-share) portion of an identity. */ export declare function toPublicIdentity(identity: IdentityConfig): PublicIdentity; //# sourceMappingURL=identity.d.ts.map