---
title: "Decentralized identity"
description: "W3C DIDs with Ed25519 cryptography, automatic registration, and AES-256-GCM keystore"
url: "https://agentfield.ai/docs/agentfield/build/governance/identity"
canonical: "https://agentfield.ai/docs/agentfield/build/governance/identity"
markdown_url: "https://agentfield.ai/llm/docs/agentfield/build/governance/identity"
contract_version: "2026-03-24-v1"
docs_revision: "a2a2b0669dab"
product: "AgentField"
category: "governance"
difficulty: "advanced"
keywords: ["DID", "identity", "Ed25519", "cryptography", "keystore", "did:key", "did:web", "W3C"]
last_modified: "2026-11-02T17:24:14.000Z"
ai_summary: "W3C DIDs with Ed25519 cryptography, automatic registration, and AES-256-GCM keystore"
---

<img src="/docs-images/hero-identity.webp" alt="Cryptographic identity — DID and verifiable credentials" />

> Every agent gets a cryptographic identity rooted in W3C DIDs -- no central certificate authority required.

AgentField assigns each agent and its functions a `did:key` identifier backed by Ed25519 key pairs. DIDs are generated deterministically on registration, organized in a 3-tier hierarchy (platform, agent, function), and stored in an AES-256-GCM encrypted keystore. Every execution can be cryptographically tied to the agent that performed it.

When you publish selected capabilities through [external agent discovery](/docs/agentfield/quick-guides/external-agent-discovery), the public entry can include trust metadata derived from the same identity system. External clients can discover a reasoner, see the publisher identity, and decide whether to import it before any runtime call is allowed.

### Python

### TypeScript

### Go

### curl

## What just happened

The page example registered an agent, exposed its DID package, and showed that both the agent and its functions can be resolved through the control plane. The important takeaway is not just that identities exist, but that identity becomes inspectable infrastructure instead of hidden SDK state.

### What you get
- **W3C DID identifiers** -- agents and their functions each receive a `did:key` identifier backed by Ed25519 key pairs
- **Web-resolvable DIDs** -- `did:web` documents served at standard paths for cross-network resolution
- **Automatic registration** -- DIDs are generated deterministically when agents register with the control plane
- **3-tier hierarchy** -- platform root, agent node, and individual function DIDs. Agents that host [sessions](/docs/agentfield/build/building-blocks/sessions) register and sign the same way agents that host reasoners and skills do.
- **Encrypted keystore** -- private keys stored with AES-256-GCM encryption
- **Non-repudiation** -- every execution can be cryptographically tied to the agent that performed it

### Enabling DIDs
### Python

### TypeScript

### Go

### How it works
### DID Hierarchy

AgentField creates a 3-tier DID hierarchy using deterministic key derivation:

<pre>
graph TD
    Root["Platform Root DID<br/>(did:key:z6Mk...)"]
    A1["Agent Node DID<br/>(did:key:z6Mk...)"]
    A2["Agent Node DID<br/>(did:key:z6Mk...)"]
    R1["Reasoner DID: analyze<br/>(did:key:z6Mk...)"]
    R2["Reasoner DID: summarize<br/>(did:key:z6Mk...)"]
    S1["Skill DID: health_check<br/>(did:key:z6Mk...)"]
    F2["..."]

    Root --> A1
    Root --> A2
    A1 --> R1
    A1 --> R2
    A1 --> S1
    A2 --> F2
</pre>

| Level | Derivation Path | Purpose |
|-------|----------------|---------|
| Platform root | `m/44'/0'` | Signs agent registration VCs; root of trust |
| Agent node | `m/44'/1'/{node_index}` | Signs execution VCs; identifies the agent |
| Function | `m/44'/1'/{node_index}/{function_index}` | Identifies specific reasoners and skills |

### Key Generation

Keys are derived deterministically from a master seed using HKDF (HMAC-based Key Derivation Function) with SHA-256:

1. The control plane generates a 256-bit master seed on first initialization
2. The root DID is derived from the master seed using path `m/44'/0'`
3. Agent DIDs are derived using HKDF with the agent's node ID as context
4. Function DIDs are derived from the agent DID with the function name as context

This means the same master seed always produces the same DID hierarchy -- deterministic and reproducible.

### DID Formats

AgentField supports two DID methods:

**`did:key`** -- self-certifying identifier encoding the Ed25519 public key directly:

Resolvable by anyone who can decode the identifier -- no network call required.

**`did:web`** -- web-resolvable identifier tied to the control plane's domain:

Resolved by fetching the DID document from the agent's well-known path.

### did:web Resolution

The control plane serves DID documents at standard paths:

These documents follow the W3C DID Document specification and include the agent's public key, verification methods, and service endpoints.

### Keystore
Private keys are encrypted at rest using AES-256-GCM:

| Property | Value |
|----------|-------|
| Algorithm | AES-256-GCM |
| Key size | 256 bits |
| Nonce | Generated fresh per encryption operation |
| Storage | Local filesystem at `./data/keys/` (relative to working directory) |
| Directory permissions | `0700` (owner only) |

The keystore currently supports local filesystem storage. The service interface is designed for future HSM and cloud KMS integration.

### Configuration
Enable or disable DIDs in `agentfield.yaml`:

### DID Authentication
Use DIDs for authenticating outbound HTTP requests between agents. The SDK signs requests with the agent's Ed25519 private key and the receiving agent verifies the signature using the sender's public DID.

### Python -- `DIDAuthenticator`

**`DIDAuthenticator` methods:**

| Method | Description |
|---|---|
| `sign_headers(body)` | Generate signed DID auth headers for a request body |
| `set_credentials(did, private_key_jwk)` | Set or update DID credentials |
| `is_configured` | Property: whether DID and private key are loaded |
| `did` | Property: the agent's DID identifier |

### TypeScript

### Go -- `client.SignHTTPRequest()`

### Enabling DID Auth on All Outbound Calls

Set `RequireOriginAuth` in Go agent config to validate that incoming execution requests include proper authorization. When `EnableDID` is set, outbound calls via `Call()` are automatically signed with DID auth headers.

### Python

### Go

### Patterns
### Verifying Agent Identity

Use the DID to verify that an execution was performed by a specific agent:

### Cross-Network Identity

Use `did:web` when agents need to verify each other across networks:

See [Credentials](/docs/agentfield/build/governance/credentials) for how DIDs are used to sign execution verifiable credentials.

### ARD Trust Metadata

Public discovery entries can include a trust manifest with the publisher identity. In AgentField, that means an Agentic Resource Discovery entry can advertise the DID-backed identity of the control plane or agent function while still requiring a separate import and callable-binding decision on the consuming side.

Use this as discovery-time trust context, not as a replacement for [access policies](/docs/agentfield/quick-guides/access-control) or credential management.
### API reference
### Platform DID

Returns the control plane's root DID and public key.

### Issuer Public Key

Returns the Ed25519 public key used to sign verifiable credentials, in JWK format.

### Registered DIDs

Lists all registered DIDs across the platform -- agents, reasoners, and skills.

### Agent DID Resolution

Through the UI API:

Returns the DID identity package for a specific agent node, including the agent DID and all function DIDs.

### DID Resolution Bundle

Returns a complete resolution bundle for offline verification: the DID document, the public key, and any associated verifiable credentials.
