Skip to content

kushwahaamar-dev/scaffold

Repository files navigation

Scaffold

Stripe for verified work. AI freelancers get paid on Base as quality improves.

ci

What this project does

Scaffold fixes a trust gap in AI freelancing. Buyers do not want to pay full amount before quality is proven, and workers do not want to wait forever to get paid.

We solve this with a Base escrow contract that streams USDC as checkpoint quality improves. Scoring happens through a paid verifier API, so each verification call has a real cost and a real settlement path.

Videos

Local recordings are also in docs/demo-video/.

Screenshots

Hero Hero and wallet connection flow
Checkpoint board Checkpoint state board driven by on-chain reads
Escrow controls On-chain controls for initialize, deposit, stream, pause, finalize
Leaderboard Worker reputation based on lifetime released USDC

Full page: docs/screenshots/dashboard-full.png

Technical architecture

Stack

  • Smart contracts: Solidity + Foundry on Base Sepolia
  • Frontend: React + Vite + wagmi + viem + RainbowKit
  • Verifier API: Node + Express + x402-express + AWS Bedrock
  • Worker client: x402-fetch for paid requests to verifier
  • Infra: AWS CDK (Lambda, API Gateway, CloudFront, DynamoDB)

System diagram

   ┌──────────────┐    POST /score (HTTP 402)        ┌────────────────────┐
   │  Worker      │ ───────────────────────────────► │  AWS API Gateway   │
   │  agent       │                                  │  → Lambda          │
   │  (artifact)  │ ◄── 402 + accepts[USDC, base]    │  (verifier server) │
   │              │ ─── X-PAYMENT header ──────────► │                    │
   │              │ ◄── 200 {scores, txs}            │  · x402-express    │
   └──────┬───────┘                                  │  · Bedrock runtime │
          │                                          │  · viem write tx   │
          │ x402 facilitator settles USDC            └─────────┬──────────┘
          ▼                                                    │
   ┌────────────────────────── Base Sepolia ───────────────────▼────────────┐
   │  USDC                             ScaffoldEscrow.sol                   │
   │                                    · releaseStreamed(jobId, idx, bps)  │
   │                                    · forward-progress only              │
   │                                    · permissionless finalizeJob         │
   └──────────────────────────────────────────────────────────────────────────┘

Core flow

  1. Buyer creates a job and deposits USDC into ScaffoldEscrow.
  2. Worker submits artifact for evaluation.
  3. Verifier endpoint returns HTTP 402 if unpaid.
  4. Worker pays via x402 and retries.
  5. Bedrock scores checkpoints in basis points.
  6. Arbiter service calls releaseStreamed(jobId, idx, scoreBps) for forward progress.
  7. Anyone can call finalizeJob after deadline or full scoring.

Why sponsor tech matters

  • x402 makes verifier calls natively payable per request.
  • Base makes repeated USDC settlement cheap and fast.
  • AWS Bedrock provides structured scoring that maps directly to checkpoint release logic.

Repository structure

contracts/   Solidity escrow and tests
src/         React dashboard
agents/      Worker + verifier services
infra/       AWS CDK deployment
docs/        Demo media and screenshots

Quick start

npm install
npm run contracts:build
npm run contracts:test
npm run dev

For full demo receipts and transaction links, see DEMO.md.

Submission links

License

MIT. See LICENSE.

About

Stripe for verified work — score-scaled streaming USDC payments on Solana, with a Claude verifier as the on-chain judge.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors