/** * @fileoverview MembershipProofService — generates and verifies ring signatures * proving BrightTrust membership without revealing which specific member created content. * * Uses an Abe-Ohkubo-Suzuki (AOS) style ring signature scheme built on * secp256k1 ECDSA primitives. The proof is bound to a specific content hash, * preventing reuse across different content items. * * Ring Signature Scheme: * - For a ring of n public keys, the signer (at index s) generates a ring * of challenges and responses such that the verification equation holds * for all members, but only the signer knows which position is theirs. * - The challenge chain is: c_{i+1} = H(L || m || g^{r_i} * y_i^{c_i}) * where L is the key set, m is the message, g is the generator, y_i is * the public key at index i, r_i is the response, and c_i is the challenge. * - The ring closes when c_0 (computed) matches c_0 (stored). * * @see Requirements 18 * @see Design: MembershipProofService (Section 7) */ import { PlatformID } from '@digitaldefiance/ecies-lib'; import { IMembershipProofService } from '../interfaces/services/membershipProof'; /** * MembershipProofService generates and verifies ring signatures * proving BrightTrust membership without revealing which member. * * The ring signature scheme ensures: * - Any member can generate a valid proof * - The proof is bound to specific content (content hash) * - Verification succeeds against the full member key set * - No information about which member generated the proof is leaked * * Proof format (serialized): * [version: 1 byte] [n: 2 bytes (uint16 BE)] [c0: 32 bytes] [r0: 32 bytes] ... [r_{n-1}: 32 bytes] * * @template TID - Platform ID type for frontend/backend DTO compatibility */ export declare class MembershipProofService implements IMembershipProofService { /** Generic marker for DTO compatibility */ _platformId?: TID; /** * Generate a ring signature proving the signer is one of the current * BrightTrust members. The proof is bound to the specific content hash. * * Algorithm (AOS ring signature): * 1. Find signer's index s in the key ring * 2. Generate random k (nonce) for the signer's position * 3. Compute initial point: g^k * 4. For positions (s+1) to (s-1) mod n, generate random responses * and compute the challenge chain * 5. Close the ring by computing the signer's response: * r_s = k - c_s * privateKey mod n * * @param signerPrivateKey - The signer's secp256k1 private key (32 bytes) * @param memberPublicKeys - Public keys of all current BrightTrust members * @param contentHash - Hash of the content being signed * @returns The serialized ring signature proof * @throws Error if signer is not in the member set or member set is empty */ generateProof(signerPrivateKey: Uint8Array, memberPublicKeys: Uint8Array[], contentHash: Uint8Array): Promise; /** * Verify a membership proof against the current member set and content hash. * * Algorithm: * 1. Deserialize the proof to extract c_0 and all responses * 2. Recompute the challenge chain starting from c_0: * For each i: point_i = g^{r_i} * y_i^{c_i}, c_{i+1} = H(L, m, point_i) * 3. The ring is valid if the recomputed c_0 matches the stored c_0 * * @param proof - The serialized ring signature proof * @param memberPublicKeys - Public keys of all current BrightTrust members * @param contentHash - Hash of the content the proof should be bound to * @returns True if the proof is valid */ verifyProof(proof: Uint8Array, memberPublicKeys: Uint8Array[], contentHash: Uint8Array): Promise; /** * Serialize a ring signature proof into bytes. * * Format: * [version: 1 byte] [n: 2 bytes uint16 BE] [c0: 32 bytes] [r_0: 32 bytes] ... [r_{n-1}: 32 bytes] */ private serializeProof; /** * Deserialize a ring signature proof from bytes. * * @returns Parsed proof components or null if the format is invalid */ private deserializeProof; } //# sourceMappingURL=membershipProofService.d.ts.map