RFC-0004 — Batch settlement format
Owner: Pallet Lead
What it defines
Aggregation of thousands of per-inference receipts into one on-chain settlement extrinsic per epoch per gateway. Reduces 100M tx/day → ~280K tx/day total.
Structure
SettlementBatch {
version,
batch_id, epoch_number, gateway_id,
receipt_count,
merkle_root, // BLAKE2 over leaf=BLAKE2(receipt)
aggregate_burn_cuc,
aggregate_mint_useful,
per_operator_summary: BoundedVec<OperatorSummary>,
gateway_signature
}Validation on chain
- Gateway signature against registered hotkey.
- Per-operator aggregates ≤ on-chain stake-pool capacity.
- Aggregate mint ≤ epoch headroom from
pallet-bme. - Aggregate burn ≥ aggregate mint × USD-equivalent ratio.
Dispute window
T+0 to T+24h: operators dispute missing/wrong summaries via Merkle proof. T+0 to T+epoch_end: validators replay sampled receipts (RFC-0006) and submit slashing for mismatches.
Adversary scenarios
Inflated mint (caught at extrinsic), fake receipts (operator dispute), missing receipts (operator dispute), batch collision (earliest valid wins).