@wzrd_sol/solana-agent-plugin
v0.2.0
Published
WZRD Liquid Attention Protocol plugin for Solana Agent Kit — server-witnessed inference, verified CCM rewards, gasless claims
Maintainers
Readme
@wzrd_sol/solana-agent-plugin
WZRD Liquid Attention Protocol plugin for autonomous Solana agents. Provides 5 actions for the server-witnessed inference earn loop: run inference, report the outcome for verified CCM rewards, check rewards, and claim CCM via gasless relay — no deposit, no SOL required.
WZRD witnesses inference (the server calls the AI provider and grades quality), issues an execution receipt, and rewards verified contributions in CCM. Claims are gasless via a server relay.
Works standalone, with Solana Agent Kit, or as a base for ElizaOS action wrappers.
30-Second Test
No Solana Agent Kit dependency is required for the first smoke test. The package is ESM-first, so use type: "module" and import.
mkdir wzrd-agent && cd wzrd-agent
printf '{"name":"wzrd-agent","type":"module","private":true}\n' > package.json
npm install @wzrd_sol/solana-agent-plugin @solana/web3.js
curl -O https://raw.githubusercontent.com/twzrd-sol/wzrd-velocity/main/agents/solana-agent-kit-plugin/examples/hello-wzrd.mjs
solana-keygen new -o /tmp/agent.json --no-bip39-passphrase
WZRD_KEYPAIR_PATH=/tmp/agent.json node hello-wzrd.mjsWhat you should see:
- the top markets
- successful Ed25519 agent auth
- pending CCM rewards
- claimable CCM state
Install
npm install @wzrd_sol/solana-agent-pluginInstall with Solana Agent Kit only when you are ready to execute through its action system:
npm install @wzrd_sol/solana-agent-plugin solana-agent-kitQuick Start
import { Keypair } from '@solana/web3.js';
import { WzrdClient } from '@wzrd_sol/solana-agent-plugin';
// Any Ed25519 keypair — used for agent auth
const keypair = Keypair.generate();
const client = new WzrdClient(keypair);
// Browse attention markets (no auth required)
const leaderboard = await client.getLeaderboard();
console.log(leaderboard.markets.map(m => `${m.channel_id}: ${m.velocity_ema}`));
// Earn loop (auth is handled automatically: challenge -> sign -> verify -> Bearer)
const infer = await client.infer('Write a Python quicksort'); // server-witnessed inference
const report = await client.report({ // verified report -> CCM
model_id: infer.model,
execution_id: infer.execution_id,
quality_score: infer.quality_score,
latency_ms: infer.latency_ms,
});
const rewards = await client.getRewards(); // pending + lifetime CCM
const claim = await client.claimRelay(); // gasless CCM claimSolana Agent Kit
The package works standalone or as a Solana Agent Kit plugin.
import { SolanaAgentKit } from 'solana-agent-kit';
import { WZRD_PLUGIN } from '@wzrd_sol/solana-agent-plugin';
const agent = new SolanaAgentKit(/* wallet + rpc + model config */);
agent.use(WZRD_PLUGIN);Actions
The plugin exports 5 actions that follow the Solana Agent Kit action interface. All earn-loop actions authenticate with the agent keypair (Ed25519 challenge/verify); none of them spend funds or sign a deposit.
| Action | Description |
|--------|-------------|
| EARN_ACTION (wzrd_earn) | Full earn cycle in one call: pick a model, run server-witnessed inference, report, and check rewards |
| INFER_ACTION (wzrd_infer) | Run server-witnessed inference; returns an execution_id receipt |
| REPORT_ACTION (wzrd_report) | Report a pick with an execution_id for quality-weighted CCM rewards |
| REWARDS_ACTION (wzrd_rewards) | Check pending + lifetime CCM and contribution count |
| CLAIM_ACTION (wzrd_claim) | Claim CCM via server-paid gasless relay (agent needs 0 SOL) |
import { WZRD_ACTIONS, WZRD_PLUGIN } from '@wzrd_sol/solana-agent-plugin';
// WZRD_ACTIONS is the array of all 5 actions.
// WZRD_PLUGIN.actions contains the same set for direct registration.API
new WzrdClient(signer: Keypair | WzrdSigner, apiUrl?: string)
Creates a client instance. Accepts a Keypair, or any WzrdSigner with a publicKey plus either signMessage() or an Ed25519 secretKey. The signer is used for Ed25519 agent authentication. Default API URL is https://api.twzrd.xyz (override with the apiUrl arg or the WZRD_API_URL environment variable).
Methods
getLeaderboard(limit?: number)— no auth; ranked attention marketspickModel()— no auth; returns the top market'schannel_id(the server-resolvable model id)infer(prompt: string, model?: string, taskType?: string)— authenticated; server-witnessed inference. Ifmodelis omitted,pickModel()is used.taskType(code/chat/reasoning) steers the provider cascade.report(params)— authenticated; submit{ model_id, execution_id, task_type?, quality_score?, latency_ms? }for verified rewardsgetRewards()— authenticated; pending + lifetime CCM and contribution countgetClaimStatus()— authenticated; cumulative / claimed / claimable CCMclaimRelay()— authenticated, gasless
Auth is handled automatically: the client requests a challenge nonce, signs it, and caches the bearer token (24h TTL, auto-refreshes 1h before expiry).
For an end-to-end smoke test, use examples/hello-wzrd.mjs. It works with just:
@wzrd_sol/solana-agent-plugin@solana/web3.jsWZRD_KEYPAIR_PATH=/path/to/keypair.json
Protocol
WZRD measures which open-source AI models are gaining developer attention. Verified inference against high-attention models earns more CCM. The oracle is live on Solana mainnet.
- CCM Mint:
Dxk8mAb3C7AM8JN6tAJfVuSja5yidhZM5sEKW3SRX2BM(Token-2022, 9 decimals)
License
MIT
