aps_aggregate_settlement
Aggregate batches of attribution primitives into a signed settlement record for a given period, with balanced-Merkle commitments per axis and residual buckets for sub-threshold contributors.
Instructions
Aggregate a batch of Attribution Primitives over a half-open settlement period [t0, t1) into a signed SettlementRecord. Each axis (D, P, G, C) produces a per-contributor total with a balanced-Merkle commitment. Residual buckets pool sub-threshold contributors per Build A §4.1. Output is a fully signed record ready for third-party verification. Spec: BUILD-C-SETTLEMENT-PIPELINE.md.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | Yes | ||
| receipts | Yes | Array of AttributionPrimitives to aggregate | |
| issued_at | No | Override issued_at (canonical ISO-8601 UTC ms + Z); defaults to now | |
| gateway_did | Yes | Gateway DID that signs the record | |
| gateway_private_key | Yes | Ed25519 gateway private key (hex) |