aps_verify_settlement
Verify a signed settlement's signature, Merkle roots, and conservation. Detects gateway attempts to inflate or suppress shares.
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 | Yes | 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 |