Skip to content

Repository files navigation

SLA Sentinel logo

SLA Sentinel

API escrow governed by live service evidence, not trust alone.

Network Chain ID Status Contract

Contract Frontend SDK Wallet Tests License


SLA Sentinel is a GenLayer StudioNet escrow and evidence-adjudication dApp for API service-level agreements.

A client creates measurable SLA terms, a provider accepts them, and the client escrows test GEN. When the SLA window ends, GenLayer validators fetch public evidence, evaluate uptime, latency, incident history, and any submitted dispute evidence, then produce a proposed settlement. Funds are only withdrawable after the dispute window closes and the final verdict is recorded on-chain.

This is not a generic escrow with an AI label on top. The important part is that the contract can reason over public web evidence that changes from agreement to agreement: health endpoints, monitor reports, status pages, incident feeds, and supplementary URLs submitted by either party. That is exactly the kind of evidence path GenLayer was built to handle.

Live Demo

Surface Value
Web app https://sentinel-protocol-studio.vercel.app
Demo provider API https://sentinel-protocol-provider.vercel.app
Network GenLayer StudioNet
Chain ID 61999
RPC https://studio.genlayer.com/api
Contract 0x80279564BD2925108E0deBc9264AADff2c8bA44B
Deploy tx 0xd89bea53a6290661401c4de2c12d1949fb242e1624cfb3d64ab7048059a01bba

The deployed app reads from the live StudioNet contract. The demo provider is separately hosted over public HTTPS so GenLayer validators can fetch evidence during settlement.

Settlement Flow

Client creates SLA
        |
Provider accepts
        |
Client funds escrow with test GEN
        |
SLA measurement window runs
        |
Either party proposes settlement
        |
5-minute dispute window opens
        |
Either party may add supplementary evidence
        |
Final settlement runs
        |
Withdrawable balances are credited

The first settlement call only proposes a verdict. It does not release escrow. After the five-minute review window, a second settlement call finalizes the result and credits internal withdrawable balances. Each recipient then calls withdraw() to move GEN back to their wallet.

Verdict Policy

Verdict Provider Client Meaning
PASS 100% 0% Evidence supports that the SLA was met.
SOFT_BREACH 80% 20% A limited miss inside the soft-breach band.
HARD_BREACH 0% 100% A material miss, both metrics failing, or confirmed outage.
INCONCLUSIVE Held Held Evidence is unavailable, missing, or contradictory.

A final inconclusive result moves the agreement to REFUND_PENDING, where the client can reclaim the escrow and then withdraw.

Why This Needs GenLayer

SLA Sentinel depends on validator consensus over evidence that cannot be cleanly reduced to one deterministic on-chain number.

  1. Public web access: validators fetch endpoint, status, monitor, incident, and supplementary evidence at settlement time.
  2. Semantic adjudication: monitor data and incident text can conflict, be incomplete, or require context-sensitive interpretation.
  3. Bounded trust: fetched pages are treated as untrusted data, and embedded instructions are ignored.
  4. Deterministic payout: the verdict can use GenLayer's non-deterministic consensus, while the final payout split remains fixed and auditable.

Architecture

+--------------------------------------------------------------------+
| apps/web                                                           |
| React + Vite + TypeScript operational dashboard                    |
| Wallet discovery, StudioNet switching, transaction lifecycle UI     |
+-------------------------------+------------------------------------+
                                | genlayer-js read/write
                                v
+--------------------------------------------------------------------+
| contracts/sla_sentinel.py                                          |
| GenLayer Intelligent Contract                                      |
| Escrow, SLA state machine, evidence fetch, verdict, withdraw        |
+-------------------------------+------------------------------------+
                                | HTTPS evidence
                                v
+--------------------------------------------------------------------+
| apps/demo-provider                                                 |
| Separate public Vercel service with stable API evidence scenarios   |
| healthy, soft-breach, hard-breach, inconclusive                    |
+--------------------------------------------------------------------+

Repository

apps/web
  React dashboard, wallet drawer, create flow, agreement detail,
  settlement view, transaction drawer, StudioNet integration

apps/demo-provider
  Public mock API and evidence service for real validator fetches

contracts
  Intelligent Contract, StudioNet deployment script, direct tests

packages/shared
  Shared scenarios, agreement types, verdicts, status labels

Demo Provider Routes

/api/health/:scenario
/api/status/:scenario
/api/monitor/:scenario
/api/incidents/:scenario

Supported scenarios:

healthy
soft-breach
hard-breach
inconclusive

Monitor and incident URLs may include {start} and {end} placeholders. The contract replaces them with the funded SLA window before fetching.

Run Locally

Requirements: Node.js 20+, npm 10+, and Python 3.11+.

npm install
npm run dev

Local URLs:

Web app:       http://localhost:5173
Demo provider: http://localhost:8787

Create a root .env from .env.example for StudioNet configuration. Never put a private key in a VITE_* variable.

Deploy Contract

npm run contract:deploy:studionet

After deployment, set:

VITE_GENLAYER_CONTRACT_ADDRESS=<deployed_contract_address>
VITE_GENLAYER_RPC_URL=https://studio.genlayer.com/api
VITE_DEMO_PROVIDER_URL=https://sentinel-protocol-provider.vercel.app
VITE_ENABLE_PREVIEW_MODE=false

StudioNet state can reset, so deployment is intentionally repeatable.

Verify

npm run typecheck
npm run test
npm run build
npm run test:e2e

Direct contract checks:

python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r contracts\requirements-dev.txt
.\.venv\Scripts\genvm-lint.exe lint contracts\sla_sentinel.py
.\.venv\Scripts\python.exe -m pytest contracts\tests\direct -q

Security Notes

  • Wallet-only identity; no email accounts or backend database.
  • Client-only escrow; the provider does not post a bond in this MVP.
  • Evidence URLs must use HTTPS.
  • Fetched evidence is treated as untrusted content.
  • Supplementary evidence is stored first, then checked during the next settlement call.
  • Settlement credits internal balances; recipients withdraw separately.
  • .env, .env.local, and Vercel metadata are git-ignored.

Author

Built by ycee for a GenLayer StudioNet demo submission.

License

MIT.

About

API SLA escrow, evidence-based settlement, validator adjudication and dispute review.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages