aps_aggregate_settlement
Aggregate attribution primitives over a settlement period into a signed SettlementRecord with per-contributor totals, balanced-Merkle commitments, and residual buckets, ready for third-party verification.
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 |
|---|---|---|---|
| receipts | Yes | Array of AttributionPrimitives to aggregate | |
| period | Yes | ||
| gateway_did | Yes | Gateway DID that signs the record | |
| gateway_private_key | Yes | Ed25519 gateway private key (hex) | |
| issued_at | No | Override issued_at (canonical ISO-8601 UTC ms + Z); defaults to now |