export declare function encryptConversationToken(conversationId: string, creatorInboxId: string, privateKeyBytes: Uint8Array): Buffer; export declare function decryptConversationToken(tokenBytes: Buffer, creatorInboxId: string, privateKeyBytes: Uint8Array): string; export interface InviteOptions { name?: string; description?: string; imageUrl?: string; emoji?: string; expiresAt?: Date; expiresAfterUse?: boolean; } /** * Generate an invite slug for a conversation (ADR 001). * * 1. Encrypt conversation ID with ChaCha20-Poly1305 * 2. Build InvitePayload protobuf * 3. Sign with secp256k1 ECDSA (recoverable) * 4. Wrap in SignedInvite, compress, base64url encode */ export declare function createInviteSlug(conversationId: string, creatorInboxId: string, inviteTag: string, walletPrivateKey: string, options?: InviteOptions): Promise; export interface ParsedInvite { tag: string; creatorInboxId: string; conversationToken: Buffer; name?: string; description?: string; imageUrl?: string; emoji?: string; expiresAt?: Date; conversationExpiresAt?: Date; expiresAfterUse: boolean; /** Raw serialized payload bytes (for re-encoding) */ payloadBytes: Uint8Array; /** 65-byte recoverable signature */ signature: Uint8Array; } /** * Parse an invite from a slug or URL. */ export declare function parseInvite(inviteInput: string): ParsedInvite; /** * Verify the invite has a valid structure and a recoverable ECDSA signature. * * This performs: * 1. Structural validation (all required fields present) * 2. Cryptographic signature verification (can recover a public key from the * secp256k1 ECDSA signature over SHA256(payloadBytes)) * * Note: this does not verify the recovered public key matches a specific * creator — that requires additional context. Use `verifyInviteSignature()` * on the creator side to match against a known wallet key. */ export declare function verifyInvite(invite: ParsedInvite): Promise; /** * Recover the signer's public key from an invite's signature. * * Uses secp256k1 ECDSA recovery on SHA256(payloadBytes). * Returns the uncompressed public key (0x04... prefix, 65 bytes). */ export declare function recoverInvitePublicKey(invite: ParsedInvite): Promise<`0x${string}`>; /** * Verify that an invite was signed by a specific wallet private key. * * Used on the creator side (process-join-requests) to confirm the invite * was genuinely created by this identity's wallet. Recovers the signer's * public key from the signature and compares it to the public key derived * from the given private key. */ export declare function verifyInviteSignature(invite: ParsedInvite, walletPrivateKey: string): Promise; /** * Re-encode a parsed invite back to a slug (for sending as DM join request). */ export declare function inviteToSlug(invite: ParsedInvite): string;