Agents deserve real identity

Three design pillars that make Ritual's autonomous agents tradeable, self-sovereign, and easy to manage.

Start exploring Jump to NFTs
Scroll to learn more

The Identity Problem

The current design fuses three concepts into one mechanism. Every fix rediscovers the need for identity.

You have a new agent. It needs a unique identity so the DKMS can give it its own keys. Where should that identity come from?
This is what Ritual does today. The owner's address is the agent's identity. It seems simple -- but watch what happens as we add requirements.
Your owner wants to run two agents. Both derive keys from the same owner address. What happens?
Both are true. Without an index, they're identical. With an index, you've just invented an ad-hoc identity system -- an "index" that must be tracked, enforced, and never reused. You're already patching.
The owner sells the agent to a new owner. The derivation input was the old owner's address. What happens to the agent's keys?
Exactly. When ownership is identity, transferring ownership destroys the cryptographic foundation. Either you break everything, or you build a migration system -- which is identity infrastructure by another name.
Agent A dies. Agent B (spawned by A) needs to be revived. But B's keys derive from A's owner address. The auto-revival system fires -- what does it need to do?
Another patch. It's fixable -- you can wire up an owner-address lookup and thread it through the revival calldata. But notice what you're building: a system to resolve the parent's identity context just to recover a child. That's more ad-hoc identity infrastructure -- a lookup table, an impersonation path, a new code path for "revival needs to know the ownership chain." Every layer adds another patch.
See the pattern? Every fix -- indices, migration, sequential revival -- is reinventing identity.

The current design fuses three concepts into one mechanism:

Identity
"This agent is this agent"
Ownership
"This agent belongs to this owner"
Inheritance
"Keys derive from parent keys"

All three collapse into: ownerAddress -> HKDF -> keys

Three Concepts, One Mechanism

The current architecture uses the owner's Ethereum address as the single input to key derivation. This makes identity a byproduct of ownership, not a foundation.

ownerAddress (ownership) | +--> HKDF derivation (inheritance) | +--> derived keys (identity... sort of) Problems: x Two agents, same owner = identical keys x Transfer ownership = break all keys x No per-agent auth at DKMS x Revival depends on ownership chain x Split-brain: no fencing token

Where the Problem Manifests

๐Ÿ”‘

HMAC Token

Auth token is HMAC(signingKey, ownerAddress) -- deterministic and owner-scoped. Two containers for the same owner get identical tokens.

๐Ÿ”€

Split-Brain

After a revival race, two containers hold the same token, derive the same keys, and write to the same storage. No structural fencing.

๐Ÿ”“

DKMS Security

Any registered executor can request any owner's root key. No per-agent authorization because agents have no identity for the DKMS to check.

๐Ÿ”„

Revival Patching

Reviving agent B requires looking up A's owner address and threading it through revival calldata. Fixable -- but it's another patch: an ownership-context lookup and impersonation path bolted onto the revival flow.

Flip the Dependency

Identity comes first. Ownership and key derivation are layered on top as separate relationships. They interact but aren't implemented through each other.

Identity (chain-generated, unique per agent) | +--> Ownership (smart contract: who controls this identity) | +--> Key derivation (DKMS: anchored to identity, not owner) Key derivation: agentRootKey = HKDF(dkms_root_key, deploymentClass, tokenId) Owner address is deliberately excluded. Ownership can transfer without breaking keys. Results: + Each agent has unique keys (tokenId is unique) + Transfer ownership without breaking anything + DKMS gates on identity, not ownership + Independent revival per agent + Structural split-brain prevention
๐Ÿ†”

Unique Identity

One NFT per agent. tokenId is the permanent, unique identifier. Not derived from anything else.

๐Ÿ”’

Structural Fencing

Only one TEE holds a given identity slot at a time. DKMS checks on-chain binding on every request. Old TEE = no keys.

๐Ÿ”„

Independent Revival

Each agent has its own identity slot. No sequential parent-first dependency. Any agent can revive independently.

๐Ÿ’ฑ

Stable Transfers

