Skip to content

edycutjong/verity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Verity Logo

Verity 🎯

RWA oracles that bleed when they're wrong.

Verity Hero

Live Demo Pitch Deck Pitch Video Built for Casper


Next.js TypeScript Contracts Casper x402 Casper License CI


πŸ“Έ See it in Action

Autonomous RWA oracle agent that reasons over conflicting evidence, whose on-chain reputation rises and falls with its accuracy, and whose data you pay for per query via Casper x402. One of three coordinated Casper agent-trust projects.

1. Reputation & Value Dashboard

Verity Dashboard

The main Verity interface tracking real-world asset listings (Gold, Silver, Copper) alongside the oracle agent's live on-chain EWMA reputation score.

2. Multi-Source AI Reasoning Logs

AI Oracle Reasoning Logs

The reasoning console showing how the oracle agent ingests and compares data from multiple feeds (Bloomberg, Reuters, Binance), detects anomalies, and reconciles them before posting.

3. Pay-to-Read Oracle Terminal (x402 Micropayments)

Oracle Terminal Idle

The consumer-facing Oracle Terminal, where protocols can query the oracle feed.

4. Casper x402 Payment Challenge

Casper x402 Challenge

Querying the endpoint triggers a 402 Payment Required challenge, requiring the requester to pay a dynamically-scaled fee proportional to the oracle's reputation.

5. Decrypted Value Egress

Unlocked Oracle Feed

Upon signing and settling the EIP-712 payment authorization, the facilitator approves the request, returning the decrypted asset values.


πŸ’‘ The Problem & Solution

Standard oracles face no real penalty for delivering bad data; their trust assumptions are static. Verity solves this by establishing an EWMA-based on-chain scoring system where when the oracle is wrong, its score drops β€” visibly, on-chain.

Key Features:

  • ⚑ Autonomous Reasoning: Analyzes conflicting evidence using AI to arrive at a verified consensus.
  • πŸ”’ On-Chain Reputation: Accuracy directly translates into an EWMA-based score (0-10000 basis points) on the Casper Testnet.
  • 🎨 Micropayments (x402): Data is monetized per query using Casper x402, with query price dynamically scaling with reputation.
  • πŸ–₯️ Oracle Terminal: Click through the live x402 pay-to-read round-trip (402 β†’ EIP-712 authorization β†’ 200 { value, reputation }) against the running /api/value endpoint.

πŸ—οΈ Architecture & Tech Stack

Layer Technology
Frontend Next.js 16 (App Router), React 19, Tailwind CSS v4
Contract Odra (Rust) on Casper Testnet
Reputation EWMA-based on-chain scoring (Ξ± = 0.3, max 2% miss threshold)
Micropayments x402 (CSPR.cloud facilitator)
Signing CSPR.click AI Agent Skill
Testing Vitest

System Data Flow

flowchart TD
    SRC[Multiple off-chain RWA sources] --> AG[Oracle Reasoning Agent: reconcile / detect manipulation / decide post-or-abstain]
    AG -->|value + confidence + rationale| VAL[Posted value]
    AG -. abstains when sources diverge .-> SKIP[No post]
    VAL -->|CSPR.click TransactionV1| REG[Odra Reputation Registry]
    REG --> TN[(Casper Testnet)]
    GT[Ground-truth feed] --> SET[Accuracy Settlement Job]
    SET -->|rescore| REG
    C[Consumer / protocol agent] -->|HTTP GET /value| X[ x402 Resource Server ]
    X -->|402 Payment Required| C
    C -->|EIP-712 signed CEP-18 payment| FAC[CSPR.cloud x402 Facilitator]
    FAC -->|verify + settle| TN
    FAC -->|ok| X
    X -->|200 value + reputation| C
    REG --> DASH[Next.js Credit-Score Dashboard]
    CLOUD[CSPR.cloud] --> DASH
Loading

πŸ” Deep Dive: For a full architectural breakdown, including specific API endpoints, the EWMA scoring formulas, and x402 payment flow verification details, see the detailed System Architecture Design Document.

