TL;DR
- ERC-8004 gives us onchain primitives to register and discover trustless agents.
- To make those registrations meaningful, you want verifiable runtime evidence, not just a signature.
- Confidential VMs (CVMs) running dstack to deliver deterministic key derivation + remote attestation so your agent can prove where it executed.
- Phala Cloud wraps this in a bow: VibeVM templates, an onchain KMS/registry workflow, and (optionally) confidential inference (GPU TEE) support.
- This post walks the whole flow: deploy a CVM → produce attestation → register identity on Sepolia → verify via TEERegistry.
Why Trustless Agents Matter
Distributed systems increasingly outsource work to off-chain agents—indexers, oracles, model inference, payment relays. When an agent signs a statement or moves value, a bare signature only proves key possession, not execution context. The missing link is provenance: did this response come from the runtime I expect? ERC-8004 gives us a compact onchain model for agent identity and discovery. Pair it with TEE-backed CVMs and you get the runtime receipts you’ve been wishing for: attested execution. Explore more confidential AI agent use cases and implementations.What’s broken today (and how we fix it)
- Agents are usually deployed ad hoc; signed responses alone don’t say anything about where the code ran.
- Keys can be copied; logs can be forged; environments can be jailbroken.
- What agents actually need:
- Deterministic key material derived inside the runtime.
- Remote attestation that binds keys + code measurements to a platform identity.
- Onchain discovery so other contracts/clients can programmatically verify them.
Deploy Your ERC-8004 Agent in TEE
Pre-reqs
- Phala Cloud account
- GitHub account (token only needed if cloning private repos)
- Wallet with ETH Sepolia funds for registration/funding
1) Deploy VibeVM: the TEE coding environment
- Go to https://cloud.phala.network/templates/VibeVM → Deploy
2) Configure the CVM
-
OS:
dstack-dev-0.5.xor newer - Instance: Large TDX, 4 vCPU, 8 GB RAM, >40 GB storage
-
Set Encrypted Secrets (remember to change the password):

Tip: GH_TOKEN only needed for private repos.
3) Deploy & open VibeVM
- Click Deploy and let provisioning finish.
- Open View details → Networks and click the URL with port 8080 to open the frontend.

4) Sign into the VibeVM frontend
- Use the credentials you set.
- You’ll land in a VSCode server with the repo already cloned.

5) Prep the agent
In the VSCode server terminal:
6) Build & run

7) Register & fund the agent
- Visit your agent domain and step through the registration + wallet-connect funding flow.
- This calls IdentityRegistry on Sepolia to record the agent and posts the attestation to TEERegistry.
- Example demo transactions (Sepolia):
- IdentityRegistry: 0x88a03a29fe2c9a5881bbbdece91cd75c4e816a4dcda3f4ed2610bc119c517011
- TEERegistry verify: 0x4b9810c3d1753b79c029938add20c237a4fd7b58eccd9b094bc54b3197c97a9e


8) Verify attestation via TEERegistry
- Use the TEERegistry contract UI or explorer to confirm the attestation entry matches your IdentityRegistry entry.
- View TEERegistry verification transaction

9) Talk to the agent
- Hit the Agent API. You should get signed responses whose key matches what you registered, and whose runtime is backed by the TEE attestation onchain.

