-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[proposal] Add Support for DIDCommv2 Mediation #1051
Comments
I don't see this protocol explicitly mentioned, but I'm assuming the Pickup protocol is what would be used here. |
Has anyone started work on this bounty? I am interested in taking it on, although I see several folks on the Gitcoin issue have also expressed interest. |
@codynhat I thought I had updated the description to mention the Pickup protocol, but yes you are correct that is what should be used for the recipient to pick up their messages. If you were to apply on the Gitcoin bounty, I would approve you to work on it. None of the other applicants so far convinced me that they could do the work correctly/effectively, but since you've already done some work in our codebase (and in DIDComm specifically) I know you could do it. |
@nickreynolds I have a question about this part. What is the best practice for a plugin that needs to store some state? Should the Looking at |
@codynhat Can I ask what kind of new data entities you think you'll need to add? I was thinking that this could possibly be handled by just using the metadata on a Message |
Looking through the Mediator Coordination protocol, it looks like the mediator will need a way to store which DIDs it has granted mediation for, as well as a keylist for each of those DIDs. For the Pickup protocol, the mediator needs to store a queue of messages that haven't been picked up and a
All of this state can be inferred from messages, so I think it could all be done with metadata. Are there examples of querying metadata on |
@nickreynolds Taking a closer look, it appears that message metadata cannot be queried in DataStoreORM https://veramo.io/docs/api/core.tmessagecolumns Should a column be added for metadata? |
ok, so it seems like both issues could be addressed by extending existing entities in My opinion is that those would likely be acceptable modifications to make in I think that since this is probably the easiest solution (compared to creating a new database), you could probably move forward this way and you wouldn't be wasting too much time even if we have to refactor later? You're sure you could manage the queue without creating a new table, as long as you can modify |
Also, I was reviewing the Mediator-Coordinator spec while I was trying to answer you, and I'm actually a bit confused on the purpose of the |
I think this makes sense since most of the state is about an
I don't think this can be done by just storing a
From my understanding, the keylist is a way to store additional hops privately, only telling the mediator about the hops and not having them in the public DID Document. |
ah, I see. Tbh, I don't think this first implementation necessarily needs to support these optional extra hops. Similarly, I don't think we need to support
I think this makes sense, assuming you mean the JWEs that are in Either way, I think it's fine for you to add anything to entities (or create new entities) that you need to support these protocols. These are basically |
Sounds good. And yea, it makes sense to save one for each key. The Pickup protocol takes a |
Background
The DIDComm v2 Specification was approved by DIF a few months ago. While Veramo already has support for much of this version of the spec, it currently lacks support for the "mediation" concept, which can be especially useful for bringing DIDComm to end-user agents, which may not be always online or expose http endpoints
This issue represents the work required to implement and demonstrate the DIDComm Messaging Routing Protocol as well as the Mediator Coordination Protocol.
Requirements
- create a Veramo plugin that allows Veramo agents to act as DIDComm Mediators
Plugin should be a MessageHandler that attempts to handle messages after they've been processed by DIDCommMessageHandler
Plugin should expose some functionality to allow agent to "request mediation", update DIDDocument with Mediator info if mediation granted, and save info (on Mediator-side) required to eventually forward messages to requester (the Mediator Coordination Protocol)
For this implementation, we can assume that the recipient will eventually send an http request to the mediator to check for messages
- update
didcomm
plugin to support mediation viaforward messages
https://github.com/uport-project/veramo/blob/next/packages/did-comm/src/didcomm.ts#L536Must support any number of "forward message" wrappers required. Should demonstrate sending a DIDComm message that passes through at least 2 mediators.
Likely requires changes to
packDIDCommMessage
andsendDIDCommMessage
.- Demonstrate functionality in a browser-based Veramo agent using
did:ethr
to specify mediator, set up relationship with Mediator, and poll mediator (via http request) to receive messages.This can be added in a branch of https://github.com/veramolabs/agent-explorer/
Testing
Extensive testing will be needed to cover both the process of sending a message to a recipient via a mediator, as well as the process of setting up the mediation relationship.
forward
message, and send it to the Mediator Agent.As many failure cases as reasonable should also be added.
While not a strict limit, implementers should aim for a code-diff-coverage of ~75%
Constraints
Resources
https://didcomm.org/book/v2/routing
https://didcomm.org/mediator-coordination/2.0/
The text was updated successfully, but these errors were encountered: