import { VorionError } from '../../common/errors.js';
import { type CircuitMetadata, type MerkleProof, ZKCircuitType } from './types.js';
/**
 * Circuit-related errors
 */
export declare class CircuitError extends VorionError {
    readonly circuitType?: string;
    code: string;
    statusCode: number;
    constructor(message: string, circuitType?: string, details?: Record<string, unknown>);
}
/**
 * Registry for ZK circuits
 *
 * Manages circuit definitions, metadata, and provides circuit lookup functionality.
 *
 * @example
 * ```typescript
 * const registry = new CircuitRegistry();
 * registry.registerCircuit(ageVerificationCircuit);
 *
 * const circuit = registry.getCircuit(ZKCircuitType.AGE_VERIFICATION);
 * ```
 */
export declare class CircuitRegistry {
    private circuits;
    private metadata;
    constructor();
    /**
     * Register a circuit
     */
    registerCircuit(circuit: Circuit): void;
    /**
     * Get a circuit by type
     */
    getCircuit(type: string): Circuit | undefined;
    /**
     * Get circuit metadata
     */
    getMetadata(type: string): CircuitMetadata | undefined;
    /**
     * Get all registered circuits
     */
    getAllCircuits(): Circuit[];
    /**
     * Get all circuit metadata
     */
    getAllMetadata(): CircuitMetadata[];
    /**
     * Check if a circuit is registered
     */
    hasCircuit(type: string): boolean;
    /**
     * Register built-in circuits
     */
    private registerBuiltinCircuits;
}
/**
 * Base interface for ZK circuits
 */
export interface Circuit {
    /**
     * Get circuit metadata
     */
    getMetadata(): CircuitMetadata;
    /**
     * Validate private inputs for the circuit
     */
    validatePrivateInputs(inputs: Record<string, unknown>): boolean;
    /**
     * Validate public inputs for the circuit
     */
    validatePublicInputs(inputs: string[]): boolean;
    /**
     * Compute witness from private inputs
     * (The witness is the full assignment that satisfies the circuit constraints)
     */
    computeWitness(privateInputs: Record<string, unknown>, publicInputs: string[]): Promise<Uint8Array>;
    /**
     * Verify that public inputs match the expected format
     */
    extractPublicInputs(privateInputs: Record<string, unknown>): string[];
}
/**
 * Age Verification Circuit
 *
 * Proves that a user's age is above a threshold without revealing their
 * exact date of birth.
 *
 * Public Inputs:
 * - Current timestamp (to prevent replay)
 * - Age threshold (e.g., 18, 21)
 *
 * Private Inputs:
 * - Date of birth
 *
 * Constraints:
 * - age = (currentTimestamp - birthTimestamp) / SECONDS_PER_YEAR
 * - age >= threshold
 *
 * @example
 * ```typescript
 * const circuit = new AgeVerificationCircuit();
 * const witness = await circuit.computeWitness(
 *   { birthDate: new Date('1990-01-15') },
 *   [Date.now().toString(), '18']
 * );
 * ```
 */
export declare class AgeVerificationCircuit implements Circuit {
    private static readonly SECONDS_PER_YEAR;
    getMetadata(): CircuitMetadata;
    validatePrivateInputs(inputs: Record<string, unknown>): boolean;
    validatePublicInputs(inputs: string[]): boolean;
    computeWitness(privateInputs: Record<string, unknown>, publicInputs: string[]): Promise<Uint8Array>;
    extractPublicInputs(privateInputs: Record<string, unknown>): string[];
    private generateNonce;
    private serializeWitness;
}
/**
 * Range Proof Circuit
 *
 * Proves that a value lies within a specified range [min, max] without
 * revealing the actual value. Useful for salary ranges, credit scores, etc.
 *
 * Public Inputs:
 * - Range minimum
 * - Range maximum
 * - Commitment to the value
 *
 * Private Inputs:
 * - The actual value
 * - Commitment randomness (blinding factor)
 *
 * Constraints:
 * - value >= min
 * - value <= max
 * - commitment = Commit(value, randomness)
 *
 * @example
 * ```typescript
 * const circuit = new RangeProofCircuit();
 * const witness = await circuit.computeWitness(
 *   { value: 75000, randomness: '...' },
 *   ['50000', '100000', 'commitment...']
 * );
 * ```
 */
