Skip to content

Commit 890d1be

Browse files
authored
PMT API surface updates (#1359)
* Edit PMT API surface * Add some prose
1 parent f800256 commit 890d1be

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

PA_private_model_training.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@ Note: while supporting model training for auction _losers_ is a worthwhile goal,
1919

2020
## Contributing to the encrypted modeling signals byte vector
2121

22-
Within `generateBid`, the buyer can supply an arbitrarily sized `Uint8Array` as the raw bytes to be encrypted. This can optionally replace the `modelingSignals` return value.
22+
Within `generateBid`, the buyer can supply an arbitrary JSON-serializable output (`aggregateWinSignals`), which can be processed later on into an encrypted report.
2323

2424

2525
```javascript
26-
function generateBid(..., reportingMechanisms) {
26+
function generateBid(...) {
2727
...
28-
let mySignals = new Float32Array([1.3, 12.19, ...])
29-
let rawBytes = new Uint8Array(mySignals.buffer);
28+
let mySignals = [1.3, 12.19, ...]
3029
...
3130
return {
3231
...,
33-
modelingSignals: rawBytes
32+
aggregateWinSignals: mySignals
3433
};
3534
}
3635
```
@@ -39,36 +38,38 @@ function generateBid(..., reportingMechanisms) {
3938

4039
## Configuring the encrypted payload and emitting it in `reportWin`
4140

42-
In order to avoid the length (and other metadata) about the payload being a privacy leak vector, it cannot be configured based on protected cross-site data (e.g. from within `generateBid`). We propose enabling this kind of configuration from within `reportWin`. While currently `modelingSignals`, `recency`, and `joinCount` are exposed directly to this function, we propose that they move to be wrapped in an opaque object that can expose multiple mechanisms.
43-
41+
In order to avoid the length (and other metadata) about the payload being a privacy leak vector, it cannot be configured based on protected cross-site data (e.g. from within `generateBid`). We propose enabling this kind of configuration from within `reportWin`,
42+
which will configure a new function (`reportAggregateWin`) to run. This new function will have access to the `aggregateWinSignals` returned from `generateBid`.
4443

4544
```javascript
4645
function reportWin(...) {
4746
...
4847
if (useNewMLTrainingAPI) {
49-
// Will POST the encrypted modeling signals to the specified enpoint.
50-
let signals = browserSignals.dynamicModelingSignals;
51-
signals.sendEncryptedTo("https://ad-tech.example/id=123", {
52-
aggregationCoordinatorOrigin: "...",
53-
length: 256, // payload will be padded with null bytes
48+
// Queues up the function reportAggregateWin which is executed immediately after this function.
49+
queueReportAggregateWin({
50+
modelingSignalsConfig: {
51+
destination: "https://ad-tech.example/id=123",
52+
aggregationCoordinatorOrigin: "...",
53+
payloadLength: 256, // payload will be padded with null bytes
54+
}, // Extensible for future configs (e.g. for Private Aggregation API)
5455
});
5556
} else {
5657
// The status quo locally noised signals (recency, joinCount, and modelingSignals)
57-
// can be recovered in one of two ways:
58-
// 1. By calling a new method on dynamicModelingSignals e.g.
59-
// signals.randomizedResponse('recency'). Details TBD.
60-
// 2. By querying directly for modelingSignals, joinCount or recency. This is a
61-
// legacy path to avoid backwards incompatibility, but may be removed in the
62-
// future.
63-
//
64-
// If randomized response is (wrongly) invoked when a Uint8Array was passed in the
65-
// return value of generateBid, we will perform randomized response on the value of
66-
// 0 (as if the caller passed 0 in generateBid).
67-
//
68-
// It will be an error (details TBD) to both call methods on dynamicModelingSignals
69-
// and also use the legacy modelingSignals / joinCount / recency properties.
58+
// can still be used. If they are read we will disallow the generation of the encrypted
59+
// private modeling signals later on.
7060
}
7161
}
62+
63+
function reportAggregateWin(aggregateWinSignals, modelingSignalsConfig, <reportWinInputs>) {
64+
// Allow processing outside of the critical bidding path.
65+
let processedModelingSignals = process(aggregateWinSignals);
66+
67+
// Will POST the encypted modeling signals to the specified destination in modelingSignalsConfig.
68+
// The format of this input is still TBD.
69+
sendEncryptedModelingSignals(processedModelingSignals)
70+
71+
// The Private Aggregation API may be used here.
72+
}
7273
```
7374

7475
## Payload format

0 commit comments

Comments
 (0)