# meshnet-validator Optimistic fraud detection (ADR-0003, penalty amended by ADR-0015): the validator re-runs a random ~5% sample of completed inference requests against a trusted reference node and, on divergence, submits a slash proof and forfeits the node's pending balance. ## Why the penalty deters cheating There is no upfront stake. Settlement is periodic (US-033), so a node always has an unpaid **pending balance** — that balance *is* the collateral. At a sampling rate `p`, a cheater is caught on average once every `1/p` fraudulent jobs, so cheating is unprofitable when: ``` penalty > per_job_gain / p # p = 0.05 → penalty > 20 × per_job_gain ``` With the production settlement period of 24h, the pending balance at any moment approximates a full day's earnings — hundreds to thousands of jobs — which is far above the 20× bar. Each catch also records a strike; three strikes ban the wallet (registration rejected, excluded from routes, unpaid pending never settled), and the probationary period (first N jobs unpaid) makes re-entry with a fresh wallet costly. Two operational notes: - Shortening the settlement period shrinks the collateral. Period changes must weigh chain overhead against deterrence. - A cheater immediately after a payout has little to forfeit — the strike/ban ladder covers that window. ## Usage ```python ValidatorProcess( contracts=contracts, # registry/validation boundary billing=ledger, # BillingLedger — enables forfeiture reference_node_url="http://...", sample_rate=0.05, ) ``` Remote validators can instead call the tracker's privileged `POST /v1/billing/forfeit` endpoint (non-empty Authorization header).