Why DIDComm Matters
It's time to look beyond Transport Layer Security toward a post-API world. DIDComm enables a verifiable Internet of Agents that communicate privately, authentically, and independently of transport.
It’s time to look beyond Transport Layer Security (TLS) toward a post-API world. A new foundation is emerging, where DIDComm enables a verifiable Internet of Agents that communicate privately, authentically, and independently of transport.
What in the World is DIDComm?
DIDComm is a foundational, peer-to-peer messaging protocol that gives every digital entity — whether it’s an AI, a server, or a smart fridge — a permanent digital passport (Decentralized Identifier, or DID) and a private, end-to-end encrypted (E2EE) messaging service.
Think of it like giving your digital agents a pair of walkie-talkies with built-in quantum encryption.
The Three Superpowers of DIDComm
- End-to-End Encryption (E2EE): This is the big one. Unlike traditional web comms, DIDComm encrypts the message so that only the intended recipient can read it. Intermediaries, servers, and routers only see scrambled text and the delivery instructions. Your secret remains a secret.
- Transport Agnostic (The ‘Wherever You Are’ Feature): Most communications are glued to HTTPS. DIDComm is the opposite. Messages can flow over literally anything: WebSockets, Bluetooth, email, QR codes, or even embedded in a cat picture. It doesn’t matter. It’s the ultimate flexible traveler.
- Asynchronous Coordination (The ‘Leave a Note’ Feature): Your agent doesn’t have to be online 24/7. DIDComm allows messages to be sent, routed through a trusted intermediary (called a Mediator), and picked up later when the recipient is ready. It’s like having a secure P.O. box for your robot friend.
![]()
How DIDComm Works
Sounds great, but how does this “secure P.O. Box” magic actually happen? It all starts with the Decentralized Identifier (DID) and its associated documents.
Issuing the Digital Passport (The DID)
When a digital entity (like an AI Agent or an IoT device) is created, it gets a unique DID. This DID acts as a permanent web address for that entity.
- Keys are Created: A pair of cryptographic keys are generated: a Private Key (kept super-secret, like a house key in a secure wallet) and a Public Key.
- The DID Document is Published: The Public Key and other information are published in a DID Document — think of this as a digital business card hosted on a public, verifiable place (like a blockchain or a web endpoint).
- The Mediator is Listed: Crucially, this DID Document also contains the address of its DIDComm Mediator. This Mediator is the agent’s P.O. box.
![]()
Sending an Encrypted Message via the Mediator
Let’s say Agent Alice wants to send a private message to Agent Bob, who is currently taking a nap offline.
- Inner Encryption (The Secret): Alice first encrypts her message for Bob using his Public Key. Now, only Bob’s Private Key can decrypt it. This is the E2EE layer.
- Outer Encryption (The Delivery Instructions): Alice then wraps this encrypted “secret” message in a second envelope called a Forward Message. This outer envelope is encrypted using the Mediator’s Public Key. The instructions say: “Dear Mediator, please forward the enclosed package to Bob.”
- The Mediator’s Job: The Mediator receives the message, decrypts the outer envelope (the Forward Message) to read the delivery instructions. It now knows the message is for Bob.
- The Secure Queue: Because Bob is offline, the Mediator simply puts the inner, fully encrypted message (the one with Alice’s secret) into a secure message queue associated with Bob’s DID. The Mediator can never read the secret inside!
![]()
Delivery Assurance
The Mediator and the client agent (recipient) communicate using a sequence of messages defined in this protocol to ensure every message is accounted for and not deleted prematurely.
| Step | Actor | Action | Description |
|---|---|---|---|
| 1. Status | Recipient | Status Request | ”How many messages are in my queue?“ |
| 2. Get | Recipient | Delivery Request | ”Send me a batch of messages from my queue.” |
| 3. Deliver | Mediator | Message Delivery | Sends the batch of queued, encrypted messages as attachments. |
| 4. Confirm | Recipient | Messages Received | A list of unique IDs for the messages it successfully received. |
| 5. Clear | Mediator | Internal Action | Deletes the messages from the queue only after receiving confirmation. |
This final confirmation step (Messages Received) is what ensures delivery. The Mediator won’t remove the messages from storage until the client agent explicitly confirms it has them.
Mediators can also support a “Live Mode” (often using WebSockets) where newly arriving messages are pushed immediately to an online client, bypassing the queue, but if the connection drops, new messages default back to being queued.
Here Is the Fix
Here’s a quick summary of how DIDComm fixes the old web’s flaws:
| Problem | DIDComm Solution |
|---|---|
| Secure Pipe, Shady Content — A secure connection doesn’t guarantee the honesty of the agent on the other end. | Verifiable Identity and Digital Signatures — Every message is cryptographically signed by the agent’s unique DID. |
| Authority Delegation Nightmare — Complex, multi-step hand-offs cause “consent fatigue.” | Persistent, Portable, Autonomous DIDs — One permanent digital identity carries permissions across all systems. |
| Rigid and Synchronous Communication — HTTP/REST forces agents to wait for a reply. | Asynchronous Messaging via Mediators — Messages are securely queued until the recipient is ready. |
| Governance and Accountability Dilemma — No easy way to audit agent actions. | Non-repudiation and Forensic Auditing — Cryptographically signed logs provide an undeniable record of all agent activity. |
Why This Matters for the Future
DIDComm isn’t just a technical upgrade; it’s the privacy and security foundation needed for the Internet of Agents. It allows AI and digital services to communicate peer-to-peer, privately, and reliably, regardless of where they are or what network they use. We’re moving from a world of public APIs to a verifiable, private ecosystem of coordinated agents.
Build with Affinidi
Start building trust infrastructure with our open-source tools and developer-friendly APIs.