wfa.measurement.system.v1alpha.ComputationControl) enables Duchies to coordinate multi-party computation (MPC) protocol execution for privacy-preserving measurements.
Overview
The Computation Control Service provides:- Inter-duchy protocol coordination - Duchies advance computations by exchanging encrypted data
- Streaming data transfer - Large encrypted sketches transferred via streaming RPC
- Protocol-agnostic interface - Supports multiple MPC protocols
- Stage management - Track computation progress through protocol stages
Supported MPC Protocols
The service supports three MPC protocols:Liquid Legions V2
Three-round protocol for reach and frequency:- Setup Phase - Initialize sketch parameters
- Execution Phase One - First duchy processing
- Execution Phase Two - Second duchy processing
- Execution Phase Three - Final aggregation
Reach-Only Liquid Legions V2
One-round protocol for reach only:- Setup Phase - Initialize parameters
- Execution Phase - Single-round computation
Honest Majority Share Shuffle
Shuffle-based protocol for reach and frequency:- Shuffle Phase One - First shuffle round
- Shuffle Phase Two - Second shuffle round
- Aggregation Phase - Final aggregation
Service Definition
AdvanceComputation
Streaming RPC to advance a computation by sending encrypted data to another duchy.First message in the stream containing metadataRequired fields:
name- Computation resource nameprotocol- Protocol-specific configuration (one ofliquid_legions_v2,reach_only_liquid_legions_v2,honest_majority_share_shuffle)
Subsequent messages containing data chunksField:
partial_data- Bytes chunk of encrypted computation data
Empty response indicating successful processing
GetComputationStage
Retrieve the current stage of a computation for a specific duchy.Resource name of the computation stageFormat:
computations/{computation}/participants/{duchy}/computationStageCurrent stage information for the computationContains protocol-specific stage details
Protocol Configurations
Liquid Legions V2 Protocol
Type of data being transferredValues:
SETUP_PHASE_INPUT- Initial setup dataEXECUTION_PHASE_ONE_INPUT- First execution phase dataEXECUTION_PHASE_TWO_INPUT- Second execution phase dataEXECUTION_PHASE_THREE_INPUT- Final execution phase data
Reach-Only Liquid Legions V2 Protocol
Type of data being transferredValues:
SETUP_PHASE_INPUT- Initial setup dataEXECUTION_PHASE_INPUT- Execution phase data
Honest Majority Share Shuffle Protocol
Type of data being transferredValues:
SHUFFLE_PHASE_INPUT_ONE- First shuffle phase dataSHUFFLE_PHASE_INPUT_TWO- Second shuffle phase dataAGGREGATION_PHASE_INPUT- Aggregation phase data
Usage Examples
Advancing a Liquid Legions V2 Computation
Getting Computation Stage
Streaming Protocol
TheAdvanceComputation RPC uses client-side streaming:
Streaming Benefits:
- Handles large encrypted datasets (GB-scale)
- Memory-efficient processing
- Supports network interruption recovery
- Enables progress tracking
Computation Lifecycle
Typical flow for a three-duchy Liquid Legions V2 computation: Stage Transitions:-
Setup Phase
- Duchies receive computation parameters
- Initialize local state
- Prepare for execution
-
Execution Phases
- Each duchy processes encrypted data in sequence
- Uses
AdvanceComputationto send results to next duchy - Updates local computation stage
-
Finalization
- Aggregator duchy decrypts final result
- Submits encrypted result to Kingdom
- Computation transitions to
SUCCEEDEDstate
Security Considerations
Mutual TLS Required
Mutual TLS Required
All duchy-to-duchy communication MUST use mutual TLS authentication with valid X.509 certificates.
Encrypt All Data
Encrypt All Data
Data transmitted via
AdvanceComputation must be encrypted using the receiving duchy’s public key. Never send plaintext sketches.Verify Computation State
Verify Computation State
Before advancing a computation, verify it’s in the correct state using
GetComputationStage to prevent protocol violations.Rate Limiting
Rate Limiting
Implement rate limiting on
AdvanceComputation calls to prevent resource exhaustion from malicious or buggy clients.Audit Logging
Audit Logging
Log all computation control operations with duchy identifiers, computation IDs, and timestamps for security auditing.
Error Handling
Invalid computation name or protocol configurationResolution: Verify resource name format and protocol parameters
Computation or computation stage not foundResolution: Verify computation exists and duchy is a participant
Computation not in correct state for advancementResolution: Check computation state before advancing
Stream interrupted or protocol violation detectedResolution: Retry with exponential backoff
Too many concurrent computations or data too largeResolution: Implement backoff and reduce concurrent operations
Related APIs
Computations Service
Computation lifecycle management
Duchy Protocol
Inter-duchy communication protocols