> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pesapay.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Claims contract

> Checks zkTLS claims on-chain and keeps the set of spent payment nullifiers.

The claims contract is the on-chain consumer of [zkTLS claims](/zktls/claims). It knows which verifier keys are valid on this network, checks a claim's signature and time, and records each payment nullifier once.

## Functions

| Function | Caller | Behaviour |
| - | - | - |
| `register_key(admin, member_id, epoch, key, network)` | Admin | Registers a verifier's Ed25519 claim key for one network and epoch |
| `verify(claim) -> VerifiedClaim` | Anyone | Decodes the canonical claim, checks the key is registered and live for this network, checks ledger time against `issued_at` and `expires_at` (60 s skew), then checks the Ed25519 signature |
| `consume_nullifier(nullifier)` | Orchestrator | Marks a nullifier spent. Fails if it was already spent |

`verify` checks the signature last, because Soroban's `ed25519_verify` panics on failure instead of returning an error.

## What a claim must bind

The orchestrator accepts a verified claim only if:

* `satisfied` is true. Every predicate in the payment policy held.
* The policy is the one registered for the order's rail and direction.
* The `context_digest` matches the order. The contract recomputes it from on-chain data, so a claim made for one order cannot settle another.
* The nullifier is unspent.

## Network binding

Verifier keys are registered per network, and the network is part of the claim's domain. A claim signed for testnet fails on a mainnet orchestrator.

## Why the contract checks a signature, not the proof

The payment proof is an interactive zero-knowledge proof between the phone and an attested verifier. It is not a succinct proof that a contract can check by itself. The verifier runs in an AMD SEV-SNP enclave, checks the capture receipts and the proof, and signs the claim with a per-epoch key that never leaves the enclave. The contract trusts that key through the registry. See the [trust model](/security/trust-model).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.