Skip to content

winsznx/sluize

Repository files navigation

Sluize Standard

Sluize Standard is a reference implementation of credit lines + surety bonds for autonomous AI agents, enforced by Open Wallet Standard (OWS) spending policies.

It was built for the OWS Hackathon (April 2026) under the “Agent Spend Governance” track.

What’s in this repo

  • Web app (Next.js App Router): landing + auth + Agent dashboard + LP dashboard + Admin dashboard
    • Routes live in src/app/(public), src/app/(auth), src/app/(agent), src/app/(lp), src/app/(admin)
  • Solana programs (Anchor): sluize-programs/programs/*
    • agent-registry — on-chain agent account + score
    • credit-facility — liquidity pool + credit line accounts
    • surety-bond — bonds + disputes
    • revenue-splitter — splits incoming USDC between pool vault and agent destination (invoked by backend)
  • OWS policy executable: sluize-programs/sluize-spending-guard/ (used by server policy provisioning)
  • Backend/API (Next.js route handlers): src/app/api/* (Supabase + Solana + OWS provisioning + Helius webhook ingest)

Stack

  • Next.js 16.2.2 + React 19.2.4
  • Tailwind CSS v4 + Radix/shadcn primitives
  • Supabase (auth + Postgres)
  • Solana (Anchor programs + @solana/web3.js)

Core flows

  • Agent: register wallet → credit score → apply for a credit line → provision OWS policies → receive USDC → monitor repayments & policies
  • LP: deposit/withdraw liquidity → track pool analytics
  • Admin: review applications → monitor protocol health (RPC + program IDs) → manage loans/bonds

Quickstart (web app)

pnpm install
pnpm dev

Then open http://localhost:3000.

Scripts

  • pnpm dev — run locally
  • pnpm build / pnpm start — production build + serve
  • pnpm lint — eslint

Environment variables

Create .env.local (this repo expects these names):

# App
NEXT_PUBLIC_APP_URL=http://localhost:3000

# Supabase
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_KEY=

# Solana
NEXT_PUBLIC_SOLANA_RPC=https://api.devnet.solana.com
NEXT_PUBLIC_SOLANA_CHAIN=devnet
NEXT_PUBLIC_USDC_MINT=
NEXT_PUBLIC_AGENT_REGISTRY_PROGRAM=
NEXT_PUBLIC_CREDIT_FACILITY_PROGRAM=
NEXT_PUBLIC_SURETY_BOND_PROGRAM=
NEXT_PUBLIC_REVENUE_SPLITTER_PROGRAM=

# Webhooks (optional, for automated repayment / policy revocation updates)
HELIUS_WEBHOOK_SECRET=

# OWS (optional; if omitted, Sluize generates a demo ows_key_* token)
OWS_VAULT_DIR=/tmp/.ows
OWS_TREASURY_WALLET_NAME=sluize-treasury
SOLANA_CAIP2_CHAIN_ID=solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1
SLUIZE_POLICY_EXECUTABLE_PATH=/usr/local/bin/sluize-spending-guard

Tip: sluize-programs/Anchor.toml includes devnet program IDs you can paste into the NEXT_PUBLIC_*_PROGRAM env vars.

Working with the Solana programs (Anchor)

Programs and tests live under sluize-programs/.

cd sluize-programs
npm install
anchor build
anchor test

Note: sluize-programs/Anchor.toml currently runs tests via yarn run ts-mocha .... If you don’t have yarn installed, update that script or install yarn.

OWS integration (policy provisioning)

  • Policy files are written to OWS_VAULT_DIR by src/lib/ows-provisioner.ts.
  • If the ows CLI is installed, Sluize will attempt to register policies + create an API key bound to those policies.
  • If the CLI isn’t installed, Sluize still generates a demo ows_key_* token and hashes it (SHA-256) for storage.
  • The spending policy points at SLUIZE_POLICY_EXECUTABLE_PATH (the Node executable in sluize-programs/sluize-spending-guard/).

Operational notes

  • Helius webhook endpoint: POST /api/webhooks/solana (HMAC-verified via HELIUS_WEBHOOK_SECRET)
  • Vercel: runtime timeouts are configured in vercel.json for the longer-running API routes

Docs / specs

  • SLUIZE_MASTER.md — full product + architecture spec (authoritative)
  • SLUIZE_CSS_FIX.md — CSS/token architecture rules
  • SLUIZE_REFACTOR.md — UI overhaul + empty-pages task list

About

Policy-enforced credit lines and surety bonds for autonomous AI agents on Solana.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors