Decentralized AI Dating Platform on Polkadot
Verifiable Identity Β· Private AI Matching Β· Staked Connections
Token42 is a next-generation dating platform that solves the "Trust Gap" in online dating. By combining Polkadot's verifiable identity infrastructure with AI-powered matching inside secure enclaves, Token42 ensures that every user is a real human, every match is privately computed, and every interaction is economically accountable.
The name represents the search for the ultimate connection in a verifiable, tokenized world.
| Feature | Description |
|---|---|
| πͺͺ Verifiable Identity | Connect with real humans verified via Polkadot's People Chain identity infrastructure. |
| π€ Private AI Matching | Private personality analysis inside Phala Network's secure enclaves (TEE). |
| π° Staked Messaging | Anti-spam protocol using rUSD staking to ensure high-value connections. |
| π·οΈ Soulbound Profiles | Non-transferable digital identities on the Revive EVM (PolkaVM). |
| π‘οΈ AI Moderation Oracle | Automated harassment detection with on-chain slashing penalties |
Token42 is built on a four-layer decentralized stack:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND (React/Vite) β
β Wallet Connection Β· Profile UI Β· Chat Interface β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββ βββββββββββββββββββββββββββββββ β
β β IDENTITY β β INTELLIGENCE β β
β β People Chain β β Phala Network TEE β β
β β (DID / Precomp.) β β Llama-3-8B Vectorization β β
β β 0x...901 β β Cosine Similarity Matching β β
β ββββββββββ¬βββββββββββ β Match Intent Signing β β
β β βββββββββββββββ¬ββββββββββββββββ β
β βΌ βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β LOGIC LAYER (Revive EVM) β β
β β Token42Profile.sol Token42Messaging.sol β β
β β β’ Soulbound Tokens β’ rUSD Staking β β
β β β’ Identity Checks β’ Signature Verification β β
β β β’ CID Storage β’ Slashing Oracle β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β STORAGE LAYER (IPFS / Pinata) β β
β β Encrypted bios Β· Profile media Β· Metadata CIDs β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Token42 uses XMTP V3 (MLS) for real-time, end-to-end encrypted messaging. Unlike legacy V2, V3 uses a "Group" architecture for all DMs, relying on a Welcome protocol and a local encrypted database (OPFS).
sequenceDiagram
participant A as User A (Sender)
participant N as XMTP Network (Nodes)
participant B as User B (Receiver)
participant DB as Local DB (OPFS)
Note over A: 1. createDm(B_Addr)
A->>N: Fetch B's Inbox ID
A->>N: Publish MLS Welcome + Keys
A->>N: Send Encrypted Message Packet
Note over B: 2. Background sync()
B->>N: Query for new Welcomes
N-->>B: Return Welcome Packet
Note over B: 3. Decrypt Welcome
B->>DB: Store Group Keys
Note over B: 4. Message stream()
B->>N: Fetch Encrypted Packets
N-->>B: Return Packets
Note over B: 5. Decrypt Message (using keys from DB)
B->>B: Resolve Sender Wallet Address
Note over B: 6. Update UI
| Layer | Technology | Purpose |
|---|---|---|
| Smart Contracts | Solidity 0.8.28, Minimal impls (no OZ), Hardhat | Profile SBTs, staked messaging, slashing |
| Runtime | Polkadot Asset Hub (Revive EVM / PolkaVM) | EVM-compatible execution on Polkadot |
| Identity | Paseo People Chain, Identity Precompile (0x...901) |
On-chain human verification (DID) |
| AI Engine | Phala Network TEE, Llama-3-8B | Private personality vectorization & matching |
| Storage | IPFS (Pinata) | Decentralized media & metadata hosting |
| Frontend | React 18, TypeScript, Vite, ethers.js | Mobile-responsive dApp interface |
| Wallets | SubWallet, Talisman, MetaMask | Transaction signing & identity proofs |
| Testing | Hardhat (npx hardhat test) | Contract unit & integration tests |
| Dev Env | DevContainers, Kitdot CLI | Zero-config development environment |
token42/
βββ .devcontainer/ # DevContainer setup (Docker + VS Code)
β βββ devcontainer.json
β βββ Dockerfile
β βββ scripts/ # Setup & initialization scripts
βββ contracts/ # Hardhat-compatible (Solidity ^0.8.28, no OZ)
β βββ contracts/ # Source files
β β βββ Token42Profile.sol # Minimal soulbound profile
β β βββ Token42Messaging.sol # Minimal staked messaging
β β βββ MockRUSD.sol # Test mock ERC-20
β β βββ MockIdentityPrecompile.sol
βββ ignition/modules/ # Hardhat Ignition deployment
β βββ Token42Module.js
βββ test/ # Hardhat tests
β βββ Token42Profile.test.js
β βββ Token42Messaging.test.js
βββ agent/ # Phala TEE AI Agent
β βββ src/index.ts # Express server & AI logic
βββ frontend/ # React dApp (Vite)
βββ guides/ # Comprehensive Documentation
β βββ AGENTS.md # AI agent instructions
β βββ AI_INTEGRATION_GUIDE.md # Technical bridge between AI and contracts
β βββ KITDOT_HACKATHON_GUIDE.md # Development guide
β βββ LOCAL_INFERENCE.md # Running Llama 3 locally via Ollama
β βββ LOCAL_TESTING_GUIDE.md # 2-User interaction walkthrough
β βββ UI_INTEGRATION_GUIDE.md # Identity & Messaging UI requirements
βββ hardhat.config.js # Hardhat + PolkaVM config
βββ .gitignore
βββ README.md
Prerequisites: Node.js 22+ and npm, Ollama (for local AI matching), or Docker for DevContainers.
- Install Docker Desktop and the VS Code Dev Containers extension
- Open this project in VS Code
- Click "Reopen in Container" β all tools install automatically
git clone https://github.com/GReturn/Project-Token42.git
cd Project-Token42npm install
npx hardhat compile
npx hardhat testEnsure Ollama is running and you have pulled the model: ollama pull llama3.
cd agent
npm install
# Configure .env with your AGENT_PRIVATE_KEY
npx tsx src/index.tscd frontend
npm install
npm run devThe contracts are live on the Paseo Asset Hub (Revive EVM):
- Token42Profile:
0x9B9f7569A535Cd2B66EC9B2F5509F5e688Ba92B5 - Token42Messaging:
0x8B8d13a7f678FA8f6793290Ee9e46302Be427453 - Token42Escrow:
0xb6B64176CC8a8350AB84D466CD4bf111C3A6E7a5 - MockRUSD:
0xFE4eae5d84412B70b1f04b3F78351a654D28Da25(withfaucet()function)
For deeper technical dives, see the following guides:
- π§ AI Integration Guide: How the AI Agent signs match intents for the blockchain.
- π» Local Inference Setup: Setting up Ollama and Llama 3 for private local matching.
- π₯ Local Testing Guide: Stepper-by-step walkthrough of a 2-user interaction.
- π¨ UI Integration Guide: Handling identity verification and messaging errors in React.
- π οΈ Hackathon Guide: Core development workflow and architecture.
Important
This version of Token42 is a Hackathon Prototype. To facilitate the demonstration, the following elements are currently simplified or mocked:
- Mock Data: The frontend initially populates some state with mock profile data to show the UI without waiting for IPFS/Contract indexing.
- Identity Simulation: The People Chain identity check is simulated in the UI; in production, this calls the
0x...901precompile via astaticcall. - Storage: Integration with Pinata (IPFS) is functional, but currently uses a public gateway for demonstration.
- Slashing: The moderation
/slashendpoint is exposed for developers but not yet triggered by an automated on-chain oracle.
Connect Wallet βββΊ Verify Identity βββΊ Mint SBT Profile βββΊ AI Matching βββΊ Stake & Chat
β β β β β
SubWallet / People Chain Token42Profile Phala TEE Agent Token42Messaging
Talisman Precompile 0x901 (Soulbound) Cosine Similarity rUSD Lock/Claim
| SDG | Impact |
|---|---|
| SDG 5 β Gender Equality | AI moderation + staking reduces harassment; economic penalties deter bad actors |
| SDG 16 β Peace, Justice & Strong Institutions | Sovereign decentralized identity; no central authority owns your data |
