Skip to content

Latest commit

History

130 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

VaultWatch

Compliance-Gated RWA Oracle with Verifiable Agent Reputation on Casper

VaultWatch is a compliance-first Real-World Asset oracle on the Casper blockchain. Seven Groq-powered AI agents assess RWA risk, score compliance gates, and write verified findings to eight Odra smart contracts — with every decision tracked on-chain via a Brier-score reputation formula. CSPR.click agent wallets, dual-path x402 micropayments (native CSPR + WCSPR facilitator), and a 39-tool domain MCP server make every claim independently verifiable on Casper testnet.

CIBuild ContractsCodeQLTestsPython 3.11+Casper TestnetCSPR.clickx402MCPLicense: MIT


Demo

VaultWatch Demo

Watch on YouTube · Live Dashboard


Hackathon Criteria — Proof Scorecard

Every judging criterion addressed with pinned source links and on-chain evidence. 36 verified deploys on Casper testnet — all SUCCESS.

#CriterionOne-Line ProofSource
1Technical Execution8 Odra contracts, 9 Rust sources, 481 tests, 29 API endpoints, 3 CI workflowscontracts/src/, tests/, api/main.py
2Innovation & OriginalityCompliance-gated RWA oracle + Brier-score reputation + Casper-native upgrades + x402 v2 micropayments + CSPR.click agent walletsdocs/REPUTATION_FORMULA.md, x402/vaultwatch-x402.ts
3Use of AI / Agentic Systems7 Groq agents (6 pipeline + 1 SafetyGuard) with self-correction loops, decision audit trail, Brier-score reputationpipeline.py, agents/
4Real-World ApplicabilityCoinGecko + FRED real data feeds, x402 pay-per-query, compliance gates for RWA tokenisation riskagents/rwa_agent.py, contracts/src/subscriber_vault.rs
5User Experience & DesignLive 9-panel dashboard with CSPR.click wallet, dark glassmorphism UI, data provenance badgesdashboard/src/
6Working Smart Contracts8 contracts on testnet + 21 interactions + 6 upgrades + 1 x402 payment — 36/36 SUCCESSproof/deploy_verification_results.json
7Long-Term Launch PlansGitHub repo, Vercel dashboard, CSPR.click wallets, x402 revenue model, deployment guide, Docker composeDEPLOYMENT_GUIDE.md, docker-compose.yml
8Long-Term Impactvaultwatch-rwa-mcp (39-tool Casper ecosystem MCP server) + CSPR.click adoption + x402 first implementationvaultwatch_rwa_mcp/, docs/REPUTATION_FORMULA.md

Key Highlights

CSPR.click — Official Casper Agent Wallets

VaultWatch uses CSPR.click (the Casper Association's own tool) for all agent signing and transaction construction — not manual key management. This signals ecosystem alignment and reduces bug surface.

x402 Micropayment Protocol — Verified On-Chain

Official @make-software/casper-x402 v2 SDK for HTTP-native pay-per-query access to RWA intelligence. Verified payment: 0588e143…5e2c · x402/vaultwatch-x402.ts · docs/X402_INTEGRATION.md

Dual-Path x402 Payment Architecture — Self-Hosted + CSPR.cloud Facilitator

VaultWatch now supports two x402 payment paths, covering both the self-hosted and external facilitator models defined by the x402 v2 specification

PathTokenVerificationSettlement
Path A — Self-HostedNative CSPR via SubscriberVault escrowLocal ExactCasperScheme.verify() + EIP-712Direct on-chain deploy (open_vault)
Path B — CSPR.cloud FacilitatorWCSPR (CEP-18 wrapped CSPR)CSPR.cloud /verify + transfer_with_authorizationCSPR.cloud /settle facilitator
  • New files: x402/wcspr-x402-path.ts · x402/wcspr_helper.mjs
  • 7 new API endpoints: /x402/facilitator/status, /x402/facilitator/supported, /x402/facilitator/verify, /x402/facilitator/settle, /x402/wcspr/info, /x402/wcspr/balance/{account_hash}, /x402/dual-path/status
  • Full architecture doc: docs/X402_DUAL_PATH_ARCHITECTURE.md
  • Dual-path proof: proof/X402_DUAL_PATH_PROOF.md
  • DoraHacks relevance: Both paths cover the full x402 v2 spec — self-hosted facilitator model (Path A) + external facilitator model (Path B). Dual-path architecture ensures 100% x402 specification coverage.

vaultwatch-rwa-mcp — Casper Ecosystem MCP Server

Domain-specific FastMCP server with 39 RWA tools, 3 resources, 4 prompts — a Casper ecosystem contribution. Reads via query_global_state + Odra decoders; writes via CSPR.click AgentWallet; payable open_vault via x402.

python -m vaultwatch_rwa_mcp.server # stdio (Claude Desktop)
python -m vaultwatch_rwa_mcp.server --list-tools # introspection

vaultwatch_rwa_mcp/server.py · vaultwatch_rwa_mcp/README.md

Agent Reputation — Brier Score + Escrow Trust

R = w_B · brier_trust + w_E · escrow_trust (EWMA decay λ=0.92). Four tiers: PLATINUM ≥ 85 · GOLD 70–84 · SILVER 50–69 · BRONZE < 50. Computed from on-chain metrics, not self-reported.

docs/REPUTATION_FORMULA.md · agents/reputation.py


Quickstart

Prerequisites

  • Python 3.11+ · Node.js 18+ · Groq API key (console.groq.com) · Docker (optional)

Install & Configure

git clone https://github.com/sodiq-code/vaultwatch
cd vaultwatch
pip install -r requirements.txt
cp .env.example .env
# Set GROQ_API_KEY (required)# RPC: CASPER_NODE_URL=https://node.testnet.casper.network/rpc

Run

docker-compose up # All services
python pipeline.py # Agent pipeline
uvicorn api.main:app --reload --port 8000 # REST API
python vaultwatch_mcp/server.py # MCP server (20 tools)
python -m vaultwatch_rwa_mcp.server # RWA MCP (39 tools)cd dashboard && npm install && npm run dev # Dashboard

Verify On-Chain (30 seconds)

curl -s -X POST https://node.testnet.casper.network/rpc \
-H 'Content-Type:application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"info_get_deploy","params":["b9c70cdceff1011008b3933835d4a46146f26f1d1e82ada8520be77e1d6333a7"]}' \
| python3 -c "import sys,json; d=json.load(sys.stdin); print(d['result']['deploy']['execution_results'][0]['result']['Success'] and '✅ SUCCESS' or '❌ FAILED')"


1. Technical Execution

ClaimEvidenceSource
481 test definitions across 39 filesUnit (260), Integration (165), E2E (75 opt-in), Demo (6)tests/
29 API endpoints across 9 tag groupsFastAPI v4.0.0 with auth middleware + rate limitingapi/main.py
8 Rust contracts compiled to bulk-memory-safe WASM9 WASM artifacts (8 + v2)contracts/wasm/
7 AI agents orchestrated in pipelineScanner → Anomaly → SelfCorrection → RWA → SafetyGuard → Audit → Intelpipeline.py
Odra framework + Casper-native upgradesRiskPolicyManager v1→v2 verified (6/6 checks)contracts/src/risk_policy_manager_v2.rs
OpenTelemetry on every agentSingle env var export to any OTel sinkpipeline.py
Security middlewareAuthMiddleware + RateLimitMiddleware + CORSapi/main.py
Docker Compose (all services)API + Dashboard + MCP + Pipelinedocker-compose.yml
CI on every push3 workflows: CI, Build Contracts, CodeQLci.yml

2. Innovation & Originality

ClaimEvidenceSource
Compliance-gated RWA oracle — compliance-first oracle gating RWA access on verifiable agent reputationRiskOracle + RiskPolicyManager + AgentBehaviorIndexcontracts/src/risk_oracle.rs, contracts/src/risk_policy_manager.rs
Brier-score reputationR = w_B · brier_trust + w_E · escrow_trust (EWMA λ=0.92)4 tiers (PLATINUM ≥ 85, GOLD 70–84, SILVER 50–69, BRONZE < 50)docs/REPUTATION_FORMULA.md, agents/reputation.py
Casper-native upgrades via storage::add_contract_version()v1→v2 verified; v2 adds get_policy_with_reasoning on shared state URefproof/upgrade_hashes.json
x402 dual-path micropayment — HTTP-native pay-per-query via official SDK + WCSPR facilitatorVerified 1 CSPR payment via SubscriberVault::open_vault + WCSPR CEP-18 path via CSPR.cloudproof/x402_payment_hashes.json, docs/X402_DUAL_PATH_ARCHITECTURE.md
CSPR.click agent wallets — Casper Association's own tool, not manual key managementAgentWallet + browser CSPRClickProvideragents/agent_wallet.py, CSPR_CLICK_AGENT_SKILL.md
Domain MCP server — 39 RWA-specific tools as Casper ecosystem contributionquery_global_state + Odra decoders + CSPR.click AgentWalletvaultwatch_rwa_mcp/server.py
ZK-KYC proof caching — reputation ≥ GOLD required before RWA accessSelfCorrection + SafetyGuard + RiskPolicyManager thresholdagents/self_correction_agent.py

3. Use of AI / Agentic Systems

AgentModelRoleSource
ScannerAgentllama-3.1-8b-instantParse, normalize, classify eventsagents/scanner_agent.py
AnomalyAgentllama-3.3-70b-versatileDeep risk reasoning, severity, confidenceagents/anomaly_agent.py
SelfCorrectionllama-3.3-70b-versatileQuality gate — confidence < 0.75 → re-queryagents/self_correction_agent.py
RWAAgentcompound-beta + hybrid feedRWA enrichment (CoinGecko + FRED)agents/rwa_agent.py
SafetyGuardllama-3.3-70b-versatileInline injection/adversarial check (< 50ms)agents/safety_guard.py
AuditAgentllama-3.1-8b-instantEAS attestation → Casper deploy → AuditTrailagents/audit_agent.py
IntelAgentllama-3.1-8b-instantREST + MCP + x402 pay-per-queryagents/intel_agent.py

Agentic design patterns: Self-correction loop · Safety guard inline · Decision audit trail (AgentBehaviorIndex::record_decision) · Brier-score reputation · MCP tool chain (20 + 39 tools)


4. Real-World Applicability

Use CaseImplementationSource
Compliance-gated RWA access — GOLD+ reputation to write; escrowed CSPR to readRiskPolicyManager threshold 70; SubscriberVault gatescontracts/src/risk_policy_manager.rs, contracts/src/subscriber_vault.rs
Real RWA feeds — CoinGecko + FRED + mock real estateRWAAgent.fetch_rwa_feed() with provenance trackingagents/rwa_agent.py
x402 dual-path pay-per-query — 1 CSPR / 1 WCSPR per intelligence queryVerified: deploy 0588e143…5e2c (Path A) + WCSPR CEP-18 path (Path B)proof/x402_payment_hashes.json, proof/X402_DUAL_PATH_PROOF.md
DeFi protocol risk scores — CasperSwap, CasperLend3 verified update_score deployscontracts/src/risk_oracle.rs
RWA tokenization risk — bonds, commodities, credit/rwa/feed with provenance flagsapi/main.py

5. User Experience & Design

FeatureImplementationSource
9-panel dashboard — real-time dataRisk, Anomaly, RWA, Audit, Chain, Attestations, x402, Pipeline, Feeddashboard/src/
CSPR.click wallet — browser Connect/DisconnectCSPRClickProvider + WalletBar.jsxdashboard/src/csprclick.js
Mobile-responsive — hamburger menu, collapsible sidebarsm:/md:/lg: breakpoints; active:scale-95 touchdashboard/src/App.jsx
Provenance badges — LIVE/FALLBACK/CACHED indicatorsSourceBadge componentdashboard/src/components/
Dark glassmorphism — professional financial UICyan + violet accents; glassmorphism cardsdashboard/src/index.css
Auto-refresh + CSPR ticker — 15s refresh, block heightCoinGecko CSPR/USD with 60s cachedashboard/src/components/ChainStatus.jsx
Explorer links — every deploy hash links to cspr.liveAll 36 verified deploysproof/interaction_hashes.json

Live Dashboard: https://vaultwatch-dashboard-v5.vercel.app


6. Working Smart Contracts

All 8 contracts deployed July 11, 2026 to casper-test. 36 verified deploys — all SUCCESS.

ContractPackage HashDeploy HashGasExplorer
AuditTrailhash-7e653fc142…270fab9c70cdc…336a7138.14✅ View
RiskOraclehash-1a47fd766e…2e974e071aacc…7c9d135.02✅ View
SentinelCredithash-47ea0c5377…686ae0c09f2ad…af71143.32✅ View
SentinelRegistryhash-d97d1f1ef3…5f829a5eb4f8…346c138.17✅ View
SentinelAlertLoghash-f75ce1bc1…4b7853317e08…a925140.18✅ View
AgentBehaviorIndexhash-d888dc3696…cbd205066c33…7dd0137.09✅ View
RiskPolicyManagerhash-aaf7f48dbc…b2c493e35d64…ee2e136.94✅ View
SubscriberVaulthash-68c4b7cca8…d2116620787c…956d143.39✅ View

Proof: deploy_verification_results.json · 21 interactions · 6 upgrades · x402 payment

Deployer accounts: Main 0203cd…bace7 (16 named_keys) · Secondary 02031300…3e3db

RiskPolicyManager v1→v2 Upgrade

Demonstrates Casper-native upgrades via storage::add_contract_version() — proper package versioning with shared state.

#StepExplorer
1v1 install (fresh package)✅ View
2upgrade_policy on v1✅ View
3get_current_policy on v1✅ View
4v2 upgradeadd_contract_version()✅ View
5get_policy_with_reasoning on v2 (new EP)✅ View
6get_current_policy on v2 (v1 EP preserved)✅ View

✅ 6/6 checks: 2 versions · v2 adds new EP · v1 EPs preserved · shared state URef · both EPs succeed on v2 · docs/UPGRADE_DEMO.md


7. Long-Term Launch Plans

AssetStatusSource
GitHub repository — 39 tests, 3 CI workflowsActive, publicgithub.com/sodiq-code/vaultwatch
CSPR.click integrationProduction-ready AgentWallet + browser providerCSPR_CLICK_AGENT_SKILL.md
Domain MCP server (vaultwatch-rwa-mcp)Standalone FastMCP; installable; 39 tools + 3 resources + 4 promptsvaultwatch_rwa_mcp/README.md
x402 micropaymentDual-path: native CSPR (verified deploy) + WCSPR facilitator (7 new endpoints); SDK v1.0.0 + casper-js-sdk v5.0.12proof/x402_payment_hashes.json, docs/X402_DUAL_PATH_ARCHITECTURE.md
Live dashboardVercel-deployed, auto from mainvaultwatch-dashboard-v5.vercel.app
Demo videoYouTube walkthroughyoutu.be/aWwmSC361ac
Deployment guideWASM compilation + deploy scriptsDEPLOYMENT_GUIDE.md
Docker ComposeAPI + Dashboard + MCP + Pipelinedocker-compose.yml
AuthorGitHub profilegithub.com/sodiq-code

8. Long-Term Impact — Casper Ecosystem Contributions

ContributionImpactSource
vaultwatch-rwa-mcp — standalone installable Casper tool for any LLM agent39 tools + reads via query_global_state + writes via CSPR.clickvaultwatch_rwa_mcp/server.py
CSPR.click adoption — Casper Association's own agent wallet toolSignals ecosystem alignment; reduces bug surfaceagents/agent_wallet.py
x402 dual-path implementation — official SDK for RWA pay-per-query + WCSPR facilitatorDemonstrates both self-hosted and external facilitator models for Casper dAppsx402/vaultwatch-x402.ts, x402/wcspr-x402-path.ts, docs/X402_DUAL_PATH_ARCHITECTURE.md
Reusable reputation formula — Brier-score + escrow trust publishedAny Casper project can adopt hybrid reputation scoringdocs/REPUTATION_FORMULA.md
8 verified smart contracts — production-grade Odra with RBAC, pause, upgradeAll active on testnet; upgradable via add_contract_version()contracts/src/
Casper AI Toolkit integrationMCP Server, CSPR.cloud, Odra, x402, CSPR.click — all official resourcesproof/PROOF.md

On-Chain Verification Summary

CategoryCountStatusProof
Contract installations8✅ Verified on-chainproof/deploy_verification_results.json
Interaction deploys21✅ All RPC verified SUCCESSproof/interaction_hashes.json
Upgrade deploys6✅ 6/6 checks passproof/upgrade_hashes.json
x402 payment (Path A)1✅ RPC verified SUCCESSproof/x402_payment_hashes.json
x402 WCSPR (Path B)7 endpoints✅ Facilitator configureddocs/X402_DUAL_PATH_ARCHITECTURE.md
Total36

Smart Contracts

8 Rust contracts with Odra framework, bulk-memory-safe WASM, deployed to Casper testnet.

ContractRoleKey Entry PointSource
AuditTrailImmutable on-chain log of agent actions & compliancerecord_findingcontracts/src/audit_trail.rs
RiskOraclePer-protocol RWA risk scoresupdate_scorecontracts/src/risk_oracle.rs
SentinelCreditx402 credit ledger for pay-per-querydepositcontracts/src/sentinel_credit.rs
SentinelRegistrySubscriber registry for compliance alertsregistercontracts/src/sentinel_registry.rs
SentinelAlertLogTimestamped compliance alert historylog_alertcontracts/src/sentinel_alert_log.rs
AgentBehaviorIndexVerifiable agent reputation on-chainrecord_decisioncontracts/src/agent_behavior_index.rs
RiskPolicyManagerHot-swappable thresholds (upgradable v1→v2)upgrade_policycontracts/src/risk_policy_manager.rs
RiskPolicyManager v2Upgraded policy + reasoning (shared state)get_policy_with_reasoningcontracts/src/risk_policy_manager_v2.rs
SubscriberVaultEscrowed CSPR for x402 pay-per-queryopen_vaultcontracts/src/subscriber_vault.rs
cd contracts && cargo odra build --release

Agent Pipeline

7 AI agents orchestrated by pipeline.py:

Event → [1] ScannerAgent → [2] AnomalyAgent → [3] SelfCorrection → [4] RWAAgent
[4b] SafetyGuard → [5] AuditAgent → [6] IntelAgent → on-chain + REST + MCP + x402

API & MCP Server

REST API — 29 Endpoints

api/main.py — FastAPI with auth + rate limiting + CORS.

General MCP Server — 20 Tools

vaultwatch_mcp/server.py — callable from Claude Desktop.

RWA MCP Server — 39 Tools (Ecosystem Contribution)

vaultwatch_rwa_mcp/server.py — domain-specific Casper tool.


Test Suite

481 test definitions across 39 files.

pytest tests/ -v # unit + integration + demo
pytest tests/e2e/ --run-e2e -v # REAL Casper testnet (opt-in)
TierFilesTestsPurpose
Unit14260Agents, SDK, safety guard, contracts, RWA-MCP
Integration13165API endpoints, MCP tools, pipeline
E2E875Real Casper testnet reads (opt-in)
Demo16End-to-end scenario walkthroughs
Total39481

Project Structure

vaultwatch/
agents/ # 7 AI agents + reputation + wallet
contracts/
src/ # 9 Rust source files (8 + v2)
wasm/ # 9 compiled WASM artifacts
api/ # FastAPI (29 endpoints)
vaultwatch_mcp/ # General MCP server (20 tools)
vaultwatch_rwa_mcp/ # RWA MCP server (39 tools, ecosystem contribution)
server.py, readers.py, writers.py
x402/ # x402 v2 dual-path payment implementation
vaultwatch-x402.ts # Path A: Native CSPR (SubscriberVault)
wcspr-x402-path.ts # Path B: WCSPR / CSPR.cloud facilitator
x402_helper.mjs # Path A CLI bridge (Python → JS SDK)
wcspr_helper.mjs # Path B CLI bridge (WCSPR → JS SDK)
dashboard/ # React/Vite frontend (9 panels + CSPR.click wallet)
streaming/ # Casper Sidecar SSE client
sdk/ # Async HTTP client
scripts/ # 11 core scripts (deploy, verify, wallet)
skills/csprclick-skill/ # Official CSPR.click AI Agent Skill
proof/ # On-chain verification (36 deploys)
docs/ # Documentation (formula, upgrade, x402, architecture, dual-path)

Configuration

GROQ_API_KEY=your_key # Required (console.groq.com)
CASPER_NODE_URL=https://node.testnet.casper.network/rpc
CASPER_CHAIN_NAME=casper-test
VAULTWATCH_AGENT_KEY_PATH=~/.vaultwatch/agent_key.pem
CSPR_CLOUD_API_URL=https://api.testnet.cspr.cloud
X402_PAYMENT_AMOUNT=1000000 # motes
CSPR_CLOUD_API_KEY=your_cspr_cloud_key # Required for Path B (WCSPR facilitator)
WCSPR_CONTRACT_HASH=93c7f84f... # WCSPR CEP-18 contract hash
API_HOST=0.0.0.0 API_PORT=8000
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
CASPER_MOCK=true # Safe for CI

Links

ResourceURL
Repositoryhttps://github.com/sodiq-code/vaultwatch
Demo Videohttps://youtu.be/aWwmSC361ac
Live Dashboardhttps://vaultwatch-dashboard-v5.vercel.app
Deployer (main)testnet.cspr.live
Deployer (secondary)testnet.cspr.live
Casper Testnethttps://testnet.cspr.live/
Casper RPChttps://node.testnet.casper.network/rpc
CSPR.clickhttps://cspr.click
x402 Protocolhttps://github.com/x402-payment/x402-spec
MCP Protocolhttps://modelcontextprotocol.io
Domain MCPvaultwatch-rwa-mcp
Odra Frameworkhttps://odra.dev/
Groq Consolehttps://console.groq.com/
CSPR.cloudhttps://docs.cspr.cloud/
Reputation Formuladocs/REPUTATION_FORMULA.md
Contract AuditCONTRACT_AUDIT.md
Deployment GuideDEPLOYMENT_GUIDE.md
Upgrade Demodocs/UPGRADE_DEMO.md
x402 Integrationdocs/X402_INTEGRATION.md
x402 Dual-Path Architecturedocs/X402_DUAL_PATH_ARCHITECTURE.md
x402 Dual-Path Proofproof/X402_DUAL_PATH_PROOF.md
CSPR.click SkillCSPR_CLICK_AGENT_SKILL.md
Architecturedocs/ARCHITECTURE.md
Securitydocs/RED_TEAM_CHECKLIST.md

License

MIT License · Copyright (c) 2026 Sodiq Jimoh — see LICENSE


Author: Sodiq Jimoh · Network: Casper Testnet (casper-test) · Compliance-gated RWA oracle · Verifiable agent reputation · MIT License

About

Compliance-gated RWA oracle with verifiable agent reputation on Casper, 7 AI agents, 8 smart contracts, CSPR.click wallets, dual-path x402 micropayments, 39-tool MCP server

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages