Skip to content

DIDs and DIDComm

DID document

did:keri:<aid> resolves to a DID document derived from verified key state:

  • signing keys as verification methods, for authentication and assertion
  • key agreement keys (X25519) and service endpoints from the service descriptor

The metadata contains sequence, event, threshold, next key digests, delegator, and whether the identity is deactivated.

Service descriptor

The descriptor lists encryption keys, endpoints and supported protocols. Its digest is anchored in the key event log, so endpoints cannot be forged. It has an increasing version. Two different descriptors with the same version are refused as a conflict.

Descriptors are found on relays, or introduced directly with the address of /oobi.

Endpoint type URI
http http:// or https://
nostr ws:// or wss://
mediator Identifier of a mediator

Encryption

Messages are JWE envelopes. Authenticated envelopes use ECDH-1PU with A256CBC-HS512, so the recipient knows the sender. Anonymous envelopes, used for forwarding, use ECDH-ES with A256GCM. Key agreement keys are rotated independently of signing keys. Retired ones are kept for 30 days to read messages in transit.

Delivery

Messages to be sent are stored in an outbox and repeated until they are delivered or expire. Repeated messages are recognized by sender and id, and the first reply is returned.

Over a relay, an envelope is addressed to a mailbox derived from the recipient's identifier.

Mediation

A mediator stores encrypted envelopes for recipients that are offline. It sees the recipient, but not the content or the sender.

Limit Value
Messages for each recipient 1000
Bytes for each recipient 64 MiB
Retention 7 days

A recipient requests mediation, adds itself, and collects messages. Set SERVE_MEDIATION=true to run a mediator, and MEDIATION_ALLOW to limit who may use it.