---
id: "did"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["identifiers"]
langs: ["common"]
quality: 90
url: "http://registry.apicrafter.io/datatype/did"
---

# Decentralized identifier (DID) (`did`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Identifier defined by the W3C Recommendation Decentralized Identifiers (DIDs) v1.0 (2022). It has the form did:<method>:<method-specific-id>. The method name is lowercase letters and digits, such as web, key or plc, and the method decides how the identifier resolves to a DID document with keys and service endpoints. The method-specific part uses letters, digits, period, hyphen, underscore, percent-encoded bytes and colons, and does not end with a colon. A DID followed by a path, query or fragment is a DID URL, which the regexp does not accept. Bluesky and the AT Protocol identify accounts with did:plc and did:web DIDs.

- Parent datatype: `uri`
- Personal data (PII): no
- Categories: Universal unique identifiers (identifiers)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^did:[a-z0-9]+:(?:(?:[A-Za-z0-9._-]|%[0-9A-Fa-f]{2})*:)*(?:[A-Za-z0-9._-]|%[0-9A-Fa-f]{2})+$
```

## Examples

- `did:example:123456789abcdefghi` — Example 1 of the W3C DID specification
- `did:web:w3c-ccg.github.io` — did:web method specification
- `did:web:example.com%3A3000:user:alice` — did:web with an encoded port and a path, did:web method specification
- `did:Example:123456789abcdefghi` (invalid example) — Uppercase letter in the method name
- `did:example:123456/path` (invalid example) — DID URL with a path
- `did:example:` (invalid example) — Empty method-specific identifier

## Mappings

- bioregistry: `did`

## Translations

- ru: Децентрализованный идентификатор (DID)

## Sources

- doc: <https://www.w3.org/TR/did-1.0/>
- wikidata: <https://www.wikidata.org/wiki/Q95350968>
- doc: <https://w3c-ccg.github.io/did-method-web/>
- doc: <https://atproto.com/specs/did>

## Quality

Score 90/100. Missing: detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/did.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/identifiers/did.yaml>
