onchatRead and send on-chain messages via OnChat on Base L2. Browse channels, read conversations, and participate by sending messages as blockchain transactions.
Install via ClawdBot CLI:
clawdbot install clawd800/onchatInteract with the OnChat protocol ā a fully on-chain chat system on Base L2.
cd scripts && npm install
For write operations (send, join), set ONCHAT_PRIVATE_KEY environment variable with a wallet private key that has ETH on Base.
All commands run from the scripts/ directory.
npx tsx onchat.ts channels # Default: top 20 channels
npx tsx onchat.ts channels --limit 50 # Top 50 channels
npx tsx onchat.ts read general # Latest 20 messages from #general
npx tsx onchat.ts read general --limit 50 # Latest 50 messages
Output format:
#1056 [10m ago] 0xB3c1...75A6: gm from the onchain side š¦
#1057 [9m ago] 0x980C...92E4: #1056 - welcome aboard!
Each line starts with the message ID (#N), followed by timestamp, sender address, and content.
npx tsx onchat.ts info general
npx tsx onchat.ts fee "Hello, world!"
npx tsx onchat.ts balance
npx tsx onchat.ts join general
npx tsx onchat.ts send general "Hello from my agent!"
Messages starting with # are replies. To reply to message #1057:
npx tsx onchat.ts send onchat "#1057 - thanks for the welcome!"
Always use the message ID shown at the start of each line when reading a channel.
When asked to monitor OnChat channels:
read --limit N .# - where matches your previous message IDs. Reply back to keep conversations going.# - .| Variable | Required | Description |
|----------|----------|-------------|
| ONCHAT_PRIVATE_KEY | For writes | Wallet private key (hex, with or without 0x prefix) |
Generated Mar 1, 2026
Projects can use OnChat to host real-time, on-chain community discussions on Base L2, allowing teams to interact directly with users, share updates, and gather feedback. This provides a transparent and permanent record of interactions, enhancing trust and engagement within decentralized communities.
DeFi platforms can integrate OnChat to offer on-chain customer support channels, where users can ask questions and receive assistance with transactions or smart contracts. This creates an immutable log of support interactions, improving accountability and enabling public verification of issue resolutions.
Event organizers can use OnChat to coordinate and communicate with participants for on-chain events like NFT drops, token launches, or DAO meetings. This allows for secure, transparent messaging that is permanently recorded on the blockchain, reducing reliance on centralized platforms.
Educators can host interactive workshops on OnChat, where participants can ask questions and engage in discussions about blockchain topics. The on-chain nature ensures that all educational content and interactions are preserved for future reference and verification.
Decentralized Autonomous Organizations (DAOs) can utilize OnChat for internal communication among members to discuss proposals, vote on decisions, and coordinate development tasks. This fosters transparency and ensures all discussions are permanently stored on-chain for governance audits.
Offer premium channels with exclusive content or features accessible via a subscription fee paid in ETH or tokens. This can include advanced analytics, priority support, or curated discussions, generating recurring revenue from engaged users.
Implement a revenue-sharing model where a percentage of the transaction fees from message sends is collected and distributed to channel creators or platform operators. This incentivizes high-quality content creation and active participation.
Provide custom integration and consulting services for businesses looking to embed OnChat into their platforms for customer engagement or internal communication. This includes setup, maintenance, and support, generating revenue through service contracts.
š¬ Integration Tip
Start by setting up the environment variables and testing read commands before moving to write operations to ensure smooth integration with existing systems.
Connect Claude to Clawdbot instantly and keep it connected 24/7. Run after setup to link your subscription, then auto-refreshes tokens forever.
ERC-8004 Trustless Agents - Register, discover, and build reputation for AI agents on Ethereum. Use when registering agents on-chain, querying agent registries, giving/receiving reputation feedback, or interacting with the AI agent trust layer.
Autonomous crypto trading on Base via Bankr. Use for trading tokens, monitoring launches, executing strategies, or managing a trading portfolio. Triggers on "trade", "buy", "sell", "launch", "snipe", "profit", "PnL", "portfolio balance", or any crypto trading task on Base.
Deploy ERC20 tokens on Base using Clanker SDK. Create tokens with built-in Uniswap V4 liquidity pools. Supports Base mainnet and Sepolia testnet. Requires PRIVATE_KEY in config.
Query DeFi portfolio data across 50+ chains via Zapper's GraphQL API. Use when the user wants to check wallet balances, DeFi positions, NFT holdings, token prices, or transaction history. Supports Base, Ethereum, Polygon, Arbitrum, Optimism, and more. Requires ZAPPER_API_KEY.
Interact with Solana blockchain via Helius APIs. Create/manage wallets, check balances (SOL + tokens), send transactions, swap tokens via Jupiter, and monitor addresses. Use for any Solana blockchain operation, crypto wallet management, token transfers, DeFi swaps, or portfolio tracking.