Skip to content

JayWebtech/clutch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clutch

Clutch is a livestreaming app where the audience sets the stakes. Viewers challenge the streamer with dares and bet STRK on whether they’ll pull it off or not. The streamer picks a dare, gets one shot to complete it in five minutes, and everyone watches. When time’s up, the result is settled and winners get paid. It turns watching into a game: you’re not just viewing—you’re proposing, betting, and cheering. Whether the streamer nails it or chokes, the outcome is shared and paid out on-chain, so the tension and the payoff are real.


How it works

For viewers

  1. Watch — Join a live stream and see the streamer and the current dare.
  2. Propose a dare — Suggest a challenge and stake STRK on it. You pick whether you think they’ll do it (YES) or not (NO).
  3. Stake on others’ dares — While a dare is still Proposed, you can add your own STRK on YES or NO. Once the streamer accepts a dare, staking closes.
  4. Watch the attempt — The streamer has 5 minutes to complete the dare. A timer is shown on stream.
  5. Settle & win — After the timer ends, the result is verified and settled on-chain. If you bet on the winning side, you can claim your winnings (or get a refund if the dare was cancelled).

For streamers

  1. Go live — Connect your wallet, start your stream, and share the link with viewers.
  2. See dares — Viewers propose dares and stake STRK. Dares are listed by total stake.
  3. Accept or reject — You can accept one dare (it must have stake on both YES and NO) or reject it. Only one active dare per stream at a time.
  4. Attempt — Once you accept, you have 5 minutes to complete the dare on stream. Everyone watches.
  5. Verification — When time’s up, the app captures frames from your stream. An AI judge checks whether you completed the dare; the result is settled on-chain and payouts (or refunds) are enabled.

Repo structure

clutch/
├── frontend/     # Next.js app (streaming UI, wallet, dares, chat)
├── server/       # Express API + WebSocket (streaming, verification queue, cron)
├── contracts/    # Starknet (Cairo) — dares, stakes, settle, refunds
└── README.md

Running the project

1. Contracts (Starknet)

Build and test the Cairo contracts:

cd contracts
scarb build
scarb test

Deploy to Starknet (e.g. Sepolia) and set the contract address in the frontend and server env.

2. Server

Node.js + Express, WebSockets, Redis (BullMQ), Prisma, Anthropic (verification).

cd server
cp .env.example .env   # then fill in keys (REDIS_URL, ANTHROPIC_API_KEY, settler keys, etc.)
npm install
npx prisma generate
npx prisma db push     # or migrate, for DB
npm run dev

Runs by default on http://localhost:4000. Frontend and WebSocket clients connect here.

3. Frontend

Next.js app for going live, watching streams, proposing/staking on dares, and claiming.

cd frontend
cp .env.example .env   # set NEXT_PUBLIC_WS_URL, NEXT_PUBLIC_API_URL, NEXT_PUBLIC_CONTRACT_ADDRESS, etc.
npm install
npm run dev

Runs on http://localhost:3000. Connect a Starknet wallet (e.g. Cartridge) to use the app.


Notes

  • Staking is only open while a dare is Proposed. Once the streamer accepts, no new stakes are allowed.
  • Verification uses the backend to capture stream frames and call an AI judge; the settler account then calls settle_dare on-chain.
  • Stale dares (proposed or accepted for too long without settlement) can be cancelled by a cron job so stakers can claim refunds.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors