Note
This file is synced with SKILL.md. Edits to one will be reflected in the other.
A headless Web3 P2P commerce protocol for social platforms (Reddit, Discord, Twitter). Sellers verify identity via World ID, create IPFS-hosted listings, share links, and buyers chat via XMTP and pay via Coinbase x402 on Base. No database β all state lives on IPFS.
- Framework: Next.js 16, React 19, TypeScript
- Package Manager: bun
- Styling: Tailwind CSS v4, shadcn/ui, Framer Motion
- Wallet: RainbowKit + wagmi + viem
- Identity: World ID (IDKit) β
@worldcoin/idkit - Messaging: XMTP V3 β encrypted buyerβseller chat via
@xmtp/browser-sdk - Payments: Coinbase x402 (
x402-next,@coinbase/x402) on Base Sepolia - Storage: Filebase (IPFS) for metadata & images
- Agent:
@xmtp/agent-sdkfor AI seller agent
bun install # Install dependencies
bun dev # Dev server (Next.js)
bun build # Production build
bun run agent # Start XMTP AI agent
bun lint # ESLintsrc/app/β Next.js App Router pages & API routessrc/app/api/deal/[id]/β Listing API (read from IPFS)src/app/api/deal/[id]/x402/β x402 payment-gated API endpoint (for agents)src/app/api/verify/β World ID proof verificationsrc/app/api/rp-signature/β World ID RP signature generationsrc/app/api/upload/β IPFS upload via Filebasesrc/app/pay/[id]/β x402 paywall-protected payment confirmation pagesrc/components/β React componentssrc/components/ui/β shadcn/ui primitivessrc/lib/β Utilities (chains, filebase, wagmi config, utils)src/lib/xmtp-agent.tsβ XMTP AI agent for sellersrc/proxy.tsβ x402 payment proxy (protects /pay/* routes)
WorldIDAuthβ World ID sign-in/sign-up with IDKit (Orb & Device)WorldIDOnboardingβ Initial World ID setup flowDealCreatorβ Create listing form β IPFS uploadDealDashboardβ Seller's listing management (view)DealGateβ Buyer-facing listing page with verification badge, x402 payment, XMTP chatXMTPChatβ Embedded XMTP V3 chat using@xmtp/browser-sdkXMTPChatrequires wallet connection before rendering (useuseAccountto check)LandingPageβ Marketing page with features, demo, use cases
@/*maps to./src/*(tsconfig paths)
- App Router (not Pages Router) β layouts in
layout.tsx, pages inpage.tsx - Components use
'use client'directive where needed - UI components from shadcn/ui in
src/components/ui/ - Tailwind v4 with
@tailwindcss/postcssplugin - React Compiler enabled (
reactCompiler: truein next.config.ts) - Environment variables in
.env.local(not committed)
The frontend uses @xmtp/browser-sdk for V3:
import { Client } from '@xmtp/browser-sdk';
import { useWalletClient, useAccount } from 'wagmi';
// Create signer from wagmi walletClient (avoid ethers BrowserProvider)
const eoaSigner = {
type: 'EOA' as const,
getIdentifier: async () => ({
identifierKind: 1,
identifier: walletAddress.toLowerCase()
} as any),
signMessage: async (message: string): Promise<Uint8Array> => {
const sig = await walletClient.signMessage({ message });
const sigHex = sig.slice(2);
return new Uint8Array(sigHex.match(/.{1,2}/g)?.map(byte => parseInt(byte, 16)) || []);
}
};
const client = await Client.create(eoaSigner, { env: 'dev' });The seller agent uses @xmtp/agent-sdk:
import { Agent, createSigner, createUser } from '@xmtp/agent-sdk';
const user = createUser(privateKey);
const signer = createSigner(user);
const agent = await Agent.create(signer, { env: 'dev' });
agent.on('text', async (ctx) => {
await ctx.sendTextReply('Response');
});
await agent.start();NEXT_PUBLIC_WLD_APP_ID # World ID app ID (from developer.worldcoin.org)
WORLD_PRIVATE_KEY # World ID RP signing key
NEXT_PUBLIC_X402_PAY_TO # Wallet address to receive x402 payments
NEXT_PUBLIC_XMTP_ENV # XMTP environment: 'dev' (default) or 'production'
XMTP_WALLET_KEY # Private key for XMTP agent
XMTP_DB_ENCRYPTION_KEY # Encryption key for agent database
FILEBASE_ACCESS_KEY # Filebase IPFS access
FILEBASE_SECRET_KEY # Filebase IPFS secret
NEXT_PUBLIC_FILEBASE_BUCKET # Filebase bucket name
NEXT_PUBLIC_FILEBASE_GATEWAY # Filebase gateway URL
- Page paywall:
src/proxy.tsprotects/pay/*routes with x402 payment requirement - Agent API:
src/app/api/deal/[id]/x402/route.tsuseswithX402for programmatic agent purchases - Testnet: Uses default x402.org facilitator (no CDP credentials needed for base-sepolia)
- Mainnet: Requires
CDP_API_KEY_IDandCDP_API_KEY_SECRETwith@coinbase/x402facilitator
- Use existing shadcn/ui components from
src/components/ui/ - Follow the naming and structure conventions
- Use Tailwind for styling
- Add route file in
src/app/api/[endpoint]/route.ts - Use standard Next.js App Router conventions
- Handle errors gracefully
- Ensure wallet is connected (XMTPChat only renders when
isConnected) - Check browser console for
[XMTP V3]logs - Agent must be running:
bun run agent
- Check that wallet is connected first
- Verify agent is running with
ps aux | grep agent - Check agent logs for errors
- Ensure both use same XMTP network (dev vs production)
- Clear old XMTP databases:
rm -f xmtp-dev-*.db3*
Built for the World Chain Γ XMTP Γ Coinbase Hackathon
TruCheq is a sybil-resistant P2P commerce protocol for social platforms like Reddit, Discord, and Twitter. It turns any chat thread into a verifiable storefront β no marketplace, no database, no middlemen.
It combines three hackathon primitives into one seamless flow:
- World ID (IDKit) β Seller identity verification. Orb-verified = trusted human. Device-verified = basic trust.
- XMTP β End-to-end encrypted buyerβseller chat embedded directly on listing pages.
- Coinbase x402 β Payment settlement on Base.
- Verify β Seller signs in with World ID β receives an Orb or Device verification badge.
- List β Seller creates a listing β images & metadata upload to IPFS (Filebase).
- Share β A unique link is generated β seller posts it on Reddit / Discord / Twitter.
- Browse β Buyer clicks the link β sees the listing with the seller's verification status and trust level.
- Chat β Buyer negotiates with the seller's AI agent via XMTP (encrypted).
- Pay β Payment settles via Coinbase x402 on Base.
| Layer | Technology |
|---|---|
| Framework | Next.js 15, React 19, TypeScript |
| Identity | World ID (IDKit) β Orb & Device verification |
| Messaging | XMTP β encrypted buyerβseller chat |
| Payments | Coinbase x402 protocol on Base |
| Storage | Filebase (IPFS) for metadata & images |
| Wallet | RainbowKit + wagmi + viem |
| UI | Tailwind CSS, shadcn/ui, Framer Motion |
Current: Listings are stored entirely in IPFS. No gas fees for sellers.
Seller β Upload metadata to IPFS β Share link directly
Buyer β View listing from IPFS β Pay via x402
Future: Adding Escrow
If you want to add escrow functionality in the future, here are the options:
- Deploy a contract that holds buyer funds until delivery confirmed
- Seller calls
createListing()(pays gas) - Buyer deposits USDC to contract
- Seller confirms shipment β buyer confirms receipt β funds released
- Dispute resolution: either party can initiate, escalation to arbitrator
- Use x402's built-in features to hold payment
- Both parties must confirm completion
- Funds released only when buyer confirms "received"
- Integrate with existing escrow providers
- More complex but proven dispute resolution
- World ID verification as trust signal
- XMTP chat for negotiation
- Assume good faith + reputation scoring
- Currently implemented β
# Install dependencies
bun install
# Run development server
bun devCreate a .env.local file in the project root:
# World ID
NEXT_PUBLIC_WLD_APP_ID=app_staging_...
# Coinbase x402 β wallet to receive payments
NEXT_PUBLIC_X402_PAY_TO=0x...
# Filebase (IPFS)
FILEBASE_ACCESS_KEY=your_access_key
FILEBASE_SECRET_KEY=your_secret_key
NEXT_PUBLIC_FILEBASE_BUCKET=trucheq
NEXT_PUBLIC_FILEBASE_GATEWAY=your_gateway.myfilebase.com
# Coinbase CDP (optional, for agent payments)
CDP_API_KEY_ID=...
CDP_API_KEY_SECRET=...| Track | Integration | Status |
|---|---|---|
| World ID | IDKit β Orb & Device seller verification | β |
| XMTP | Encrypted buyerβseller chat on listing pages | β |
| Coinbase x402 | Payment settlement on Base | β |
| No Gas for Sellers | IPFS-only listings (no smart contract) | β |
Seller Buyer / Agent
β β
ββ World ID verify βββββββββββ β
ββ Upload to IPFS (Filebase) β β
β βΌ β
β TruCheq Link β
β β β
β ββββββββ€
β β View listing from IPFS
β β World ID verification badge
β β Chat via XMTP
β β Pay via x402
β βΌ
βββββββββββββ Settlement on Base βββββ
TruCheq β Trust in a link.