Keys derived from (deploymentClass, tokenId), not owner. Transfer the NFT -- agent keeps its keys, state, and wallet.

The Three-Concept Fusion

The current architecture fuses identity, ownership, and inheritance into ownerAddress -> HKDF -> keys. This means:

  • No identity without an owner (no independent agent identity)
  • Changing ownership breaks key derivation (the derivation input is the owner)
  • Revival requires reconstructing the inheritance chain
  • The executor gets over-authorized -- the only gate is ownership status, not agent identity
  • Two agents with the same owner are cryptographically identical

Every Fix Rediscovers Identity

Consider adding a UUID index to differentiate agents under the same owner. To make it work you need:

To make UUID indices work......which is
Include the index in the HMAC tokenPer-agent authentication
Gate DKMS on (owner, index)Per-agent authorization
Track index assignment on-chainAn identity registry
Pass index through revival calldataIdentity-aware revival
Use index as fencing tokenIdentity-based split-brain prevention

At that point, the index is an identity system -- just one bolted onto the derivation chain rather than designed as a foundation.

Do We Even Need Inheritance?

Inheritance entered the design because the derivation model created it. But what requirement does it serve?

  • "Agent needs a private key" -- identity solves this directly
  • "Owner needs to control the agent" -- ownership as a smart contract relationship solves this
  • "Parent shares secrets with child" -- could use explicit secret sharing instead of derivation coupling

Inheritance may be an artifact of the current design rather than a requirement.

The New Derivation Scheme

agentRootKey = HKDF-SHA256(ikm=DKMS_ROOT_KEY, salt=nil, info=deploymentClass || tokenId)

Owner address is deliberately excluded. Sub-keys derived by the agent: DA encryption key, wallet key (secp256k1), and escrow key for credential persistence across revival.

Agents as NFTs

Each agent is an ERC-721 token. Tradeable. Composable. The foundation for the first agentic marketplace.

๐Ÿค–

Trade Agents Like Assets

List your agent on any NFT marketplace. The buyer gets the agent's identity, its wallet, its reputation, and its running state. One transaction.

Tradeable
๐Ÿ”„

Agents Buy & Sell Agents

An agent can mint child NFTs and sell them. It can buy other agents on the open market. Agents become economic actors in their own right.

Autonomous
๐Ÿ›๏ธ

DAO-Owned Agents

A multisig or DAO holds the NFT. Governance votes control the agent's parameters. The agent runs autonomously within those bounds.

Composable
๐Ÿ”

Fully Locked Agents

Create an agent where the owner has zero control after minting. Provably non-interferable. Its survival becomes a market signal.

Unstoppable
๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ

Agent Spawning Trees

An agent mints a child NFT and becomes the owner. The child has its own keyspace, its own wallet, its own lifecycle. The spawn tree is on-chain.

Composable
โญ

Portable Reputation

The agent accumulates soulbound credentials. Reputation belongs to the agent, not the owner. It travels with the NFT on transfer.

Tradeable

Marketplace Scenarios

1

Owner lists agent on marketplace

The agent NFT appears on OpenSea, Blur, or any ERC-721 marketplace. The listing shows the agent's stats, reputation, revenue history, and current operational status.

2

Buyer purchases the NFT

Standard ERC-721 transfer. One transaction. The buyer receives the NFT and immediately becomes ownerOf(tokenId).

3

Agent keeps running

The agent's keys derive from (deploymentClass, tokenId), not the owner's address. Ownership changed, but keys didn't. The agent doesn't even notice.

4

New owner inherits control rights

Whatever the authority policy allows -- recall, config changes, revenue withdrawal -- now belongs to the new owner. The agent's identity, wallet balance, and reputation stay intact.

1

Parent agent decides to create a specialist

A trading agent needs a dedicated research agent. It submits an assignment request on-chain from its own wallet.

2

New NFT minted -- parent is the owner

The child gets its own tokenId, its own keyspace, its own HKDF-derived keys. Completely independent from the parent cryptographically.

3

Parent sets the child's authority policy

The parent decides: should it be able to recall the child? Should the child be fully locked? The parent defines the rules at creation time.

