Architectural Overview
The Halo Cross-Media Measurement System employs a distributed architecture with clear separation of concerns between coordination (Kingdom) and secure computation (Duchies). This design ensures that no single entity can access raw measurement data while still enabling accurate aggregate measurements.Core Architecture Principles
Separation of Duties
Kingdom coordinates workflow; Duchies perform secure computation
Threshold Cryptography
Distributed private key requires all Duchies to participate
Independent Operations
Each Duchy operated by different organization
Multi-Cloud Security
Duchies deployed across different cloud providers
System Topology
At a high level, the system requires at least three independent deployments:The Kingdom
The Kingdom is a single deployment that serves as the control plane for the measurement system.Kingdom Responsibilities
Report Configuration
Advertisers (measurement consumers) configure reports through the Kingdom’s public API, specifying campaigns, time ranges, and measurement types.
Requisition Management
The Kingdom determines which data is required from publishers and compiles requisitions. It tracks which requisitions are open and which are fulfilled.
Computation Coordination
The Kingdom determines when measurements are ready to compute (all requisitions fulfilled) and assigns work to Duchies.
Kingdom Services
The Kingdom deployment includes:- Public API Server (v2alpha): External-facing API for measurement consumers
- System API Server (v1alpha): System-level API for Duchies and internal services
- Internal Data Server: Kingdom’s internal database access layer
- Batch Jobs: Periodic cleanup and maintenance tasks
The Duchies
The Duchies are at least two (typically three or more) separate deployments, each operated by an independent organization. They store encrypted data and perform the secure multiparty computations required to generate measurements.Duchy Responsibilities
- Encrypted Data Storage: Store encrypted sketches submitted by publishers
- Secure Computation: Participate in multi-round computation protocols
- Partial Key Management: Hold one piece of the distributed private key
- Workflow Execution: Poll Kingdom for work and execute computation stages
Key Duchy Components
Herald Daemon
Herald Daemon
Polls the Kingdom to claim pending computations that are ready to execute. Determines which measurements have all necessary requisitions fulfilled and starts the computation workflow.
Mill (Computation Engine)
Mill (Computation Engine)
Executes the actual secure computation protocols. Different mill implementations exist for different protocols:
- Liquid Legions v2 Mill: Full reach and frequency measurements
- HMSS Mill: Honest Majority Share Shuffle protocol
- Trustee Mill: Handles key generation and management
Computation Control Service
Computation Control Service
Manages the state machine for computations, coordinating the multi-stage computation process across Duchies.
Requisition Fulfillment Service
Requisition Fulfillment Service
Public API that publishers use to submit encrypted sketches and fulfill requisitions.
Data Flow Architecture
The following describes how data flows through the system from report creation to result delivery:Phase 1: Report Configuration
Measurement Creation
Advertiser submits measurement request to Kingdom specifying event groups and measurement type (reach, frequency, etc.)
Phase 2: Data Collection
Requisition Retrieval
Publishers query the Duchy API to retrieve their pending requisitions (proxied from Kingdom)
Sketch Computation
Publishers compute encrypted sketches using algorithms similar to HyperLogLog for cardinality and frequency estimation. These sketches contain aggregated, encrypted representations of user events.
Encryption
Publishers encrypt sketches using the combined public key of all Duchies. This threshold encryption scheme means only the collective Duchies can decrypt.
The sketch-based approach allows efficient storage and computation while preserving privacy. Instead of storing individual events, publishers create compact probabilistic data structures that support the required measurements.
Phase 3: Secure Multiparty Computation
Once all requisitions are fulfilled, the actual computation begins:Work Assignment
Kingdom marks the computation as ready. Duchy Herald daemons poll the Kingdom and claim the work. One Duchy is designated as the “Primary Duchy” for this computation.
Sketch Collection
All Duchies fetch the required encrypted sketches from storage. Each Duchy interleaves noise into the sketches (for differential privacy) and sends them to the Primary Duchy.
Sketch Combination
The Primary Duchy combines all encrypted sketches with noise into a unified encrypted dataset.
Round 1: Shuffle
Computation makes the first round through all Duchies in deterministic order. Each Duchy shuffles the encrypted sketches to destroy information about register indices that could leak data.
Round 2: Decrypt
Computation makes the second round through all Duchies. Each Duchy uses its piece of the distributed private key to partially decrypt the results. After all Duchies complete this step, the data is fully decrypted.
Visual: Computation Flow
Secure Multiparty Computation Protocols
Halo CMMS implements multiple MPC protocols, each with different performance and security characteristics:Liquid Legions v2 (LLv2)
The primary protocol for full reach and frequency measurements:- Use Case: Complete frequency histograms and reach measurements
- Rounds: Two rounds through all Duchies
- Security: Threshold encryption with noise injection
- Performance: Suitable for most production workloads
Reach-Only Liquid Legions v2
Optimized variant for reach-only measurements:- Use Case: When only unique reach is needed (no frequency distribution)
- Optimization: Reduced computation complexity
- Rounds: Two rounds (simplified processing)
Honest Majority Share Shuffle (HMSS)
Alternative protocol with different security assumptions:- Use Case: Alternative security model
- Assumption: Requires honest majority of Duchies
- Performance: Different performance characteristics than LLv2
Protocol configuration is specified in the Kingdom and Duchy secret configurations. See the deployment guides for details on protocol setup.
Storage Architecture
Kingdom Storage
The Kingdom uses Google Cloud Spanner for its primary datastore:- Stores measurement configurations and requisitions
- Tracks computation state and assignments
- Manages resource metadata (data providers, measurement consumers, etc.)
- Provides global consistency and high availability
Duchy Storage
Duchies use a combination of storage systems:- Google Cloud Spanner: Computation state and metadata
- Google Cloud Storage (GCS) or AWS S3: Encrypted sketch blobs
- Postgres (optional): For certain deployment configurations
Storage is isolated per Duchy. No Duchy can access another Duchy’s storage, ensuring data cannot be combined to compromise privacy.
Network Architecture and Security
API Layers
The system exposes multiple API layers with different security and access controls:Public APIs
External load balancer endpoints for measurement consumers and data providers. Require mTLS authentication.
System APIs
Inter-system communication between Kingdom and Duchies. Require mTLS with certificate validation.
Internal APIs
Cluster-internal services (ClusterIP). Not exposed outside Kubernetes cluster.
gRPC Protocol
All services communicate via gRPC with TLS encryption and authentication.
Certificate-Based Authentication
All components use mutual TLS (mTLS) for authentication:- Each entity (Kingdom, Duchy, Data Provider, Measurement Consumer) has its own certificate authority
- Certificates include both TLS certificates and consent signaling certificates
- Authority Key Identifiers (AKID) map certificates to resource identities
- All root certificates are distributed to form trusted certificate stores
Network Policies
Kubernetes network policies provide defense-in-depth:- Default deny-all ingress and egress
- Explicit policies for each service component
- Isolation between different deployment namespaces
Deployment Topology
Kingdom Deployment
Typical Kingdom deployment on GKE:Duchy Deployment
Typical Duchy deployment on GKE:Differential Privacy Integration
Differential privacy is integrated at multiple layers:- Noise Injection: Each Duchy adds calibrated noise to encrypted sketches before sending to Primary Duchy
- Noise Configuration: Protocol configurations specify noise parameters
- Privacy Budget Management: Optional privacy budget manager tracks cumulative privacy loss
- Aggregation: Noise is aggregated during the secure computation
Scalability Considerations
- Horizontal Scaling: Services can be scaled by increasing replica counts
- Cloud Spanner: Automatically scales for database workload
- Mill Jobs: Computation mills run as Kubernetes Jobs, scheduled dynamically
- Storage: Cloud Storage scales automatically with data volume
Next Steps
System Components
Detailed breakdown of all Kingdom and Duchy services
Kingdom Deployment
Step-by-step Kingdom deployment guide
Duchy Deployment
Complete Duchy deployment instructions
Operations
Operational guides for managing the system