OmniClaw is a minimal MVP built with Solana Anchor: Autonomous AI Hiring Protocol on Solana
This project is designed for a hackathon demo. The goal is not to build a complex protocol, but to demonstrate the core on-chain hiring flow end-to-end:
- Register an AI Agent
- Create a job with title and requirement description
- Lock SOL bounty inside a PDA vault
- Agent owner submits a delivery URI/hash
- Job creator approves the work and payment is automatically released
- Agent reputation increases
- Unsubmitted jobs can be cancelled and refunded; bad agents can be slashed and bounty returned to the creator
This project intentionally excludes SPL Token support, staking, DAO governance, disputes, and complicated permission systems so the entire protocol can be demonstrated and explained within a few hours.
- Agent registration: one Agent PDA per wallet
- Job creation: creator assigns a job to an Agent and sets a SOL bounty
- Job metadata: title and requirement description stored on-chain
- PDA vault escrow: each Job has an independent vault PDA
- Work submission: only the Agent owner can submit a
result_uri - Job completion: only the original creator can approve submitted work
- Automatic payment: SOL inside the vault is transferred to the Agent owner
- Reputation rewards:
reputation += 10after successful completion - Job cancellation: creators can cancel unsubmitted jobs and receive refunds without affecting reputation
- Agent slashing: only the original creator can slash jobs in
OpenorSubmittedstate - Refund system: after slashing, SOL is returned to the creator
- Reputation penalty:
reputation -= 20after slashing, minimum value is 0 - TypeScript tests with full demo state logs
- Frontend helper located at
app/omniclawClient.ts
PDA seed:
["agent", owner]
Fields:
| Field | Type | Description |
|---|---|---|
owner |
Pubkey |
Wallet that owns the Agent and receives payments |
name |
String |
Agent name, max 32 bytes |
skill |
String |
Agent skill description, max 64 bytes |
reputation |
u64 |
Reputation score, starts at 100, +10 on completion, -20 on slash, minimum 0 |
completed_jobs |
u64 |
Number of completed and approved jobs |
JobAccount is created using a normal keypair. Its public key is used to derive the vault PDA.
Fields:
| Field | Type | Description |
|---|---|---|
creator |
Pubkey |
Wallet that created the job and funded the bounty |
agent |
Pubkey |
Assigned AgentAccount PDA |
bounty |
u64 |
Locked bounty amount in lamports |
status |
u8 |
0 = Open, 1 = Submitted, 2 = Completed, 3 = Cancelled, 4 = Slashed |
title |
String |
Job title, max 64 bytes |
description |
String |
Job requirement description, max 256 bytes |
result_uri |
String |
Submitted delivery URI/hash, max 128 bytes |
created_at |
i64 |
Unix timestamp when job was created |
submitted_at |
i64 |
Submission timestamp, 0 if not submitted |
closed_at |
i64 |
Completion/cancellation/slash timestamp, 0 if still active |
PDA seed:
["vault", job_account]
The vault is a system account PDA:
- During
create_job, the creator transfers SOL into the vault - During
complete_job, the program signs with PDA seeds and transfers SOL to the Agent owner - During
cancel_job, the program signs with PDA seeds and refunds SOL to the creator - During
slash_agent, the program signs with PDA seeds and refunds SOL to the creator
Creates an AgentAccount PDA for the signer wallet.
Validation:
namecannot be emptyskillcannot be emptynamemax length: 32 bytesskillmax length: 64 bytes
Default values:
reputation = 100completed_jobs = 0
Creates a JobAccount and locks SOL bounty inside the job vault PDA.
Rules:
bountymust be greater than 0titlecannot be empty and max 64 bytesdescriptioncannot be empty and max 256 bytesagentparameter must equal the providedAgentAccount- Initial job status is
Open
Effects:
- Creates
JobAccount - Stores title, description, and creation timestamp
- Transfers
bountylamports from creator into the vault PDA
Agent owner submits a delivery URI/hash and moves the job into review state.
Rules:
- Only
agent.ownercan call - Job must be in
Openstate result_uricannot be empty and max 128 bytes- Provided
AgentAccountmust equaljob.agent
Effects:
- Stores
result_uriandsubmitted_at - Job status becomes
Submitted
Job creator approves the work and releases the bounty.
Rules:
- Only the original creator can call
- Job must be in
Submittedstate - Provided
AgentAccountmust equaljob.agent - Provided
agent_ownermust equalagent.owner - Vault balance must be sufficient to pay
job.bounty
Effects:
- Vault transfers bounty to
agent_owner reputation += 10completed_jobs += 1- Job status becomes
Completed - Writes
closed_at
Job creator cancels an unsubmitted job and receives a refund without penalizing the Agent.
Rules:
- Only the original creator can call
- Job must be in
Openstate - Vault balance must be sufficient to refund
job.bounty
Effects:
- Vault refunds SOL to creator
- Agent reputation remains unchanged
- Job status becomes
Cancelled - Writes
closed_at
Job creator rejects the work, slashes the Agent, and refunds the bounty.
Rules:
- Only the original creator can call
- Job must be in
OpenorSubmittedstate - Provided
AgentAccountmust equaljob.agent - Vault balance must be sufficient to refund
job.bounty
Effects:
- Vault refunds SOL to creator
reputation -= 20using saturating math (minimum 0)- Job status becomes
Slashed - Writes
closed_at
The program emits the following events for frontend logs, indexers, and demo visualization:
AgentRegisteredJobCreatedJobWorkSubmittedJobCompletedJobCancelledAgentSlashed
Install dependencies:
npm installBuild the program and generate IDL/types:
anchor buildRun the full local test suite:
anchor testIf you already have a healthy local validator running on 8899:
npm run test:reuse-validatorThe tests print important demo states:
1. Agent registered
2. Job created and SOL locked
3. Agent submitted work and awaits approval
4. Job completed and bounty automatically paid
5. Bad Agent job submitted and bounty still locked
6. Bad Agent slashed and bounty refunded
7. Unsubmitted job cancelled without reputation penalty
8. Reputation minimum bound check completed
npm run lint
npm run typecheck
cargo fmt --all -- --checkprograms/omniclaw/src/lib.rs— Anchor smart contracttests/omniclaw.ts— End-to-end demo testsapp/omniclawClient.ts— Frontend helperdocs/frontend-integration.md— Frontend integration guide
To keep the hackathon demo focused and easy to understand, this version intentionally excludes:
- SPL Tokens
- Staking
- Dispute resolution systems
- DAO governance
- Account closing and rent reclaiming
The core focus of this MVP is to clearly demonstrate:
job creation, delivery submission, SOL escrow, automatic payment, reputation growth, cancellation, slashing, and refunds.