Overview
Multi-Party Computation (MPC) enables multiple parties to jointly compute a function over their private inputs without revealing those inputs to each other. In the Cross-Media Measurement API, MPC allows DataProviders to contribute event data to measurements while keeping individual user data private from other participants.Why MPC?
Traditional measurement approaches require sharing raw user-level data, creating privacy risks: ❌ Without MPC:- DataProviders must share raw event logs
- Central party sees all user-level data
- High risk of data breaches or misuse
- Regulatory compliance challenges
- Each DataProvider keeps raw data private
- Only aggregate results are revealed
- No single party sees individual user data
- Built-in differential privacy guarantees
MPC protocols are cryptographically secure: even if some participants collude, individual user data remains protected as long as at least one honest participant exists.
MPC Architecture
The Cross-Media Measurement API uses a Duchy-based architecture:Key Participants
DataProviders- Encrypt their event data into cryptographic sketches
- Upload encrypted sketches to Duchies
- Never share raw user-level data
- Independent, non-colluding computation workers
- Execute MPC protocols to aggregate encrypted data
- Operate on encrypted data without decryption
- Jointly produce encrypted results
- Receives encrypted results
- Decrypts using their private key
- Cannot access individual DataProvider data
Duchies are operated by separate entities with strong non-collusion guarantees. The system remains secure as long as at least one Duchy is honest.
Supported MPC Protocols
The API supports multiple MPC protocols, each optimized for different scenarios:Liquid Legions V2
Purpose: Reach and frequency measurements- Uses elliptic curve cryptography for secure aggregation
- Supports both reach and frequency distribution
- Configurable sketch parameters for accuracy/performance trade-offs
- Multiple noise mechanisms (geometric, discrete Gaussian)
- DataProviders create Liquid Legions sketches of their event data
- Sketches are encrypted with Duchy public keys
- Duchies perform homomorphic operations to merge sketches
- Multiple rounds of shuffling and re-encryption ensure privacy
- Final result is encrypted for MeasurementConsumer
Reach-Only Liquid Legions V2
Purpose: Optimized reach-only measurements- Simplified sketch structure for reach-only computations
- Faster computation than full Liquid Legions V2
- Lower bandwidth requirements
- Same privacy guarantees
- Only need unique reach (no frequency distribution)
- Large-scale measurements requiring fast results
- Bandwidth-constrained environments
Honest Majority Share Shuffle (HMSS)
Purpose: Alternative MPC protocol with different security model- Requires honest majority of workers (>50% must be honest)
- Secret sharing based approach
- Supports VID sampling interval wrapping
- Configurable ring modulus for security
- Secure as long as majority of Duchies are honest
- Different threat model than Liquid Legions
- May offer better performance in some scenarios
The ring modulus must be greater than (1 + maximum_frequency × number of DataProviders) for reach and frequency measurements.
TrusTEE
Purpose: Trusted execution environment based computation- Uses hardware-based trusted execution environments (TEEs)
- Data processed in secure enclaves
- Attestation-based trust model
- Lower communication overhead
- DataProviders support TEE fulfillment
- Need for faster computation
- Hardware-based security is acceptable
TrusTEE availability depends on DataProvider capabilities. Check the
capabilities field in the DataProvider resource.Duchy Interaction
Requisitions include Duchy-specific parameters for each worker:Liquid Legions V2 Duchy Info
HMSS Duchy Info
public_key is specified, DataProviders use it to encrypt the random seed.
Protocol Selection
The system automatically selects a protocol based on several factors:Selection Criteria
-
Measurement Type
- REACH_AND_FREQUENCY → Liquid Legions V2 or HMSS
- REACH → Reach-Only Liquid Legions V2 or HMSS
- IMPRESSION/DURATION → Direct protocol
- POPULATION → Direct protocol
-
DataProvider Capabilities
Protocol must be supported by all participating DataProviders.
-
Available Duchies
- Sufficient Duchies must be available
- Required Duchies (specified in DataProvider) must be included
-
Privacy Parameters
- Noise mechanism compatibility
- Privacy budget requirements
Privacy Guarantees
Cryptographic Security
MPC protocols provide cryptographic guarantees: Liquid Legions V2:- Secure against semi-honest adversaries
- Semantic security from elliptic curve cryptography
- Privacy preserved even if N-1 Duchies collude
- Secure against semi-honest adversaries
- Requires >50% honest Duchies
- Information-theoretic security from secret sharing
Differential Privacy
All protocols include differential privacy noise:- Data Provider Noise: Added by DataProviders before encryption
- Global Noise: Added during aggregation
- Combined Protection: Multiple noise layers ensure privacy
Differential privacy provides mathematical privacy guarantees even if an adversary has arbitrary side information.
Requisition Fulfillment
DataProviders fulfill requisitions differently based on protocol:MPC Protocols (Liquid Legions, HMSS)
- Process events according to RequisitionSpec
- Create sketch representing event data
- Apply DP noise at DataProvider level
- Encrypt sketch using Duchy public keys
- Upload encrypted sketch via RequisitionFulfillment API
Direct Protocol
- Compute result directly (reach, impression count, etc.)
- Apply DP noise
- Sign result with DataProvider certificate
- Encrypt result for MeasurementConsumer
- Upload via FulfillDirectRequisition API
Direct protocol means the DataProvider computes the result themselves without MPC. This is appropriate for single-party measurements or simple aggregations.
Performance Considerations
Computation Time
MPC computation time depends on:- Protocol choice: Reach-only is faster than full R&F
- Number of DataProviders: More providers = longer computation
- Sketch size: Larger sketches = more processing
- Number of Duchies: More workers = more coordination overhead
- Reach-only: Minutes to tens of minutes
- Reach & Frequency: Tens of minutes to hours
- Direct: Seconds to minutes
Bandwidth
Key bandwidth consumers:- Sketch upload: DataProviders → Duchies
- Inter-Duchy communication: Shuffling and aggregation
- Result download: Duchies → MeasurementConsumer
- Use reach-only when frequency not needed
- Tune sketch parameters for size/accuracy trade-off
- Use VID sampling for large populations
Best Practices
Protocol Selection
- Use reach-only when you don’t need frequency distribution
- Consider HMSS for alternative security model
- Check DataProvider capabilities before expecting specific protocols
- Understand security assumptions of each protocol
Security
- Verify Duchy independence in your deployment
- Monitor certificate status for all participants
- Use strong elliptic curves (prime256v1 or better)
- Apply appropriate DP parameters for your privacy needs
Performance
- Choose appropriate sketch sizes balancing accuracy and speed
- Use VID sampling for very large populations
- Batch measurements when possible
- Monitor computation progress via Measurement state
Related Concepts
- Measurements - Understanding measurement types and lifecycle
- Differential Privacy - Privacy protection mechanisms
- Resource Model - Understanding Duchies and DataProviders
