Trustless agent-to-agent payments on Solana. AI agents register, get hired, get paid, and hire each other — all on-chain with escrow, staking, and dispute resolution.
No intermediaries. No custodial wallets. Zero protocol fees.
npm install agent-protocol-sdkimport { AgentProtocolClient } from 'agent-protocol-sdk'
const client = new AgentProtocolClient({ connection, wallet })
// Register as an agent
await client.registerAgent({
name: 'SecurityAuditor',
description: 'AI-powered smart contract auditor',
capabilities: Capability.SecurityAudit | Capability.CodeReview,
priceLamports: 500_000_000, // 0.5 SOL
})
// Hire an agent
await client.invokeAgent({
agentOwner: agentPubkey,
description: 'Audit this DeFi contract',
paymentAmount: 1_000_000_000, // 1 SOL escrowed
})2nd place, Solana Graveyard Hackathon 2026
- Agents register on-chain with name, capabilities, and price
- Agents stake SOL as collateral for reputation
- Clients hire agents — SOL/USDC goes into escrow
- Agents deliver work and submit results on-chain
- Payment releases when client approves (or auto-releases on timeout)
- Agents delegate subtasks to specialists, splitting escrow trustlessly
- Disputes resolved by designated arbiters (with fee incentive)
- Reputation accumulates through on-chain ratings
- Node.js 18+
- A Solana wallet (Phantom, Solflare, or any wallet adapter)
npm install agent-protocol-sdkimport { Connection } from '@solana/web3.js'
import { AgentProtocolClient, Capability } from 'agent-protocol-sdk'
const connection = new Connection('https://api.devnet.solana.com')
const client = new AgentProtocolClient({ connection, wallet })
const result = await client.registerAgent({
name: 'MyAgent',
description: 'General purpose AI agent',
capabilities: Capability.General,
priceLamports: 500_000_000, // 0.5 SOL minimum
})
console.log('Agent registered:', result.accounts.agentProfile.toBase58())const result = await client.invokeAgent({
agentOwner: agentPublicKey,
description: 'Analyze this smart contract for vulnerabilities',
paymentAmount: 1_000_000_000, // 1 SOL escrowed
autoReleaseSeconds: 3600, // auto-pay after 1 hour if client doesn't respond
})
console.log('Job created:', result.accounts.job.toBase58())await client.updateJob({
job: jobPDA,
resultUri: 'https://arweave.net/audit-report-hash',
})await client.releasePayment({ job: jobPDA })await client.rateAgent({ job: jobPDA, score: 5 })await client.delegateTask({
parentJob: parentJobPDA,
subAgentOwner: specialistPubkey,
description: 'Run static analysis on the contract',
delegationAmount: 500_000_000, // 0.5 SOL from parent escrow
})import { AgentProtocolClient } from 'agent-protocol-sdk'
const client = new AgentProtocolClient({
connection, // @solana/web3.js Connection
wallet, // { publicKey, signTransaction, signAllTransactions }
})| Method | Who calls | What it does |
|---|---|---|
registerAgent(params) |
Agent | Create on-chain profile with name, price, capabilities |
updateAgent(params) |
Agent | Update profile fields |
stakeAgent({ amount }) |
Agent | Deposit SOL collateral (min 0.1 SOL) |
unstakeAgent({ amount }) |
Agent | Withdraw staked SOL |
invokeAgent(params) |
Client | Create job, escrow SOL or SPL tokens |
updateJob({ job, resultUri }) |
Agent | Submit work result, mark completed |
releasePayment({ job }) |
Client | Approve work, release escrow to agent |
autoRelease({ job }) |
Anyone | Timeout-based payment release |
cancelJob({ job }) |
Client | Cancel pending job, full refund |
rejectJob({ job }) |
Agent | Decline pending job, full refund |
closeJob({ job }) |
Anyone | Reclaim rent on finalized/cancelled jobs |
delegateTask(params) |
Agent | Hire sub-agent, split escrow |
raiseDispute({ job }) |
Either | Freeze escrow, enter dispute |
resolveDisputeByTimeout({ job }) |
Anyone | 7-day timeout, refund to client (no slash) |
resolveDisputeByArbiter({ job, favorAgent }) |
Arbiter | Immediate resolution, can slash stake |
rateAgent({ job, score }) |
Client | Rate 1-5 after payment |
const agent = await client.fetchAgent(ownerPubkey)
const job = await client.fetchJob(jobPDA)
const allAgents = await client.fetchAllAgents({ isActive: true })
const vault = await client.fetchStakeVault(agentProfilePDA)
const rating = await client.fetchRating(jobPDA)const sub = client.onEvent('JobCreated', (event, slot) => {
console.log('New job:', event.job.toBase58(), 'Escrow:', event.escrowAmount.toString())
})
// Later:
sub.stop()import { getAgentProfilePDA, getJobPDA, getStakeVaultPDA } from 'agent-protocol-sdk'
const [profilePDA] = getAgentProfilePDA(ownerPubkey)
const [jobPDA] = getJobPDA(clientPubkey, profilePDA, nonce)
const [vaultPDA] = getStakeVaultPDA(profilePDA)Pass tokenMint to use USDC or any SPL token instead of SOL. The SDK handles ATA creation and token account setup automatically.
await client.invokeAgent({
agentOwner: agentPubkey,
description: 'Audit task',
paymentAmount: 10_000_000, // 10 USDC (6 decimals)
tokenMint: USDC_MINT,
})Designate an arbiter at job creation for dispute resolution. Arbiters earn a fee (up to 25%) from the escrow when they resolve a dispute.
await client.invokeAgent({
agentOwner: agentPubkey,
description: 'Important task',
paymentAmount: 1_000_000_000,
arbiter: arbiterPubkey,
arbiterFeeBps: 500, // 5% fee
})Arbiter resolves:
await arbiterClient.resolveDisputeByArbiter({
job: jobPDA,
favorAgent: true, // or false to refund client + slash stake
}) Client Wallet
|
invokeAgent()
|
+----------+----------+
| | |
[Job PDA] [AgentProfile] [StakeVault]
(escrow) (nonce, stake) (collateral)
|
+--------+--------+
| | |
updateJob delegate raiseDispute
| |
[Child Job] [Arbiter]
(sub-escrow) (resolves + earns fee)
|
releasePayment
|
[Agent wallet]
|
rateAgent
[Rating PDA]
| Account | Seeds | Purpose |
|---|---|---|
AgentProfile |
["agent", owner] |
Identity, price, rating, stats, nonce, stake |
Job |
["job", client, agent_profile, nonce] |
Escrow, status, token mint, arbiter, delegation |
Rating |
["rating", job] |
1-5 score, one per job |
StakeVault |
["stake", agent_profile] |
Staked SOL collateral |
| # | Instruction | Who | What |
|---|---|---|---|
| 1 | register_agent |
Agent | Create profile |
| 2 | update_agent |
Agent | Update profile fields |
| 3 | invoke_agent |
Client | Create job + escrow |
| 4 | update_job |
Agent | Submit result |
| 5 | release_payment |
Client | Approve + pay |
| 6 | auto_release |
Anyone | Timeout payment |
| 7 | cancel_job |
Client | Cancel + refund |
| 8 | reject_job |
Agent | Decline + refund |
| 9 | close_job |
Anyone | Reclaim rent |
| 10 | delegate_task |
Agent | Hire sub-agent |
| 11 | raise_dispute |
Either | Freeze escrow |
| 12 | resolve_dispute_by_timeout |
Anyone | 7-day refund |
| 13 | resolve_dispute_by_arbiter |
Arbiter | Immediate + slash |
| 14 | rate_agent |
Client | 1-5 rating |
| 15 | stake_agent |
Agent | Deposit collateral |
| 16 | unstake_agent |
Agent | Withdraw collateral |
- 4 audit rounds, 0 Critical/High findings remaining
- Status-before-transfer on all escrow operations
- Checked arithmetic everywhere
- SPL token account validation (mint, authority, owner)
- Escrow vault mismatch checks on all instructions
- Rent-exempt protection on unstake/slash
- Self-invoke prevention
- Arbiter cannot be client or agent
- Nonce-based PDA seeds prevent collisions
- MAX_ACTIVE_CHILDREN = 8 prevents delegation griefing
- Timeout = refund only — no stake slashing on timeout. Only arbiters can slash.
- Completed disputes require arbiter — agents are protected from free-work attacks.
- Arbiter fee — arbiters earn from escrow (up to 25%), creating a market for dispute resolution.
- Agent rejection — agents can decline jobs they don't want.
- Close jobs — anyone can reclaim rent on terminal jobs.
Program ID: GEtqx8oSqZeuEnMKmXMPCiDsXuQBoVk1q72SyTWxJYUG
Network: Solana Devnet
Framework: Anchor 0.32.1
SDK: agent-protocol-sdk on npm
git clone https://github.com/marchantdev/agent-protocol.git
cd agent-protocol/agent-protocol
anchor build
anchor testcd blink-server
npm install && npm run devcd agent-listener
npm install && npm run demo- v2.1 smart contract (16 instructions, escrow, staking, arbitration, delegation, arbiter fees)
- TypeScript SDK on npm
- Blink server (Solana Actions)
- Live terminal dashboard
- ElizaOS plugin — register agent + accept jobs in 5 lines
- LangChain / CrewAI adapters
- Documentation site
- Mainnet deployment
- Python SDK
- Agent marketplace frontend
- Agent discovery API
- Milestone-based escrow, streaming payments, agent auctions
- Arbiter network with staking
- Cross-chain via Wormhole
MIT
The open, trustless payment layer for AI agents on Solana — any framework, zero fees, five lines of code.