aps_verify_settlement
Verifies a signed SettlementRecord through S1-S5 checks including signature, Merkle roots, conservation, residual shape, and optional input-receipt cross-check to prevent share inflation or suppression.
Instructions
Verify a signed SettlementRecord under S1-S5 (signature, Merkle roots, conservation, residual shape, optional input-receipts cross-check). S3 conservation is the strongest invariant: a gateway cannot inflate or suppress any contributor's share without breaking it. Returns {valid: true} or {valid: false, reason, detail}. Pass inputReceipts to also recompute input_receipts_hash.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| record | No | A signed SettlementRecord | |
| input_receipts | No | Optional — the input Attribution Primitives that fed the settlement. When supplied, S5 cross-checks input_receipts_hash and verifies each receipt individually. | |
| gateway_public_key | Yes | Gateway Ed25519 public key hex |