patcg-individual-drafts / private-aggregation-api

Explainer for proposed web platform API
https://patcg-individual-drafts.github.io/private-aggregation-api/
39 stars 16 forks source link

Is it possible to send a negative value in contributeToHistogram()? #125

Closed romanych closed 2 months ago

romanych commented 2 months ago

Imagine we sent a contribution to the histogram that the user made a purchase. The next day, the user cancelled her purchase. Is it possible to send a negative value so that it will be deducted in the summary report?

rushilw-google commented 2 months ago

Hi @romanych, Private Aggregation API does not support negative value contributions. You could use a new key for cancellations and subtract the aggregate value from a purchase summary report. However, both reports will be noised by the Aggregation Service separately before you can perform the subtraction on your side.

While we could theoretically support negative values, it might not solve this use case, as cancellations could easily fall in different batches for Aggregation Service processing. Note that negative values would still need to consume positive contribution budget even if they cancel out a previous contribution.

romanych commented 2 months ago

Got it, @rushilw-google. Thank for your answer.