export declare class RangeProofCircuit implements Circuit {
    getMetadata(): CircuitMetadata;
    validatePrivateInputs(inputs: Record<string, unknown>): boolean;
    validatePublicInputs(inputs: string[]): boolean;
    computeWitness(privateInputs: Record<string, unknown>, publicInputs: string[]): Promise<Uint8Array>;
    extractPublicInputs(privateInputs: Record<string, unknown>): string[];
    /**
     * Create a commitment to a value for use in range proofs
     */
    createValueCommitment(value: number): Promise<{
        commitment: string;
        randomness: string;
    }>;
    private generateNonce;
    private serializeWitness;
}
/**
 * Set Membership Circuit
 *
 * Proves that a user is a member of an allowed set without revealing
 * which specific member they are. Uses Merkle tree proofs.
 *
 * Public Inputs:
 * - Merkle root of the set
 * - Nullifier (to prevent double-use without revealing identity)
 *
 * Private Inputs:
 * - User's element (leaf value)
 * - Merkle proof (siblings and path indices)
 * - Nullifier secret
 *
 * Constraints:
 * - MerkleVerify(root, leaf, siblings, pathIndices) = true
 * - nullifier = Hash(element, nullifierSecret)
 *
 * @example
 * ```typescript
 * const circuit = new SetMembershipCircuit();
 * const witness = await circuit.computeWitness(
 *   {
 *     element: 'user123',
 *     merkleProof: { siblings: [...], pathIndices: [...] },
 *     nullifierSecret: '...'
 *   },
 *   ['merkleRoot', 'nullifier']
 * );
 * ```
 */
export declare class SetMembershipCircuit implements Circuit {
    getMetadata(): CircuitMetadata;
    validatePrivateInputs(inputs: Record<string, unknown>): boolean;
    validatePublicInputs(inputs: string[]): boolean;
    computeWitness(privateInputs: Record<string, unknown>, publicInputs: string[]): Promise<Uint8Array>;
    extractPublicInputs(privateInputs: Record<string, unknown>): string[];
    /**
     * Compute Merkle root from leaf and proof
     */
    computeMerkleRoot(leaf: string, proof: MerkleProof): Promise<string>;
    /**
     * Build a Merkle tree from a set of elements
     */
    buildMerkleTree(elements: string[]): Promise<{
        root: string;
        proofs: Map<string, MerkleProof>;
    }>;
    private generateProof;
    private hashLeaf;
    private hashPair;
    private computeNullifier;
    private generateNonce;
    private serializeWitness;
}
/**
 * Credential Verification Circuit
 *
 * Proves possession of a valid credential without revealing the credential
 * itself. Supports selective disclosure of specific claims.
 *
 * Public Inputs:
 * - Issuer public key or DID
 * - Credential schema hash
 * - Disclosed claim hashes
 * - Predicate results
 *
 * Private Inputs:
 * - Full credential
 * - Credential signature
 * - Claims to prove
 *
 * Constraints:
 * - VerifySignature(issuerPK, credential, signature) = true
 * - Hash(credential.schema) = schemaHash
 * - For each disclosed claim: Hash(claim) matches public input
 * - For each predicate: predicate evaluation is true
 *
 * @example
 * ```typescript
 * const circuit = new CredentialVerificationCircuit();
 * const witness = await circuit.computeWitness(
 *   {
 *     credential: { ... },
 *     selectiveDisclosure: {
 *       reveal: ['name'],
 *       predicates: [{ claim: 'age', operator: 'gte', value: 21 }]
 *     }
 *   },
 *   ['issuerDID', 'schemaHash']
 * );
 * ```
 */
export declare class CredentialVerificationCircuit implements Circuit {
    getMetadata(): CircuitMetadata;
    validatePrivateInputs(inputs: Record<string, unknown>): boolean;
    validatePublicInputs(inputs: string[]): boolean;
    computeWitness(privateInputs: Record<string, unknown>, publicInputs: string[]): Promise<Uint8Array>;
    extractPublicInputs(privateInputs: Record<string, unknown>): string[];
    /**
     * Evaluate a predicate against credential claims
     */
    private evaluatePredicate;
    private hashClaim;
    private generateNonce;
    private serializeWitness;
}
/**
 * Create a new circuit registry with built-in circuits
 */
export declare function createCircuitRegistry(): CircuitRegistry;
/**
 * Get a specific circuit by type
 */
export declare function getCircuit(type: ZKCircuitType): Circuit;
//# sourceMappingURL=circuits.d.ts.map