ChatSafe
AI-Powered Safety for Onchain Chats.
Created on 5th June 2025
β’
ChatSafe
AI-Powered Safety for Onchain Chats.
The problem ChatSafe solves
π‘οΈ The Problem It Solves
Group messaging onchain is powerfulβbut dangerously unmoderated.
As blockchain-based communication tools like XMTP grow, so does the risk of abuse: spam, hate speech, scams, and misinformation.
Most crypto-native group chats today have no automated moderation, no community safety tooling, and no accountability baked into their infrastructure. This leads to:
- Unsafe environments for users
- Spam and scam exposure
- Reputation loss for communities and protocols
- Manual moderation burden on admins (if any)
β
What ChatSafe Does
ChatSafe is an onchain, AI-powered safety agent for group chats built on XMTP. It brings real-time moderation, accountability, and transparency to decentralized messaging.
π§© Use Cases-
π DAOs & Protocols β Keep governance and contributor chats clean, safe, and civil
π Onchain Communities β Moderate group conversations at scale, automatically
π¬ Web3 Social Platforms β Offer built-in moderation for user-generated content
π οΈ **Infra Builders **β Add ChatSafe as a plug-in moderation agent for new chat dApps
π‘ How It Makes Life Easier
Without ChatSafe With ChatSafe β¨
-
- π« Manual moderation β Automated, AI-powered filtering
-
- β No message records β All infractions logged onchain
-
- π³οΈ Zero transparency β Publicly auditable moderation
-
- π΅βπ« No trust signals β Onchain user reputation system
Challenges I ran into
Challenges I Ran Into
One of the biggest challenges was integrating all the moving parts: XMTP messaging, OpenAI moderation, smart contracts on Base, and a real-time dashboard β all in a full-stack system that had to communicate seamlessly.
Specific Hurdles:
-
XMTP Listener + Agent Reliability
Building an always-on moderation agent that listens to XMTP group messages was tricky. We had to ensure stable message polling, avoid duplicate processing, and handle intermittent failures gracefully. -
Smart Contract ABI Sync
Keeping the frontend and backend in sync with the smart contract ABI was error-prone. Small mismatches in function signatures caused subtle bugs. We solved this by creating a helper script to copy the compiled ABI to both the agent and dashboard automatically. -
Rate-Limiting + Token Usage (OpenAI)
The moderation AI (OpenAI's model) needs to be called responsibly. We had to implement logic to only call the model when messages actually needed filtering β and cache or skip messages that were clearly safe to avoid unnecessary API usage. -
Onchain Logging + Gas Optimization
Logging every flagged message onchain had to be gas-efficient. We initially logged full messages but later optimized the contract to store just the hashes and essential metadata to reduce gas costs. -
XMTP Group Messaging Is Still Evolving
XMTP group chats are relatively new, and documentation was limited. Understanding how to reliably listen to group conversations and extract message metadata (sender, timestamp) required trial-and-error and digging through source code.
Cheer Project
Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.
