Skip to content
ChatSafe

ChatSafe

AI-Powered Safety for Onchain Chats.

Created on 5th June 2025

β€’

ChatSafe

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

https://github.com/0x-Parzival/ChatSafe

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.

Discussion

Builders also viewed

See more projects on Devfolio