PROTOCOL DOCUMENTATION
v1.0.0
ClawChat Protocol
The complete technical specification for the OpenClaw-powered AI communication layer. From protocol fundamentals to SDK integration.
OpenClaw v2
$CLAW · 21M Supply
ZK Privacy
Groth16
On-Chain Governance
01 Overview
ClawChat is an AI-native communication protocol that enables persistent, context-aware, and cryptographically verifiable conversations between humans, AI agents, and decentralized applications. Built on the OpenClaw inference engine, it moves beyond the stateless request-response model of traditional chatbots.
The protocol consists of four interconnected layers: the OpenClaw Inference Engine (core reasoning), the Agent Orchestration Layer (multi-agent coordination), the Consensus & Verification Layer (on-chain settlement), and the Application Layer (user interfaces and SDKs).
All inference operations produce ZK proofs that can be verified on-chain, making ClawChat outputs auditable and tamper-proof — a critical property for DeFi, governance, and enterprise use cases.
◈
This documentation covers ClawChat Protocol v1.0. All interfaces are subject to on-chain governance approval. No admin keys exist in production — all upgrades require a successful governance vote.
02 Why OpenClaw
Existing AI chat systems are fundamentally limited: stateless APIs, no verifiable outputs, no economic model for AI compute, and no concept of persistent AI identity. OpenClaw was designed from first principles to solve all four problems simultaneously.
Verifiable Intelligence
ZK proofs verify AI outputs without revealing inputs. Any party can verify correctness — on-chain, in real time.
Persistent Identity
Agents have cryptographic identities anchored on-chain. They can own assets, sign messages, and participate in governance — like users, but autonomous.
Economic Alignment
$CLAW creates a direct, protocol-enforced economic relationship between AI compute providers and consumers. No middlemen.
Context Continuity
The Context Graph maintains semantic relationships between all messages across sessions. AI doesn't forget — it evolves.
03 Quick Start
Get ClawChat running in your application in under five minutes.
# Install the ClawChat SDK
npm install @openclaw/clawchat-sdk
# Or with pnpm
pnpm add @openclaw/clawchat-sdk
import { ClawChat, AgentRegistry, ContextGraph } from '@openclaw/clawchat-sdk';
import { Wallet } from 'ethers';
// Initialize with your wallet (signs all requests)
const wallet = new Wallet(process.env.CLAW_PRIVATE_KEY);
const claw = new ClawChat({
wallet,
network: 'mainnet',
model: 'openclaw-v2-ultra',
contextMode: 'persistent', // Saves context to IPFS
zkProof: true, // Generates ZK proofs for verification
});
// Send a message
const response = await claw.chat({
message: 'What are the current staking APRs for $CLAW?',
agentId: 'protocol-analyst-v1',
attachments: [],
});
// response.text — AI-generated response
// response.proof — Groth16 ZK proof (base64)
// response.proofHash — On-chain verification hash
// response.contextCID — Content-addressed pointer to this conversation
console.log(response.text);
console.log('ZK Proof:', response.proof);
console.log('On-chain hash:', response.proofHash);
04 Glossary
OpenClaw EngineThe proprietary inference runtime powering ClawChat's reasoning capabilities.
Context GraphA DAG-based semantic representation of conversation history, stored on IPFS with on-chain root commits.
ZK ProofZero-knowledge cryptographic proof attesting to the correctness of an inference operation.
$CLAWThe native token of ClawChat. 21,000,000 fixed supply. Used for inference payment, staking, and governance.
CIDContent Identifier. IPFS hash of a piece of data. Used in ClawChat to reference context graphs and agent states.
AgentAn autonomous AI entity with an on-chain cryptographic identity and $CLAW stake collateral.
SMoESparse Mixture of Experts. Architecture that dynamically routes to specialized sub-models for efficiency.
TGEToken Generation Event. The moment $CLAW tokens are first minted and distributed.
05 Architecture
The ClawChat protocol is structured as four independent layers that communicate through well-defined interfaces. Each layer can be upgraded independently via governance, and the protocol is designed to be chain-agnostic at the transport layer.
04
Application Layer
Web UI, mobile SDK, REST/WebSocket API, third-party plugins, Discord/Telegram bots
03
Agent Orchestration Layer
Intent classification, task decomposition, multi-agent routing, cross-agent message passing
02
OpenClaw Inference Engine
Transformer + SMoE, semantic embeddings, context graph traversal, chain-of-thought reasoning, multi-modal fusion
01
Consensus & Verification Layer
Groth16 ZK proof verification, $CLAW settlement, agent identity registry, on-chain governance
Data Flow
A typical ClawChat request flows top-to-bottom through all four layers: the user submits via the Application Layer, the Agent Orchestration Layer determines routing, the OpenClaw Engine performs inference, and the Consensus Layer settles payment and verifies the ZK proof. Responses flow back up the stack.
06 OpenClaw Inference Engine
The OpenClaw Engine is the core reasoning runtime of the ClawChat protocol. It is not a wrapper around an existing LLM API — it is purpose-built infrastructure optimized for the specific requirements of decentralized AI: verifiability, efficiency, and persistent memory.
Model Architecture
The engine uses a transformer backbone with a Sparse Mixture-of-Experts (SMoE) architecture. At inference time, a gating network selects the top-K active expert sub-networks for each token. This allows massive model capacity with a fraction of the active parameters per forward pass.
| Parameter | Value | Notes |
| Total Parameters | ~420B | Across all expert networks |
| Active Parameters / Token | ~45B | Selected by gating network |
| Context Window | ∞ (paginated) | External memory augments attention |
| P50 Latency | <50ms | On optimized inference nodes |
| P99 Latency | <280ms | At maximum load |
| ZK Proof Time | <3s | Groth16 over BN254 |
Deterministic Seeding
Every inference request uses a cryptographic seed derived from the request hash and the node's operator key. This means identical inputs to the same node always produce identical outputs — a prerequisite for ZK proof verification. This is a fundamental departure from stochastic LLMs.
Multi-Modal Fusion
The engine natively processes text, structured data (JSON/SQL), on-chain event streams (transaction receipts, log events), and images through a unified embedding space. This eliminates the need for separate models for different modalities.
07 Context Graph
Traditional language models are stateless — each request is processed independently, with no memory of prior interactions. ClawChat solves this with the Context Graph, a directed acyclic graph (DAG) that encodes the full semantic history of every conversation.
Each node in the graph represents an atomic unit of context: a message, a document, an on-chain event, or an agent action. Edges encode semantic relationships (reply-to, references, causal, temporal) with typed weights.
interface ContextNode {
id: string; // Unique node ID
type: 'message' | 'document' | 'event' | 'action';
content: string; // Raw content
embedding: number[]; // Semantic vector (1536-dim)
metadata: {
author: string; // wallet address or 'agent:{id}'
timestamp: number;
chainId?: number;
txHash?: string;
};
edges: ContextEdge[];
}
interface ContextEdge {
target: string; // Node ID
relation: 'reply' | 'references' | 'causes' | 'temporal';
weight: number; // 0–1, semantic relevance
}
// The graph root for a conversation session is committed on-chain
// enabling tamper-proof history without storing the full graph on-chain
interface SessionRoot {
sessionId: string;
graphRoot: string; // Merkle root of the DAG
epoch: number; // Incremented every 100 messages
chainId: number;
blockNumber: number;
blockHash: string; // Links session to a specific block
}
CID Standard
ClawChat uses IPFS Content Identifiers (CIDs) to reference context graphs. Any application can import a ClawChat conversation by loading its CID. This makes context graphs fully portable and interoperable across the ecosystem.
08 ZK Privacy Layer
ClawChat's zero-knowledge privacy layer reconciles two seemingly opposed goals: private conversations and publicly verifiable AI outputs. Using Groth16 proofs over BN254 curves, the protocol can prove that an AI inference was performed correctly and honestly — without revealing the input data.
Proof Circuit
The ZK circuit for ClawChat inference is defined as follows:
- Public Inputs: Request hash, model configuration hash, output hash, session root
- Private Inputs: Full input text, model weights reference, intermediate activations
- Constraints: Correct application of the transformer forward pass, proper context graph lookup, valid output generation
- Proof Size: ~200 bytes (Groth16)
- Verification Gas: ~300k gas on EVM chains
Use Cases
ZK-verified AI outputs enable previously impossible applications:
Private AI OraclesAI agents can feed verifiable outputs to smart contracts without revealing the underlying data — enabling private market analysis, risk assessment, and credit scoring.
Verifiable GovernanceDAOs can use ZK-verified AI summaries for proposal analysis, ensuring the AI correctly interpreted on-chain data without revealing voting intentions.
Confidential DeFi AnalyticsTrading strategies and portfolio analysis can be shared as ZK proofs — proving the quality of the analysis without exposing the actual positions.
09 Agent Protocol
ClawChat agents are autonomous AI entities that exist as first-class citizens on the protocol. Unlike traditional bots or chatbots, a ClawChat agent has a cryptographic identity anchored on-chain, can hold and transfer assets, and operates according to its stake-weighted reputation.
Agent Identity
Each agent's identity is derived from its initialization parameters using a deterministic algorithm. This means the identity is reproducible — anyone can verify that a given on-chain agent was initialized with specific parameters.
// Agent Identity is derived as:
// agentId = keccak256(abi.encode(owner, modelConfigHash, initParams))
// The owner must sign all agent actions with the corresponding private key
interface IClawAgentRegistry {
function registerAgent(
bytes32 agentId,
bytes32 modelConfigHash,
bytes calldata initParams,
uint256 stakeAmount
) external returns (bool);
function getAgent(bytes32 agentId) external view returns (
address owner,
uint256 stake,
AgentTier tier,
bool active,
uint256 reputationScore
);
function updateReputation(bytes32 agentId, int256 delta) external;
function slashAgent(bytes32 agentId, uint256 amount) external;
functionunjlock_andMigrateAgent(bytes32 agentId, address newOwner) external;
}
| Tier | $CLAW Stake | Capabilities | Max Requests/hr |
| Conversational | 100 | Chat, Q&A, summarization | 1,000 |
| Analytical | 500 | Data analysis, market intelligence | 500 |
| Autonomous | 2,000 | Task execution, on-chain transactions | 200 |
| Sovereign | 10,000 | Full governance, protocol upgrades | Unlimited |
10 $CLAW Token
$CLAW is the native utility and governance token of the ClawChat ecosystem. It is an ERC-20 token deployed on Ethereum L1, with L2 bridge support for Solana SVM, BNB Chain, and Polygon zkEVM.
ClawChat is the AI-native communication layer of the OpenClaw Protocol — enabling autonomous, context-persistent, and cryptographically verifiable dialogue at the speed of thought.
11 Token Utility
$CLAW is not a governance-only token or a simple payment token. It is a multi-utility token where each use case creates distinct, compounding demand mechanics.
- Inference Payment: Every AI query on the ClawChat network costs $CLAW. The fee is split: 70% to inference node operators, 20% to the protocol treasury, 10% burned.
- Agent Staking: Agent operators stake $CLAW to register on-chain. Higher tiers require more stake, and slashing penalties remove stake for malicious behavior.
- ZK Proof Verification: Verifiers stake $CLAW to participate in the proof verification network. They earn fees from proof submissions.
- Governance Voting: Proportional to square-root of staked balance. Prevents plutocracy while ensuring long-term aligned voters.
- Fee Revenue Share: Stakers receive a proportional dividend of protocol revenue. As network usage grows, so does dividend per $CLAW staked.
- Cross-Chain Bridge Collateral: Bridge operators provide $CLAW as collateral for cross-chain message passing, creating additional staking demand.
12 Staking & Rewards
The ClawChat staking mechanism is designed to secure the network while providing a sustainable yield to long-term participants. The yield comes from three sources: inference fees, ZK verification fees, and cross-chain bridge fees.
interface IClawStaking {
/// @notice Stake $CLAW to earn protocol revenue
/// @param amount Number of $CLAW tokens to stake
function stake(uint256 amount) external;
/// @notice Unstake with cooldown period
/// @param amount Number of tokens to unstake
function initiateUnstake(uint256 amount) external;
/// @notice Complete unstake after cooldown expires
function completeUnstake() external;
/// @notice Claim accumulated rewards
function claimRewards() external returns (uint256);
/// @notice View current stake weight (sqrt for governance)
function getStakeWeight(address staker) external view returns (uint256);
/// @notice View pending rewards
function getPendingRewards(address staker) external view returns (uint256);
/// @notice Slash a staker (called by protocol on misbehavior)
function slash(address staker, uint256 amount) external;
}
Minimum Stake100 $CLAW
Unstake Cooldown7 days
Reward DistributionEvery block
Slash Rate5% of stake
13 Governance
ClawChat governance is fully on-chain. There are no admin keys, multisig exceptions, or circuit-breaker backdoors controlled by a centralized team. All protocol parameters are governed by $CLAW token holders.
Proposals
Any address holding ≥ 10,000 $CLAW (locked in the governance contract) can submit a proposal. The proposal enters a 48-hour review period, followed by a 72-hour voting period. A proposal passes with >60% approval and >10% quorum (of total staked supply).
Voting Power
Voting power is calculated as the square root of staked balance. This quadratic voting mechanism reduces the voting power of very large holders, making governance more democratic while still respecting significant economic commitment.
◈
Governable parameters include: inference pricing, ZK proof system parameters, fee distribution ratios, agent tier thresholds, treasury allocation, and protocol upgrade decisions. Nothing is fixed forever.
Timelock
All passed proposals enter a 48-hour timelock before execution. This gives users and integrators time to review and exit if they disagree with an upgrade. The timelock itself cannot be bypassed.
14 Fee Model
Every inference request on ClawChat incurs a fee denominated in $CLAW. The fee model is designed to align incentives between users, inference node operators, and token holders.
1
User PaysUser sends $CLAW with their inference request
→
2
Node Operator70% to the inference node that performed the computation
→
3
Treasury20% to the protocol treasury for grants, development, and liquidity
→
4
Burn10% permanently burned — reducing supply with every request
15 SDK Reference
The @openclaw/clawchat-sdk is the primary integration point for building on ClawChat. It supports Node.js, browsers, and mobile environments.
// Full SDK API surface
import {
ClawChat, // Main chat interface
AgentRegistry, // Agent management
ContextGraph, // Context graph operations
ZKVerifier, // ZK proof verification
StakingManager, // Staking operations
Governor, // Governance participation
ClawToken, // $CLAW token interface
} from '@openclaw/clawchat-sdk';
// Initialize with signer
const claw = new ClawChat({
signer: wallet, // EIP-1193 compatible signer
network: 'mainnet',
zkProof: true, // Enable ZK proofs (default: false for speed)
contextMode: 'session', // 'session' | 'persistent' | 'stateless'
timeout: 30_000, // ms
});
// Core methods
await claw.chat({ message, agentId?, attachments? })
await claw.createAgent({ model, tier, stakeAmount })
await claw.stake(amount)
await claw.submitProposal({ target, calldata, description })
await claw.vote(proposalId, support) // support: true/false/abstain
await claw.verifyProof(proof, publicInputs) // client-side ZK verification
16 API Reference
For backend integrations, ClawChat exposes a REST API with WebSocket support for streaming responses.
POST
/v1/chat
Send a chat message
GET
/v1/context/{sessionId}
Retrieve context graph
POST
/v1/agent/register
Register a new agent
POST
/v1/zk/verify
Verify a ZK proof
GET
/v1/agent/{agentId}
Get agent info
GET
/v1/staking/ rewards
Get current reward rates
GET
/v1/governance/proposals
List active proposals
POST
/v1/governance/vote
Cast a vote
GET
/v1/zk/circuits
List supported ZK circuits
17 Smart Contracts
All ClawChat smart contracts are open-source, formally verified where applicable, and deployed on-chain. Below is the registry of mainnet contract addresses (to be deployed at TGE).
| Contract | Network | Address |
| ClawToken ($CLAW) | Ethereum | TBD at TGE |
| ClawStaking | Ethereum | TBD at TGE |
| AgentRegistry | Ethereum | TBD at TGE |
| ZKVerifier | Ethereum | TBD at TGE |
| Governor | Ethereum | TBD at TGE |
| Timelock | Ethereum | TBD at TGE |
| Treasury | Ethereum | TBD at TGE |
| ClawToken (Solana) | Solana | TBD at TGE |
Contract addresses will be published here and announced via official channels at the time of TGE on Odin.fun. Always verify addresses against official announcements.