8.4 · Agents and walletsWorking
Mediators and relays: why they exist
A phone cannot be reached directly: it has no stable address and is often switched off. A mediator is an always-reachable agent that accepts messages for it, holds them, and passes them on when the phone collects them. The sender wraps the message in an outer envelope addressed to the mediator; the mediator opens only that envelope, and finds inside an instruction naming the next recipient. A relay passes messages on without opening anything.
A post-office box.
Where it breaks:
- The sender must know the box exists and wrap for it, so the mediator is a named hop, not a hidden one.
- A box shared by many recipients hides each among the others.
A mediator is a participant in agent-to-agent message delivery that must be modeled by the sender. It has its own keys and will deliver messages only after decrypting an outer envelope to reveal a forward request.
The messaging protocol is, in its own words,
Message-Based, Asynchronous, and Simplex
How the sender wraps a message for forwarding DIDCOMM-2.0 §9.4.6, and what the mediator does with it DIDCOMM-2.0 §9.4.7. Relays and mediators are distinguished through a series of scenarios ARIES-RFC-0046 §3.1.
- The mediator sees who each message is for and when it arrived, not what it says (8.5 What a mediator can see).
- A mediator does not make a message private; the encryption for the recipient does.
- ARIES-RFC-0046 Aries RFC 0046: Mediators and Relays
- DIDCOMM-2.0 DIDComm Messaging v2.0