feat: USDT reward system — billing ledger, devnet treasury, settlement loop, forfeiture PoW, tracker dashboard (US-030…US-035, ADR-0015)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Dobromir Popov
2026-07-02 22:31:02 +02:00
parent 4d4ab607ca
commit 1e0aa6ea8f
24 changed files with 3168 additions and 994 deletions

View File

@@ -0,0 +1,46 @@
# 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).