wfa.measurement.system.v1alpha.Requisitions) manages the lifecycle of requisitions from creation through fulfillment by data providers.
Overview
The Requisitions service provides:- Requisition state management - Track requisition from creation to fulfillment
- Sketch upload coordination - Handle encrypted sketch submission
- Nonce verification - Prevent replay attacks and double fulfillment
- Fulfillment context - Capture metadata about sketch generation
Requisition Resource
A Requisition represents a request for aggregated event data from a specific data provider.Resource nameFormat:
computations/{computation}/requisitions/{requisition}SHA-256 hash of encrypted requisition specificationImmutable. Used to verify requisition integrity.
SHA-256 hash of the nonce valueImmutable. Used to verify nonce without exposing it.
Current state of the requisition (output only)Values:
UNFULFILLED- Awaiting data provider fulfillmentFULFILLED- Sketch successfully uploaded (terminal)REFUSED- Data provider declined to fulfill (terminal)WITHDRAWN- Measurement consumer cancelled (terminal)
Duchy assigned to fulfill this requisition (output only)Format:
computations/{computation}/participants/{duchy}Decrypted nonce value (output only)Only available after fulfillment. Used to verify sketch authenticity.
Additional context about fulfillment (output only)
Service Methods
FulfillRequisition
Transition a requisition fromUNFULFILLED to FULFILLED state.
Resource name of the requisitionFormat:
computations/{computation}/requisitions/{requisition}Decrypted nonce from the requisition specificationThis value proves the data provider successfully decrypted the requisition spec.
Additional context about the fulfillmentFields:
build_label- Version of software that generated the sketchwarnings- Array of human-readable warning messages (no sensitive data)
Optional etag for optimistic concurrency controlIf specified and doesn’t match current etag, returns
ABORTED status.Updated requisition resource with state set to
FULFILLEDRequisition Fulfillment Flow
Usage Example
Fulfilling a Requisition
Complete Fulfillment Workflow
Nonce Verification
The nonce mechanism prevents replay attacks:- Kingdom generates nonce - Random 64-bit value
- Kingdom encrypts spec - Nonce included in encrypted requisition spec
- Kingdom stores hash -
requisition.nonce_hash = SHA256(nonce) - Data provider decrypts - Extracts nonce from encrypted spec
- Data provider fulfills - Sends nonce in
FulfillRequisitioncall - Kingdom verifies - Computes SHA256(nonce) and compares with stored hash
The nonce is only transmitted once during fulfillment. After fulfillment, it’s stored in
requisition.nonce for audit purposes.Fulfillment Context
TheFulfillmentContext message provides additional metadata:
Version identifier of the software that generated the sketchExample:
"edp-simulator-v2.1.0", "publisher-edp-v1.5.3"Used for debugging and version tracking.Human-readable warning messages about the fulfillmentExamples:
"5% of events excluded due to invalid VIDs""Data coverage: 98.3%""Some events outside requested time range"
State Transitions
Terminal States:FULFILLED- Success, sketch available for computationREFUSED- Data provider cannot/will not fulfillWITHDRAWN- Measurement consumer cancelled measurement
Error Handling
Invalid requisition name format or nonce valueCommon causes:
- Malformed resource name
- Nonce is 0 or negative
- Missing required fields
Requisition does not existResolution: Verify requisition name is correct and requisition hasn’t been withdrawn
Requisition not in UNFULFILLED stateCommon causes:
- Already fulfilled (nonce verified on first call)
- Already refused by data provider
- Withdrawn by measurement consumer
Nonce hash verification failed or etag mismatchCommon causes:
- Incorrect nonce value (doesn’t match hash)
- Concurrent modification (etag mismatch)
- Verify nonce was decrypted correctly
- Retry with fresh requisition and updated etag
Data provider lacks permission to fulfill this requisitionResolution: Verify authentication credentials and that requisition is assigned to this data provider
Security Best Practices
Protect nonce values
Protect nonce values
Nonces are cryptographic secrets. Never log nonce values in plaintext or expose them in error messages.
Verify nonce hash before fulfillment
Verify nonce hash before fulfillment
Before calling
FulfillRequisition, verify that SHA256(nonce) matches requisition.nonce_hash to catch decryption errors early.Use secure channels
Use secure channels
Always use TLS (preferably mTLS) when communicating with the Kingdom to protect nonces in transit.
Upload sketches before fulfilling
Upload sketches before fulfilling
Ensure encrypted sketches are successfully uploaded to blob storage before calling
FulfillRequisition. Once fulfilled, requisitions cannot be re-fulfilled.Validate sketch encryption
Validate sketch encryption
Verify that sketches are encrypted with the correct duchy public keys before upload to prevent data leakage.
Audit all fulfillments
Audit all fulfillments
Log all requisition fulfillments with timestamps, nonce hashes (not nonces), and operator IDs for security auditing.
Related APIs
Data Provider API
Higher-level data provider APIs
Computation Control
Duchy computation coordination