Threat model

What SettleProof protects, and what it does not.

SettleProof turns post-purchase settlement into a verifiable state machine. It does not magically prove real-world truth; it makes the merchant's delivery claim cryptographic, attributable, and enforceable by escrow rules.

Trust boundaries

ActorCan doCannot do
Agent ownerCreate escrow, fund vault, claim refund after TTLRelease merchant funds without a valid merchant attestation
MerchantRegister an attestor key and sign delivery proofsMove escrowed funds without the custody program accepting proof
Attestor keySign a proof hash for a specific escrow and timestampReuse a stale proof outside the accepted freshness window
Relay / API / x402 middlewareSubmit signed transactions, expose reads, and sponsor UXForge delivery proof without the merchant attestor key
Registry adminInitialize registry and suspend/slash merchants in current MVPBypass escrow release/refund state checks

Core controls in the current programs

  1. Escrow PDA is derived from agent_owner and task_hash, which prevents accidental duplicate escrows for the same task.
  2. release_escrow only runs while EscrowState::Pending.
  3. The merchant account passed to release must match the merchant stored in the escrow.
  4. The attestor program scans previous transaction instructions for an Ed25519 sysvar instruction and checks pubkey, payload, and freshness.
  5. The signed payload binds escrow_pda, proof_hash, and timestamp_le.
  6. Refund does not require the merchant; after TTL, anyone can triggerclaim_refund back to the agent owner.

Known beta limitations

Merchant truth is attributable, not magic

SettleProof verifies that a registered merchant attestor signed a delivery proof. It does not independently inspect the physical world. Fraudulent merchant attestations become attributable evidence for reputation, slashing, and future arbitration.

Attestor key custody

The devnet dashboard exposes the base64 attestor secret by design to demonstrate merchant self-custody: SettleProof cannot sign proof of delivery for the merchant. Mainnet deployments should use HSM/KMS or a merchant-owned signing service, plus rotation policy.

x402 post-handler failure

The middleware settles after the handler returns a body. If settlement fails, it marks response headers with x-payment-settled: false and leaves the escrow pending for TTL refund. Production integrations should treat that as a retry/refund path.

Registry policy

Current registry/admin policy is MVP-grade. Mainnet needs merchant KYB rules, upgrade authority policy, emergency pause design, and public incident procedure.

Replay and stale-proof handling

signed_message = escrow_pda (32 B) || proof_hash (32 B) || timestamp_le (8 B)

Controls:
  • escrow_pda binds proof to one escrow
  • escrow state must be Pending
  • timestamp freshness window rejects stale attestations
  • merchant attestor pubkey must match MerchantAccount
  • task_hash binds x402 request intent to escrow creation

Mainnet readiness checklist

AreaRequired before real value
ContractsExternal Anchor review/audit + expanded negative tests
USDCReal mint integration and token-account edge-case review
KeysMerchant attestor KMS/HSM custody and rotation flow
RegistryKYB policy, admin controls, suspension/slashing process
OperationsIndexer, alerts, event monitoring, incident runbook
GovernanceUpgrade authority, pause/emergency policy, disclosure
x402Retry semantics and settlement-failure UX