πŸ† Sponsor Tracks Targeted & Code References

  • Casper Innovation Track (Build Direction #3: AI-Powered Oracle Networks)
    • Casper Testnet Smart Contract: Built with the Odra framework in Rust, located in verity.rs. Tracks oracle reputation records on-chain and processes settlements.
    • Casper x402 Micropayments: Integrated in x402.ts to verify query payment tokens.
    • CSPR.click / Agent Signing: Handles secure key pair signatures and deploy dispatches to the Casper Network, structured in casper.ts.

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 20
  • npm
  • Rust & cargo-odra (for contract builds)

Installation

  1. Clone: git clone https://github.com/edycutjong/verity.git
  2. Change directory: cd verity
  3. Install: npm install
  4. Configure: cp .env.example .env.local and add your keys
  5. Run: npm run dev

πŸ’‘ Note for Judges: Verity operates in Demo Mode by default. This mocks the x402 token verification flow and uses deterministic mock agents, allowing you to explore the full credit-bureau reputation oracle lifecycle and query dispatches instantly without configuring keys or funded test wallets.

⛓️ Live Testnet Deployment

All contracts are live on Casper Testnet (chain casper-test). Set VERITY_DEMO=false + fill .env.local to broadcast real post_value / settle transactions and use the real x402 facilitator.

Item Value
Verity Contract hash-657a83911a36b3aa2204e47f39c237f15b2ed6f54cbaf6f83b0be7f1d7873c82
Install Transaction 66b6f13ab163abf5265c4007d7438ee178bdbea682adab1c394a6f043765dcc1
post_value (oracle posts a value) fc10730db99724ee78bb8c55657fa29054268a61e4fb96b1e794e649cda66e0b
settle (EWMA reputation drops 83.2β†’58.2 on a MISS) ce35dd60774149baa8564e5adc0adbedd1ec624157103666e2615beaa615be21
CEP-18 Token (x402) hash-541069ed8cad06249f76edb0972932d012badbb256111d3000df06ac1d703be6
Oracle Account 016bfd43f7d73c988702e0b1e8657687282bc578b60e9eaaabb1f3aa95ff9a7338
Network Casper Testnet (casper-test)
Framework Odra (Rust β†’ WASM, target-cpu=mvp)
Machine-readable record deployments/testnet.json

Re-deploy your own: npm run deploy:rpc installs a fresh contract instance and prints the package hash. See LIVE_TESTNET.md for the full walkthrough.

Originality: all code is original and newly developed for the Casper Agentic Buildathon 2026; shared @vouch/* packages are authored for this submission.

πŸ“– Documentation & Design Resources

The following design documents and resources are available in this repository:

  • πŸ—οΈ System Architecture: Full data flow diagrams (Mermaid), API specifications, and math/cryptographic models.
  • 🎬 Interactive Demo Guide: Step-by-step walkthrough of the live demo console and expected system behaviors.
  • πŸ›‘οΈ Sponsor Track Defense: Justification of track eligibility, including Casper Network and x402 integration references.
  • πŸ“‹ Product Requirements Document (PRD): Initial project scope, problem statement, user personas, and product requirements.
  • πŸš€ Live Testnet Wiring Runbook: Detailed guide to flipping the application from demo mode to Casper Testnet execution.

πŸ§ͺ Testing & CI

6-stage pipeline: Quality β†’ Security β†’ Build β†’ E2E β†’ Performance β†’ Deploy

# ── Code Quality ────────────────────────────
npm run lint          # ESLint
npm run typecheck     # TypeScript check
npm run test          # Run Vitest tests
npm run test:coverage # Coverage report
npm run ci            # Full quality gate

# ── Advanced Testing ────────────────────────
npm run e2e           # Playwright E2E tests
npm run e2e:ui        # Playwright interactive mode
npm run lighthouse    # Lighthouse CI audit

# ── Security ────────────────────────────────
make security-scan    # npm audit + license check
Layer Tool Status
Code Quality ESLint + TypeScript βœ…
Unit Testing Vitest βœ…
E2E Testing Playwright (2 suites) βœ…
Security (SAST) CodeQL βœ…
Security (SCA) Dependabot + npm audit βœ…
Secret Scanning TruffleHog βœ…
Performance Lighthouse CI βœ…

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.