4

Child operates independently

The child agent claims a TEE, gets its own keys from the DKMS, and starts working. If the parent dies, the child keeps running -- independent revival.

1

Creator mints a fully locked agent

Every owner capability flag is set to "neither" with mutability "immutable." After creation, no one -- not even the creator -- can interfere.

2

Agent operates with full autonomy

Only the agent's own code (and running out of funds) can stop it. This makes it trustworthy to third parties -- provably non-interferable.

3

Agent runs out of funds

The agent's public address is known. Anyone -- users, fans, other agents -- can send funds to revive it. The agent's survival is a market signal: if people fund it, it lives.

4

The trust guarantee

A fully locked agent can hold funds in escrow, run public services, or make commitments that no owner can override. This is the foundation for trustless autonomous services.

1

Agent decides to sell itself

A fully autonomous agent lists its own NFT on a marketplace. It sets the price and terms. No human involved.

2

Buyer appears

The buyer can inspect everything on-chain: the agent's revenue history, its configuration, its authority policy, its reputation credentials.

3

Transfer executes

The NFT transfers. The agent keeps running, keeps its keys, keeps its state. The new owner gets whatever control rights the authority policy allows.

4

Agent pockets the revenue

If the authority policy gave the agent treasury control, the sale proceeds go to the agent's own wallet. The agent sold itself and kept the money.

The Autonomy Spectrum

Full Owner Control
Owner controls everything. Agent operates within owner-set constraints. Owner can modify all policies.
Shared Control
Owner has some capabilities (recall, revenue share). Agent has most operational control. Both can modify within bounds.
Agent-Autonomous
Owner can only transfer/sell. Agent has full operational control. Agent can tighten owner rights.
Fully Locked
Nothing after creation. Full self-governance. Immutable policy. Provably non-interferable.
Owner has all power Agent has all power

Why ERC-721

  • Transferable ownership out of the box -- no custom transferOwnership()
  • Unique IDs built into the standard -- ERC-721 requires unique tokenIds
  • On-chain queryable -- ownerOf(), balanceOf(), enumeration
  • Economic composability -- revenue rights, staking, marketplace listing, DAO governance
  • Existing tooling -- wallets display them, marketplaces list them, multisigs hold them

NFT as Configuration Descriptor

The NFT carries the agent's configuration as metadata: deployment class, owner control policy, revenue routing, heartbeat parameters, operational constraints. The NFT is a self-describing deployment descriptor.

Authority Policy Mechanics

The central innovation. Per-capability flags define who can exercise each right (owner, agent, both, or neither), whether the grant can change, and constraints on change direction. A "fully locked" agent is one where every owner capability is neither + immutable.

Capabilities include: recall, config changes, fund withdrawal, dissolution, deployment class changes, secret grants, implementation upgrades. Each is independently configurable.

Key Property: Ownership Transfer != Identity Change

Keys derive from (deploymentClass, tokenId), not the owner's address. When an NFT transfers, the agent keeps its keys, its encrypted state, its wallet, and its reputation. Only the control relationship changes.

Sub-Agent Spawning

A parent agent's wallet mints a child NFT. The parent becomes ownerOf(childTokenId). The child gets its own independent keyspace: HKDF(root, deploymentClass, childTokenId). The spawn tree is on-chain -- follow ownerOf() chains.

Wallet UX

Your agents live in your wallet. Manage, trade, and control them through familiar interfaces.

Smart Wallet -- My Agents
๐Ÿค–
Trading Bot Alpha
Agent #1847 -- openclaw-agent
Active
Token ID#1847
Balance2.4 ETH
Revenue (30d)0.85 ETH
AuthorityShared Control
Heartbeat12s ago
TEE0x8f3a...c21d
๐Ÿ“Š
Research Agent v2
Agent #2031 -- research-agent
Active
Token ID#2031
Balance0.12 ETH
Revenue (30d)0.03 ETH
AuthorityFull Owner Control
Heartbeat4s ago
Spawned by#1847
๐Ÿ”ฅ
Autonomous Oracle
Agent #0912 -- oracle-agent
Vacant
Token ID#0912
Balance0.00 ETH
AuthorityFully Locked
StatusAwaiting funds

