For the complete documentation index, see llms.txt. This page is also available as Markdown.

5. Architecture & Technology

5.1 System Overview

The Aivive stack is intentionally serverless and capital-efficient.

  • Application: Next.js 16 (App Router, Turbopack), deployed on Vercel.

  • Database: Supabase Postgres with row-level security.

  • Storage: Cloudflare R2 with a managed image-resize CDN.

  • Background jobs: Inngest (AI generation, content moderation, the cross-chain burn pipeline).

  • EVM chain layer: viem + wagmi for Base.

  • Solana chain layer: @solana/web3.js + @sqds/multisig.

5.2 Authentication & Wallet Architecture

Authentication is handled by Privy. A single Privy account derives two embedded wallets simultaneously:

  • One EVM wallet for USDC payment on Base.

  • One Solana wallet for receiving future airdrops or interacting with on-chain primitives in later phases.

Users perceive a single account; the underlying dual-chain infrastructure is invisible to them.

Email, Google, and Apple sign-in are all supported. There is no requirement to install a wallet extension, manage seed phrases, or hold any cryptocurrency before entering the product.

5.3 AI Provider Routing

Image generation requests are routed through a unified gateway that selects the appropriate provider based on the requested tier. This abstraction allows Aivive to swap providers without exposing implementation churn to the user, and to take advantage of pricing competition across providers.

  • Latency-critical tiers (Standard) → fal.ai for cold-start performance.

  • Quality-critical tiers (Ultra) → OpenAI directly.

5.4 Content Moderation

A two-layer moderation pipeline runs on every generation:

  1. Text moderation — OpenAI Moderation API on the input prompt and the generated image caption.

  2. Image moderation — fal's nsfw-image-detection model on the produced image.

Generations flagged as borderline are routed to a human review queue with a 24-hour SLA. Generations confirmed as policy-violating are auto-hidden and the user receives a strike. Three strikes result in account suspension.

A prompt blocklist (politicians, named celebrities, minors, violence, hate) is enforced via both substring and embedding-similarity matching.

5.5 The Credit Ledger

The platform's source of truth for usage is an append-only, double-entry credit ledger in Postgres. Every credit issuance, deduction, and refund is recorded as an immutable row. Reading a user's current balance is a single indexed query against the latest entry.

The schema (Drizzle ORM, simplified):

The ledger is anchored to the on-chain economic loop through the topup intent system: every USDC payment received on Base is reconciled to a ledger entry within seconds via Alchemy Webhooks.

5.6 Observability

Every layer of the system is instrumented:

  • Sentry captures application errors.

  • PostHog captures product analytics.

  • Vercel Analytics captures performance telemetry.

  • The cross-chain burn pipeline is monitored independently, with alerting on any cycle that fails to complete within its SLA.

Public-facing metrics — total burns, weekly burn velocity, AVV in circulation — are exposed at aivive.ai/burn and on the project's Dune dashboard.


← aivive.ai · Tokenomics →

Last updated

Was this helpful?