🎭 Theater & Live Performance · crew incentives

LightingToken Rewards

Issue tokenized rewards to lighting crews with social wallet onboarding and sponsored tx.

Privy social wallet· no seed phrase
Section · Onchain

The primitive.

full primer →

Directors sign in with Google — no seed phrase — see an OUSD balance, and tip creators for each crew incentives action.

Why this primitivePrivy social authenticates recipients; sponsored tx enable frictionless token transfers.

Kernel
Google sign-in creates an embedded wallet on the chosen chain; the user sees an OUSD balance, not crypto jargon.
Drives the UI as
Sign-in button, balance card in OUSD, and a receive address with copy + QR.
Mainnet · real OUSDOUSD has no testnet. Demo with small amounts (≤ 1 OUSD). Pick your chain right above the prompt.

OUSD contract addresses → Contracts page

Appendix · Secrets

Required keys.

PRIVY_APP_ID
Required. Google sign-in + embedded wallet on your chain. Read it in a route loader — Lovable rejects VITE_* secret names.
open ↗
ETHEREUM_RPC_URL / SOLANA_RPC_URL
Optional, server-only. A private RPC (Alchemy, Helius) if the public one rate-limits you.
open ↗

Add these in your Lovable project under Settings → Secrets before pasting the prompt below.

Appendix · Mega-prompt

The build prompt.

Paste into a fresh Lovable project. Make sure the secrets above are set first. read the build strategy →

Build on

Each chain gets its own complete, self-contained prompt.

Build "LightingToken Rewards" in ONE Lovable message. A single-page app that uses OUSD (Open USD) on mainnet.

CONCEPT
Issue tokenized rewards to lighting crews with social wallet onboarding and sponsored tx.
Discipline: Theater & Live Performance (crew incentives). Primitive: Privy social wallet — Google sign-in creates an embedded wallet on the chosen chain; the user sees an OUSD balance, not crypto jargon.

USER FLOW
The user signs in with Google, gets an embedded wallet, sees their OUSD balance, and performs a crew incentives action that sends a small OUSD tip (0.10 OUSD) to the creator, with an explorer link.
UI: Sign-in button, balance card in OUSD, and a receive address with copy + QR.

CHAIN — Base MAINNET (real money, no testnet)
- chainId 8453 · RPC https://mainnet.base.org · Explorer https://basescan.org
- OUSD on Base: 0xB2000000000000000000002fEb517dFeC7415344
- Tx link: https://basescan.org/tx/<hash> · Contract page: https://basescan.org/address/0xB2000000000000000000002fEb517dFeC7415344
- Gas: ETH on Base (cheap). Turn on Privy gas sponsorship for Base so users never need ETH.
- viem: `import { base } from 'viem/chains'` — use it as Privy `defaultChain` and in `supportedChains`.
- OUSD is an ERC-20. Transfer with `encodeFunctionData({ abi: erc20Abi, functionName: 'transfer', args: [to, amount] })`, `value: 0n`, sent TO the OUSD address.
- Read `decimals()` from the contract once at boot — never hardcode it.
- Pass `{ sponsor: true }` to Privy `sendTransaction` (needs Base enabled in Privy → Gas Sponsorship).

CODE — paste these files as-is (install: `@privy-io/react-auth viem`)

// src/lib/ousd.ts
import { base as CHAIN } from 'viem/chains';
export { CHAIN };
import { createPublicClient, http, erc20Abi, encodeFunctionData, parseUnits, formatUnits } from 'viem';
export const OUSD = '0xB2000000000000000000002fEb517dFeC7415344' as const;
export const pub = createPublicClient({ chain: CHAIN, transport: http('https://mainnet.base.org') });
let dec: number | undefined;
export async function ousdDecimals() { return dec ??= await pub.readContract({ address: OUSD, abi: erc20Abi, functionName: 'decimals' }); }
export async function ousdBalance(owner: `0x${string}`) {
  const raw = await pub.readContract({ address: OUSD, abi: erc20Abi, functionName: 'balanceOf', args: [owner] });
  return Number(formatUnits(raw, await ousdDecimals()));
}
export async function transferTx(to: `0x${string}`, amount: string) {
  const value = parseUnits(amount, await ousdDecimals());
  return { to: OUSD, value: 0n, chainId: CHAIN.id,
    data: encodeFunctionData({ abi: erc20Abi, functionName: 'transfer', args: [to, value] }) };
}
export const txUrl = (h: string) => 'https://basescan.org/tx/' + h;
export async function waitFor(hash: `0x${string}`) { return pub.waitForTransactionReceipt({ hash, timeout: 90_000 }); }

// src/components/privy-root.tsx  (default export; loaded with React.lazy inside <ClientOnly>)
import { PrivyProvider } from '@privy-io/react-auth';
import { CHAIN } from '@/lib/ousd';
export default function PrivyRoot({ appId, children }: { appId: string; children: React.ReactNode }) {
  return <PrivyProvider appId={appId} config={{ loginMethods: ['google'], defaultChain: CHAIN, supportedChains: [CHAIN],
    embeddedWallets: { ethereum: { createOnLogin: 'users-without-wallets' } } }}>{children}</PrivyProvider>;
}

// Sending (inside a component under PrivyRoot)
// const { sendTransaction } = useSendTransaction();       // from '@privy-io/react-auth'
// const { hash } = await sendTransaction(await transferTx(to, '1.00'), { sponsor: true });
// await waitFor(hash); show txUrl(hash).

STACK
- TanStack Start (the Lovable default). One page at the index route.
- Privy for sign-in (Google) and embedded wallets on the chain below. Load Privy with
  `React.lazy(() => import('./privy-root'))` inside `<ClientOnly>` — a static import crashes SSR.
- Secret `PRIVY_APP_ID` (paste in Project Settings → Secrets). Read it in a route loader via a server
  function (`process.env.PRIVY_APP_ID`) and pass it to the provider. NEVER name a secret `VITE_*`.
- Show amounts in OUSD with 2 decimals; convert with the on-chain decimals.
- No smart contract deploy is needed: OUSD is already live. Every action is an OUSD token transfer.

SHARED CODE — paste as-is
// src/lib/privy.functions.ts
import { createServerFn } from '@tanstack/react-start';
export const getPrivyAppId = createServerFn({ method: 'GET' })
  .handler(async () => ({ appId: process.env['PRIVY_APP_ID'] ?? null }));

// src/routes/index.tsx (shape)
// loader: () => getPrivyAppId()
// const { appId } = Route.useLoaderData();
// const PrivyRoot = React.lazy(() => import('@/components/privy-root'));
// if (!appId) render the full UI in demo mode with a banner "Add PRIVY_APP_ID to go live" (no sends).
// else: <ClientOnly fallback={<Skeleton/>}><Suspense><PrivyRoot appId={appId}><App/></PrivyRoot></Suspense></ClientOnly>
// Inside <App/>: const { ready, authenticated, login, logout } = usePrivy(); wait for `ready` before reading wallets.

REAL MONEY RULES (mainnet only)
- Above every Pay button show: "Mainnet · real OUSD". Default demo amounts ≤ 1 OUSD.
- Before sending, check the OUSD balance; if too low, show "Get OUSD" linking to https://joinopenstandard.com/integrate.
- Always confirm the wallet is on the right chain before sending; refuse with a clear "switch network" message otherwise.
- After sending, wait for confirmation, then show the explorer link. Never show success before confirmation.

TROUBLESHOOTING
- "window is not defined" / blank SSR page → Privy was imported statically. Only import it via React.lazy inside <ClientOnly>.
- Wrong network / chain mismatch → defaultChain and supportedChains must be the same chain object; refuse to send otherwise.
- Solana "TokenAccountNotFound" → the idempotent create-ATA instruction must precede the transfer; balance = 0 when no ATA.
- "insufficient funds for gas" → enable Privy gas sponsorship for this chain, or tell the user which gas coin to add.
- Balance too low → disable Pay and show "Get OUSD" linking to https://joinopenstandard.com/integrate.

COMPLIANCE (mandatory — OUSD is issued by Bridge, a Stripe company)
- Show a footer notice: "OUSD is not available in the European Economic Area or sanctioned regions. See https://joinopenstandard.com/legal/geo-restrictions-and-prohibited-use-cases".
- Never build or market for prohibited uses: gambling, games of chance, lotteries, sweepstakes, unlawful
  prediction markets, adult content, cannabis, tobacco, weapons, pharmaceuticals, luxury goods, jewelry,
  watches, precious metals, mixing, multi-level marketing, counterfeit goods or deceptive practices.
- OUSD is acquired through partners (Stripe/Bridge/Privy, Coinbase, Visa, Mastercard) or exchanges
  (Coinbase, Kraken, Uniswap). The app itself never mints or redeems.

DEFINITION OF DONE
1. Google sign-in via Privy creates an embedded wallet on the chain above and shows its OUSD balance.
2. The crew incentives flow sends a real OUSD transfer, waits for confirmation, and shows a working explorer link.
3. The compliance footer and the real-money notice are visible.
4. The page works with zero secrets (demo mode with a "Add PRIVY_APP_ID to go live" banner).

Credit in the footer: "Built during the Creative AI & Quantum Hackathon organised by StreetKode Fam during Indian Krump Festival 14".
Appendix · Market

Market sizing.

TAM
$500M
stage crew management
SAM
$150M
digital workforce incentives
SOM
$20M
blockchain-driven crew rewards

Indicative figures for hackathon pitches — refine with your own research before raising.

RestrictionsOUSD is not available in the European Economic Area or sanctioned regions, and may not be used for gambling, lotteries, prediction markets, adult content, weapons and other prohibited uses. Read the full list ↗
See also

Adjacent entries.