Zero-Knowledge Private Set Intersection & Homomorphic Lookalike Audience Mesh
Enables cross-enterprise swarms to discover shared high-propensity buyer intents and collaborative lookalikes without exposing raw PII, customer graphs, or competitive secrets.
The death of third-party cookies, Apple ATT, and aggressive privacy regulations (GDPR Article 9, CCPA) have dismantled traditional programmatic ad targeting. Enterprise brands possess rich, first-party behavioral graphs, but cannot cross-pollinate with partner ecosystems without severe legal liability and customer trust erosion.
zk-cleanroom provides a decentralized Cryptographic Data Cleanroom based on:
-
Diffie-Hellman Private Set Intersection (DH-PSI): Computes customer intersection cardinality with zero knowledge of non-overlapping entities using commutative exponentiation:
$$H(x)^{k_A k_B} \equiv H(x)^{k_B k_A} \pmod p$$ -
Paillier Additive Homomorphic Lookalike Scoring: Computes vector similarity inner products directly in ciphertext space without decrypting candidate feature coordinates:
$$\llbracket \mathbf{x} \cdot \mathbf{y} \rrbracket = \prod_{i=1}^d \llbracket x_i \rrbracket^{y_i} \pmod{n^2}$$ -
Zero Plaintext PII Egress: Mathematically guarantees
$0\text{ bytes}$ of raw customer identifiers, email hashes, or behavioral telemetry are exposed between participants.
Given RFC 3526 1536-bit safe prime
- Step 1:
$A \to B: {H(a_i)^{k_A} \pmod p}$ ,$B \to A: {H(b_j)^{k_B} \pmod p}$ - Step 2:
$A \to B: { (H(b_j)^{k_B})^{k_A} \pmod p }$ ,$B \to A: { (H(a_i)^{k_A})^{k_B} \pmod p }$ - Overlap:
$Z_A \cap Z_B = { H(x)^{k_A k_B} \pmod p }$
Key parameters:
- Encryption:
$c = (1 + m \cdot n) \cdot r^n \pmod{n^2}$ - Decryption:
$m = L(c^\lambda \pmod{n^2}) \cdot \lambda^{-1} \pmod n$ - Inner Product:
$\llbracket \mathbf{x} \cdot \mathbf{y} \rrbracket = \prod_{i=1}^d c_i^{y_i} \pmod{n^2}$
git clone https://github.com/AAH20/zk-cleanroom.git
cd zk-cleanroomZero third-party dependencies. Pure Python 3.10+ standard library.
from zk_cleanroom import EnterpriseParticipant, CleanroomMeshCoordinator
coordinator = CleanroomMeshCoordinator()
# Enterprise A & Enterprise B
party_a = EnterpriseParticipant("CORP_A", ["[email protected]", "[email protected]"], {"[email protected]": [50, 100]})
party_b = EnterpriseParticipant("CORP_B", ["[email protected]", "[email protected]"], {"[email protected]": [40, 90]})
# 1. Discover shared customers (DH-PSI)
shared = coordinator.discover_shared_customers(party_a, party_b)
print(f"Discovered Mutual Accounts: {shared}")
# 2. Homomorphic Lookalike Matching (0 PII leaked)
matches = coordinator.match_lookalikes(sponsor=party_a, evaluator=party_b, target_profile_vector=[2, 1])
print(f"Top Lookalike: {matches[0].candidate_id} (Score: {matches[0].similarity_score})")python3 -m unittest discover -s tests -vMIT License. Authored by Ahmed Hassan.