Back
Waste2Wealth

Project 02

Waste2Wealth


LA Hacks 2026

The hardest problem in any token-incentive system is Sybil resistance. Waste2Wealth solves this first, then builds the incentive economy on top.

Three participant roles form the loop. Reporters photograph litter; the photo goes directly to Cloudinary and through a two-question AI moderation gate before it appears on the map. If it passes, Gemini 2.5 Flash tags the litter: severity, category, object type, materials, item count. Cleaners browse a live map powered by a PostGIS GIST-indexed geo-query, claim a task, clean it, and submit a before/after photo pair.

Cleanup verification runs Cloudinary dual-source comparison first: one API call, both images, binary verdict. Only ambiguous or passing results proceed to a 5-agent Gemini consensus via asyncio.gather(). Five independent AI perspectives running in parallel. Sequential would take roughly 10s at typical API latency; gathered, it takes roughly 2s, capped at the slowest agent.

Sybil resistance on voting uses World ID nullifiers. Each vote records a nullifier hash per (cleanup_id, voter_id). The backend rejects any vote where that nullifier has already voted on the same cleanup, regardless of how many accounts the attacker controls. A cleaner cannot vote to approve their own cleanup (separate check). An attacker with 50 wallets has one World ID and one vote.

Rewards are severity-tiered by AI-assigned severity, distributed to cleaner, reporter, and all verifiers. The map updates in real time via Supabase Realtime, no polling. Solana wallets are generated client-side as Ed25519 keypairs stored in SecureStore, hardware-backed and never exposed to the user.

Built in 36 hours at LA Hacks 2026. Won.

What I Learned

  • Design adversarial resistance before the reward logicBuilding Sybil resistance (World ID nullifiers), fake report filtering (Cloudinary moderation), and self-approval prevention before writing the payout logic meant the attack surface was never open. Adding fraud prevention after incentives exist means patching a system that has already been exploited.
  • PostGIS GEOGRAPHY vs GEOMETRYGEOMETRY treats coordinates as flat Cartesian points, correct for small areas but wrong at city scale. GEOGRAPHY treats them as points on an oblate spheroid and computes true geodesic distances. For ST_DWithin on real-world GPS coordinates, GEOGRAPHY gives correct results; GEOMETRY gives subtly wrong distances that worsen toward the poles. Both support GIST indexes.
  • asyncio.gather() is a first-class tool for LLM consensusFive sequential Gemini calls at roughly 2s each is 10s per verification. asyncio.gather() runs all five concurrently, capped at the slowest agent's latency. For any multi-agent consensus system where agents are independent, gathering is the default. Sequential calls are almost always wrong.
  • Incentive calibration is a product decision, not an implementation detailFlat rewards create a race to claim easy tasks and ignore hard ones. The 4x multiplier between Minor and Major severity sites was calibrated to make cleaning a large illegal dump worth the extra time and risk. Getting this wrong means the cleanup incentives optimize for quantity over impact.

Tech Stack

React NativeExpoFastAPISolanaCloudinary AISupabase

Links