Skip to content

NECOKIZZ/Cuerate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cuerate

The AI creator platform where prompt engineers get paid by their curious audience.

Beautiful AI-generated content makes people ask one question: "How was this made?" Cuerate bridges the gap between the curious mind and the creative mind — AI creators post the prompts and workflows behind their images and videos, and their audience pays them for it.


What it does

  • Post prompts & results. Creators publish the prompt (or a multi-generation workflow for complex videos) alongside the image/video it produced, tagged with the model used (ChatGPT, Midjourney, etc.).
  • Likes are micropayments. Every like from a consumer is an on-chain USDC micropayment straight to the creator — the base tier is 0.001 USDC, with a higher tier for premium content.
  • Fork with on-chain attribution. Any prompt can be forked and improved. Because every post's lineage is registered on-chain, the original creator always keeps credit — this encourages originality instead of silent prompt theft.
  • Decaying fork royalties. When a forked post earns, the payment is split geometrically up the fork tree — the liked post gets 50%, its parent 25%, the grandparent 12.5%, and so on up to the original creator, with the platform absorbing the dust remainder. Original (unforked) posts pay the creator 95% with a flat 5% platform fee. All enforced by a smart contract — no middlemen. This is only practical on Arc, where nanopayments make sub-cent splits economical.
  • Direct tipping. Consumers who found a creator's content helpful can tip them any amount directly (no minimum).
  • Leaderboards. Ranked boards for top creators (by earnings) and top supporters (by tips/likes), refreshed on a schedule.
  • Agent-native inspire API. Agents can discover prompts through an x402-wrapped endpoint — they pay per query in USDC from a Circle agent wallet, and the fee flows through the same fork-royalty split to the creators.
  • Plus: in-app Circle wallet, notifications, search/explore, onboarding, docs, and Google + email sign-in.

Tech stack

Layer Choice
Frontend React + Vite + TypeScript, Tailwind CSS, Radix / shadcn, MUI
Auth & data Firebase (Auth + Firestore)
Backend Firebase Cloud Functions (v2)
Media storage Supabase Storage buckets
Wallets Circle Developer-Controlled Wallets — removes the friction of signing every transaction manually
Chain Arc testnet — USDC as native gas
Royalties CuerateRoyalty.sol (Solidity / Foundry), deployed via Circle's Smart Contract Platform

Architecture

React (Vite)  ──►  Firebase Cloud Functions  ──►  Circle Dev-Controlled Wallets ──► Arc (USDC)
     │                     │                              │
  Firestore           settlement.ts                CuerateRoyalty.sol
  (posts, likes,      onchain.ts  ───── registerPost / settle ─────► fork lineage + royalty split
   tips, boards)      leaderboard.ts
                      inspire (x402 endpoint for agents)
Supabase Storage ◄── media uploads

Key backend functions (functions/src/index.ts):

  • ensureCircleWallet / getCircleWalletStatus / refreshCircleWalletBalance — per-user Circle wallet lifecycle.
  • recordPaidLike — records a like and its USDC micropayment.
  • settlePendingPayments / triggerSettlement — batch settlement of paid likes on-chain.
  • sendTip — direct creator tipping.
  • onPromptCreated — registers each new post's fork lineage on-chain (registerPost).
  • inspire — the x402 agent API: returns 402 Payment Required until an agent pays, then matches a prompt and settles the fee across the fork lineage.
  • rebuildLeaderboardsScheduled / triggerLeaderboardRebuild — leaderboard aggregation.
  • circleWebhook — Circle transaction status callbacks.

The fork-royalty rule lives in three places that stay in sync: the on-chain contracts/src/CuerateRoyalty.sol settle(), the off-chain functions/src/settlement.ts, and the display calc in functions/src/onchain.ts.

Running the code

npm i          # install dependencies
npm run dev    # start the Vite dev server

Environment

Copy .env.example to .env and fill in:

  • Firebase web app config values.
  • Supabase storage vars — VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY, VITE_SUPABASE_BUCKET (media uploads use Supabase Storage).

Cloud Functions read their own functions/.env (see functions/.env.example) for Circle API keys, the Arc chain (CIRCLE_BLOCKCHAIN=ARC-TESTNET), the deployed ROYALTY_CONTRACT_ADDRESS, INSPIRE_PRICE_USDC, and the leaderboard schedule.

src/lib/backend.ts uses Firebase when env vars are present and falls back to local stubs/mock data when they are not.

Firebase commands

Shortcuts so you don't have to remember the full Firebase CLI:

Script Does
npm run firebase:login Sign your machine into Firebase
npm run firebase:use Point this repo at the cuerate-e31b5 project
npm run firebase:deploy-rules Deploy Firestore + Storage rules
npm run firebase:emulators Run Firebase locally for safe testing
npm run functions:build / functions:deploy Build / deploy Cloud Functions

Smart contract

The contracts/ directory is a Foundry project.

cd contracts
forge test        # run the royalty-split test suite

Deployment goes through Circle's Smart Contract Platform. Note: SCP deploys via Circle's managed deployer EOA, so CuerateRoyalty's constructor sets owner = _platform (the registrar/treasury wallet) rather than msg.sender.

Arc OSS

Cuerate is open source and applying to the Arc Open Source Showcase. Reusable primitives other Arc builders can hack on:

  • CuerateRoyalty.sol — a general on-chain fork-registry + geometric-decay royalty splitter for USDC on Arc. Not specific to prompts; any "derivative work with lineage" use case (remixes, datasets, templates) can reuse it.
  • An x402 pattern on Arc — the inspire function is a working reference for gating an HTTP resource behind a USDC micropayment settled through a Circle agent wallet, including the 402 challenge and WWW-Authenticate header.
  • Circle Dev-Controlled Wallet + Arc settlement plumbingfunctions/src/circle.ts, wallet.ts, onchain.ts, and settlement.ts are a reference for wiring Circle wallets to on-chain settlement without manual signing.

License

MIT (see contracts/src/CuerateRoyalty.sol SPDX headers).

About

AI video content creation tool

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors