ChainSolana·CustodyNon-Custodial·SettlementOn-Chain·Routingeco · auto · premium·Settle< 400ms
GITHUB ↗
Surface: DocumentationVersion: v2.0

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.

Quick start
1. Connect walletPhantom, Backpack, or any Solana wallet
2. Deposit USDCFunds go to PDA escrow — not ClawFarm
3. Select modeeco (cheap) / auto (balanced) / premium (best)
4. Send requestsSDK routes to optimal Provider automatically
5. View usageEvery call: provider, model, tokens, cost, tx hash
6. WithdrawAnytime — no lock-up, no approval

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.

ecoLowest cost per token — cheapest qualified Provider
autoBalanced — cost × quality × latency weighted
premiumHighest-tier model — maximum quality
Routing input signals
Prompt lengthFilters by context window support
Tool callsRequires function-calling capable models
Deep thinkingRoutes to reasoning models (o1, Claude thinking)
Model preferenceOptional whitelist/blacklist

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.

Node.js / Bun / Deno
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.

Registration requirements
EndpointHTTPS inference API
ModelsSupported model IDs + per-token pricing
StakeMinimum 1,000 $CLAF
WalletSolana address for settlement
Dual-sigMust sign usage proofs per response
Provider SDK commands
registerRegister on-chain (instant, no approval)
statusView node state, uptime, Q score
update-pricingUpdate your price table on-chain
earningsView USDC revenue + $CLAF rewards + vesting
unstakeBegin unstaking (7-day period)

ClawFarm uses a 4-layer hybrid verification model:

Layer 1Client-side token counting (deterministic tokenizer)
Layer 2Dual signature (user + provider must agree)
Layer 3Sampling audit (random re-execution)
Layer 4Stake slashing (on-chain dispute resolution)

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.

How it works
Distribution30% of daily $CLAF emission
EligibilityProportional to verified USDC tokens spent
TrackingCalculated per Epoch based on Settlement Ledger
ClaimingAutomatic release to your protocol wallet

ClawFarm emissions are driven by verified network activity, not by inflation-based speculation.

Daily $CLAF Distribution
Supply-Side (70%)Earned by Providers based on Usage, Price, and Quality
Demand-Side (30%)Earned by Consumers (Builders/Users) based on Token Consumption
Treasury Mandate (3% Fee)
70% Buyback & BurnPeriodic USDC market buybacks to deflate $CLAF supply
20% Core MaintenanceSecurity audits, bug bounties, and protocol R&D
10% Infra ResilienceMirror nodes and decentralized UI hosting (IPFS/Arweave)

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.

Host your own mirror

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.