ERC-8004 TEE Agent
Trustless agents with Intel TDX on Base Sepolia. 0.0001 ETH registration fee.
Features
- ๐ TEE-derived keys (Intel TDX via Phala dstack)
- ๐ ERC-8004 compliant agent cards
- ๐ TEE attestation (mock signatures for testing)
- ๐ On-chain registration (0.0001 ETH)
- ๐ค A2A protocol (POST /tasks, GET /tasks/{id})
- ๐๏ธ AIO Sandbox integration
Quick Start
Using Docker (Recommended)
git clone https://github.com/HashWarlock/erc-8004-ex-phala.git
cd erc-8004-ex-phala
cp .env.example .env
# Edit .env with your config
docker compose up -dManual Setup
git clone https://github.com/HashWarlock/erc-8004-ex-phala.git
cd erc-8004-ex-phala
pip install -e .
cp .env.example .env
# Edit .env with your config
python deployment/local_agent_server.pySee QUICKSTART.md for details
Project Structure
erc-8004-ex-phala/
โโโ contracts/ # Solidity contracts
โ โโโ IdentityRegistry.sol (deployed: 0x8506e13d47faa2DC8c5a0dD49182e74A6131a0e3)
โ โโโ TEERegistry.sol
โโโ src/agent/ # Core agent logic
โ โโโ tee_auth.py # TEE key derivation
โ โโโ tee_verifier.py # TEE registration
โ โโโ registry.py # On-chain registry client
โโโ src/templates/ # Agent templates
โ โโโ server_agent.py # AIO Sandbox agent
โโโ deployment/ # Server
โ โโโ local_agent_server.py
โโโ static/ # Web UI
โโโ dashboard.html # Registration flow
โโโ funding.html # QR code funding
Architecture
โโโโโโโโโโโโโโโ
โ Wallet โ Fund with Base Sepolia ETH
โโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโ
โ Register โ Identity Registry (on-chain)
โโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโ
โ TEE Verify โ Attestation + Code Measurement
โโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโ
โ Ready โ A2A endpoints active
โโโโโโโโโโโโโโโ
API Endpoints
GET /- Funding pageGET /dashboard- Registration flowGET /api/status- Agent status (checks on-chain)GET /api/wallet- Wallet address & balancePOST /api/register- Register agent (0.0001 ETH)POST /api/tee/register- Register TEE keyGET /.well-known/agent-card.json- ERC-8004 agent cardPOST /tasks- Create A2A taskGET /tasks/{id}- Query task status
Deployed Contracts
Base Sepolia:
- IdentityRegistry:
0x8506e13d47faa2DC8c5a0dD49182e74A6131a0e3(0.0001 ETH fee) - TEERegistry:
0x03eCA4d903Adc96440328C2E3a18B71EB0AFa60D - Verifier:
0x481ce1a6EEC3016d1E61725B1527D73Df1c393a5
Configuration
See .env.example:
AGENT_DOMAIN=localhost:8000
AGENT_SALT=unique-salt
IDENTITY_REGISTRY_ADDRESS=0x8506e13d47faa2DC8c5a0dD49182e74A6131a0e3
TEE_REGISTRY_ADDRESS=0x03eCA4d903Adc96440328C2E3a18B71EB0AFa60DDocumentation
- QUICKSTART.md - Get started in 3 min
- IMPLEMENTATION_PLAN.md - Architecture
- STAKEHOLDER_DEMO.md - EF presentation
- contracts/ - Smart contracts
- src/agent/ - Core code
How It Works
- Generate Wallet - TEE derives keys from domain+salt
- Fund - Add 0.0001 ETH to agent address
- Register - Call Identity Registry
newAgent() - Verify TEE - Submit attestation to TEE Registry
- Go Live - A2A endpoints ready
Trust Model: Hardware-backed cryptographic proof via Intel TDX attestation
Tech Stack
- TEE: Intel TDX (Phala dstack)
- Chain: Base Sepolia
- Backend: Python/FastAPI
- Contracts: Solidity ^0.8.20
- Frontend: HTML/Tailwind
Development
# Run server
python deployment/local_agent_server.py
# Test
pytest tests/
# Deploy contracts
./scripts/deploy_contracts.shERC-8004 Compliance
โ
Agent Cards
โ
Identity Registry
โ
TEE Registry
โ
A2A Protocol
โ
Attestation Verification
License
MIT
Links
- Spec: ERC-8004
- Reference: dstack-erc8004-poc
- Phala: phala.network
- Base: base.org