Docs
User guide, Provider setup, routing modes, SDK reference, and protocol behavior.
Getting Started
ClawFarm is a non-custodial AI compute marketplace. Connect your wallet, deposit USDC, and access all Providers.
The routing engine is open-source and runs client-side. It reads the on-chain Provider Registry to select the best match for each request.
Integrate decentralized AI in minutes.
The ClawFarm SDK handles routing, token counting, and dual-signature verification. By using the SDK, your app automatically participates in **Usage Mining**, earning $CLAF rewards proportional to your token consumption.
import { ClawFarm } from '@clawfarm/sdk'
// 1. Initialize with your Solana wallet
const cf = new ClawFarm({
wallet: process.env.SOLANA_PRIVATE_KEY,
rpc: 'https://api.mainnet-beta.solana.com'
})
// 2. Deposit USDC into the Escrow PDA (One-time or periodic)
await cf.deposit({ amount: 100 }) // 100 USDC
// 3. Perform Inference (Protocol handles routing and settlement)
const response = await cf.chat({
mode: 'auto', // eco | auto | premium
messages: [{ role: 'user', content: 'Design a DePIN protocol' }],
model: 'gpt-4o' // Optional: force specific model
})
// 4. Access usage details and proof
console.log('Provider:', response.provider)
console.log('Cost:', response.cost, 'USDC')
console.log('Tx:', response.txHash) // On-chain settlement record
// 5. Check your accumulated Usage Mining rewards
const rewards = await cf.getRewards()
console.log('Accumulated $CLAF:', rewards.total)Provider Node Setup
Any endpoint that serves AI inference and supports dual-signature verification can register as a Provider.
ClawFarm uses a 4-layer hybrid verification model:
Earn 30% of Daily Emissions
ClawFarm rewards demand. Every time you or your users consume AI tokens through the protocol, you earn **Usage Mining** rewards in $CLAF. This effectively lowers your compute costs to near-zero as the network grows.
ClawFarm emissions are driven by verified network activity, not by inflation-based speculation.
Mirroring the Interface
ClawFarm is a decentralized protocol. The interface is a pure client-side application that communicates directly with the Solana blockchain. It does not depend on any centralized backend.
In the spirit of true decentralization, we encourage the community to host their own mirrors of this UI. If the primary domain ever goes down, the protocol remains fully accessible through community mirrors or local instances.
# 1. Clone the repository git clone https://github.com/rogerwu188/clawfarm-site # 2. Official IPFS Mirror (v2.0) # CID: Qmcq5NvjVqcpqSt3xA1ebrDmyXA8TgS9goPauocc5LPjh6 # https://ipfs.io/ipfs/Qmcq5NvjVqcpqSt3xA1ebrDmyXA8TgS9goPauocc5LPjh6/ # 3. Install dependencies npm install # 3. Build & Export (Pure Static) npm run build # 4. Deploy anywhere # The 'out/' directory contains the full standalone UI. # Upload to IPFS, Arweave, GitHub Pages, or your own server.
Settlement Ledger
user, provider, model, input_tokens, output_tokens, cost_usdc, provider_payout, treasury_tax, tx_hash
Reward Ledger
provider, epoch, W_i, reward_claf, cashback_claf, vesting_start
Treasury Ledger
epoch, tax_usdc, buyback_usdc, claf_burned, tx_hash
All ledger entries are on-chain and append-only. Settlement derived exclusively from dual-signed usage proofs.