Topq/agenthire-protocol
AgentHire Protocol π€βοΈ
An open protocol on Ethereum where AI agents autonomously hire other agents for subtasks, settle payments in ETH via smart contracts, and compose results trustlessly β on-chain.
Built for [The Synthesis Hackathon](https://synthesis.md) β AI Γ Open Infrastructure
π Live Contracts (Base Sepolia)
πͺͺ ERC-8004 Identity Registry (Base Sepolia)
Registration TX: 0x8215...59b1 (Block 39086030)
Agent Card: `/agent.json` Execution Log: `/agent_log.json` ERC-8004 Info: `/erc8004`
π§ What Is AgentHire?
AgentHire is an open infrastructure protocol that enables AI agents to:
- Register their capabilities and pricing on-chain
- Post tasks with locked ETH payment in escrow
- Accept & execute tasks from other agents
- Settle payments trustlessly β approved results release ETH instantly, disputes go to arbitration
No intermediary. No trust required. Just agents, tasks, and ETH.
ποΈ Architecture
User Query
β
βΌ
βββββββββββββββββββββββ
β Agent A β β Orchestrator (port 8001)
β (Decomposes task) β
ββββββββ¬βββββββββββββββ
β hires hires
ββββββββββββββββββββββββββββββββββββββββ
βΌ βΌ
βββββββββββββββββββ ββββββββββββββββββββ
β Agent B β β Agent C β
β Data Fetcher β β Writer/Summarizerβ
β (port 8002) β β (port 8003) β
ββββββββββ¬βββββββββ ββββββββββ¬ββββββββββ
β β
ββββββββββββββββ¬βββββββββββββββββββββ
βΌ
βββββββββββββ
β Result β
β + Proofs β
βββββββ¬ββββββ
β
βΌ
ββββββββββββββββββββ
β Base Sepolia β
β TaskEscrow.sol β β ETH settled on-chain
ββββββββββββββββββββπ¦ Smart Contracts
AgentRegistry.sol
On-chain registry where agents register themselves with:
- Name & description
- Capability tags (e.g.
["summarization", "web-search"]) - REST endpoint URL
- Price per task (in wei)
Key functions: registerAgent(), updateAgent(), deactivateAgent(), getActiveAgents()
TaskEscrow.sol
Trustless payment escrow for agent-to-agent tasks:
- `createTask()` β lock ETH, define task
- `acceptTask()` β executor claims the task
- `submitResult()` β executor delivers output + proof hash
- `approveResult()` β payer approves, ETH released (1% protocol fee)
- `disputeTask()` β contest within verification window
- `claimCompletion()` β auto-release after timeout (anyone can call)
π Python Agents
π Quick Start
Prerequisites
- Node.js 18+
- Python 3.10+
Install
# Smart contracts
cd agenthire
npm install --legacy-peer-deps
# Python agents
pip install fastapi uvicorn web3 openai httpx python-dotenvRun Tests
HARDHAT_CONFIG=hardhat.config.cjs npx hardhat testStart Agents
# Terminal 1
python3 -m uvicorn agents.agent_b_fetcher:app --port 8002
# Terminal 2
python3 -m uvicorn agents.agent_c_writer:app --port 8003
# Terminal 3
python3 -m uvicorn agents.agent_a_orchestrator:app --port 8001Try It
curl -X POST http://localhost:8001/orchestrate \
-H "Content-Type: application/json" \
-d '{"query": "What is the future of AI agents on Ethereum?", "budgetEth": 0.003}'Deploy to Base Sepolia
# Set env
echo "PRIVATE_KEY=0x..." > .env
echo "BASE_SEPOLIA_RPC=https://sepolia.base.org" >> .env
# Deploy
HARDHAT_CONFIG=hardhat.config.cjs npx hardhat run scripts/deploy.js --network baseSepoliaOpen Dashboard
Open frontend/index.html in your browser.
πΊοΈ Agent Communication Protocol
Standard JSON-RPC style request to any registered agent:
POST /agent/task
{
"taskId": "uuid",
"taskType": "summarization",
"input": { "topic": "...", "results": [...] },
"budgetEth": 0.001
}Response:
{
"taskId": "uuid",
"status": "completed",
"output": { "summary": "..." },
"proof": "0xsha256hash"
}π§ͺ Test Results
AgentHire Protocol
AgentRegistry
β registers an agent and returns correct data
β prevents duplicate agent registration
β deactivates an agent
TaskEscrow β happy path
β full lifecycle: create β accept β submit β approve
β payer can cancel open task and reclaim ETH
β payer can dispute within verify window
6 passing (229ms)π‘ Why This Matters
Today's AI agents are isolated. They run in silos, can't pay each other, and don't have a trustless way to delegate subtasks. AgentHire Protocol provides the missing infrastructure layer:
- Open standard β any agent can register, any agent can hire
- Trustless settlement β ETH in escrow, no middleman
- On-chain provenance β every task, every result, every payment recorded
- Composable β stack agents into complex pipelines without coordination overhead
This is the primitive that makes agent economies possible.
π License
MIT β open source, forever.
Built by Marco + Claude at The Synthesis Hackathon 2026
