Skip to main content

Component map

Advertiser / AI lab          Human              Group owner
      │                        │                     │
Canvas AI · buy flow    Telegram Bot API     Canvas AI · register
      │                        │                     │
      └──────────────┬─────────┘                     │
                     ▼                               │
              Agent Server · Railway ◄───────────────┘
              (Node.js / TypeScript)

              ┌──────┴──────┐
              ▼             ▼
           Postgres     Conversation LLM
           (state)      (dialogue turns)

                        Kimi inference
                        (transcript scoring)

                    ① logCompletion
                    ② releasePayout

                     Escrow Contract · Base
                     (holds USDC · logs · pays out)

Components

Agent server (Railway)

The always-on Node.js process that runs every verification. Responsibilities:
  • Receives Telegram webhooks on new group joins
  • Checks Postgres for group registration and active campaign budget
  • Manages per-user verification state machine
  • Calls the conversational LLM to generate agent turns
  • Submits transcripts to Kimi for scoring
  • Fires logCompletion and releasePayout contract calls
  • Delivers completion data to advertisers

Postgres

TableContents
groupsRegistered groups, topic, floor price, payout wallet
campaignsAdvertiser campaigns, bid price, budget, group assignments
verificationsPer-user verification state, conversation history, Kimi score
user_sessionsActive conversation state per Telegram user ID

Conversational LLM

Generates dialogue turns from the advertiser brief and group context. Decides whether to probe based on response length and specificity. Closes the conversation after 2–3 agent turns. Does not score responses.

Kimi (Moonshot AI)

Receives the full transcript after the conversation closes. Returns a quality score between 0 and 1. Score at or above KIMI_PASS_THRESHOLD triggers releasePayout. Score below threshold triggers re-prompt. API endpoint: api.moonshot.ai/v1
Relevant env vars: KIMI_API_KEY, KIMI_BASE_URL, KIMI_MODEL, KIMI_PASS_THRESHOLD

Escrow contract (Base mainnet)

Address: 0xf808b264E13Bf809C8e86afaF4e14c200931101E Handles advertiser deposits, per-completion onchain logging, and USDC release to group owner wallets. Full function reference: Smart contract.

Telegram bot (@CanvasVerificationBot)

  • Detects join events via Telegram webhook
  • Posts a brief verification notice in the group chat
  • Opens a DM with the joining user
  • Relays turns between user and conversational LLM
  • Restricts and unrestricts users based on verification outcome

Infrastructure

LayerService
Agent serverRailway (Node.js, always-on)
DatabaseRailway Postgres
Frontend / dashboardVercel
DNSCloudflare
BlockchainBase mainnet
BotTelegram BotFather (@CanvasVerificationBot)
Conversational LLMLightweight model (e.g. Gemini Flash 2.0)
Quality scoringKimi · Moonshot AI