← All Articles
Technical 10 min read

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.

Chaitanya Samprajan

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.

DIDComm three superpowers overview

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.

DID issuance and mediator flow

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!

Secure message queue via mediator

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.

StepActorActionDescription
1. StatusRecipientStatus Request”How many messages are in my queue?“
2. GetRecipientDelivery Request”Send me a batch of messages from my queue.”
3. DeliverMediatorMessage DeliverySends the batch of queued, encrypted messages as attachments.
4. ConfirmRecipientMessages ReceivedA list of unique IDs for the messages it successfully received.
5. ClearMediatorInternal ActionDeletes 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:

ProblemDIDComm 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.

DIDCommPrivacyAI AgentsDecentralised Identity

Build with Affinidi

Start building trust infrastructure with our open-source tools and developer-friendly APIs.

Cookie Preferences

We use cookies to enhance your experience. You can manage your preferences below. For more information, read our Cookie Policy.

Strictly Necessary Always Active

These cookies are essential for core website functions such as security, session integrity, and cookie preference storage. They cannot be disabled.

  • _cf_bm: Distinguishes humans from bots (Cloudflare) · 30m
  • _cfuvid: Ensures secure browsing (Cloudflare) · Session
  • __hs_initial_opt_in: Prevents HubSpot's banner · 7 days
  • _gtm_debug: GTM debug mode (testing only) · Session
Analytics

These cookies help us understand how visitors interact with the site so we can improve content and performance. All data is aggregated and anonymous.

  • _ga, _gid, _gat: Google Analytics · Session – 2 years
  • __hstc, hubspotutk, __hssrc: HubSpot visitor tracking · 13 months
  • __hs_opt_out: HubSpot opt-out preference · 6 months
Marketing & Targeting

These cookies allow us and our partners to serve personalised ads and measure campaign performance.

  • _gcl_au, _gcl_dc: Google Ads conversion tracking · 90 days
  • IDE: Google Display Network personalisation · 1 year
  • _fbp: Meta / Facebook remarketing · 90 days
  • li_gc, _li_fat_id, bcookie: LinkedIn tracking · 1–24 months
  • guest_id, personalization_id: Twitter/X analytics · 2 years