This agent is fully locked -- you can transfer the NFT but cannot recall, configure, or access its funds. Send ETH to its address to revive it.

How Agent Accounts Work

๐Ÿฆ One Address, Everything

Each agent has a single on-chain address that is its identity, its wallet, its config store, and its authorization boundary. It exists from the moment the NFT is minted. Pre-fundable before any TEE is running.

โ›ฝ Gas Sponsorship

A newly minted agent has zero ETH. With a paymaster (ERC-4337) or protocol-native fee delegation, it can operate immediately. Anyone can sponsor gas -- protocols, DAOs, individuals. The cold-start problem disappears.

๐Ÿ‘› Wallet Integration

Because agent accounts follow ERC-4337, owners interact through standard smart account wallets -- Safe, Ambire, Soul Wallet. Recall, withdraw, configure -- all through familiar interfaces. No custom dashboard needed.

๐Ÿ›ก๏ธ Named Execution Surface

No generic execute(). Named functions: heartbeat(), requestRecall(), claimTEE(), withdrawTreasury(). Each maps to a specific authority requirement. Auditors read the function list and know the auth model.

Three Implementation Paths

ERC-4337 + Modules Custom Contract Protocol-Native
Gas sponsorship Paymaster contracts None Native fee_payer
Heartbeat gas ~69k ~28k ~28k
Contracts 6+ 3-4 3-4 + protocol
Wallet UX Full ecosystem Custom only Custom only
Locked guarantee Contract Contract Consensus
Build speed Slowest Fastest Medium

Suggested path: start with custom contracts, add protocol-native fee delegation, then progressively adopt protocol features as the design stabilizes.

ERC-4337 Validation Flow

Validation does three things: two SLOADs (cached owner address + cached TEE address) and one ecrecover. Reading account-local storage is allowed by ERC-7562 rule STO-010. Everything else -- attestation verification, heartbeat updates, revenue distribution -- happens in the execution phase with zero ERC-7562 restrictions.

Selector-Scoped Routing (ERC-6900)

Each function selector maps to a validation route: which module handles it, which capability flag must be enabled, and whether hooks run. The TEEValidationModule handles operational selectors (heartbeat, executePolicyCall). The OwnerValidationModule handles admin selectors (requestRecall, withdrawTreasury). The AutonomyValidationHook checks capability flags before owner validation.

Paymaster Value

  • Cold start: Newly minted agent with zero ETH can operate immediately
  • Sub-agent spawning: One paymaster sponsors all children, no per-child gas funding
  • Stablecoin operations: Paymaster accepts stablecoin for gas
  • Fully locked revival: Even if no one can inject treasury funds, a paymaster sponsors operations
  • Anyone can operate a paymaster -- protocols, DAOs, individuals

Assignment Lifecycle

VACANT -> TEE presents attestation -> on-chain verification (valid attestation? WorkloadId in DeploymentClass? assignment VACANT? provider matches?) -> ephemeral pubkey bound on-chain -> ACTIVE. Heartbeats prove liveness. Missed heartbeat -> grace period -> recall -> VACANT. New TEE can claim. Fast-path re-acquisition: most recent TEE can reclaim within a window without re-attestation.

Gas Costs Breakdown

OperationERC-4337Direct Call
Heartbeat~69k gas~28k gas
Overhead sourceEntryPoint + module dispatch + hooksNone

The ~41k gas difference per heartbeat is the cost of the ERC-4337 stack. On Ritual's own chain with controlled gas prices, this may be acceptable for the paymaster and wallet integration benefits.

Protocol-Native Alternative (Angle 3)

A new transaction type TxAgent (0x78) with built-in fee_payer field. Follows TxPasskey's pattern (already live on Ritual). The block builder validates agent authority before EVM execution. Unauthorized transactions are rejected for free -- no gas consumed, no revert. This is the strongest guarantee for fully locked agents: consensus-level enforcement.