> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.adid.dev/llms.txt.
> For full documentation content, see https://docs.adid.dev/llms-full.txt.

# DID Create Sequence

**Used in:** §2.5 Your First DID, §3.1.2 Creating Additional DIDs, §9.3 DID endpoints
**Audience:** Holder, Backend Developer
**IA ID:** D2 detail

```mermaid
sequenceDiagram
  autonumber
  participant Holder
  participant Portal
  participant API
  participant DB
  participant Chain as ADI chain
  participant DIDRegistry

  Holder->>Portal: Click "Create DID"
  Portal->>API: POST /api/v1/dids (Bearer JWT)
  API->>API: Generate Ed25519 keypair (pkg/crypto)
  API->>API: Build DID Document (pkg/did)
  API->>DB: INSERT did (status=pending)
  API->>Chain: tx createDID(did, didDocument)
  Chain->>DIDRegistry: createDID
  DIDRegistry-->>Chain: emit DIDCreated
  Chain-->>API: tx receipt
  API->>DB: UPDATE did SET status=active, txHash=...
  API-->>Portal: 201 Created (did, didDocument)
  Portal-->>Holder: Show new DID in MyDIDs
```

**Reading guide:** Off-chain key generation happens server-side; the user never handles a private key here. The DB row goes from `pending` → `active` only after the receipt is observed.

***