-
Notifications
You must be signed in to change notification settings - Fork 517
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
Investigate, debate and add support for Peer DID 3 to ACA-Py #2249
Comments
Existing work for Peer:did:1 to be repurposed for this new requirement. |
ok, been reading lots. Couple of question @swcurran This describes the did exchange itself (how to serialize and encode the document). https://identity.foundation/peer-did-method-spec/#multi-key-creation I'm trying to figure out what the spec actually says about those payloads? |
Regards the purposecodes. I think we need code that given a DIDDoc will encode it into a I’d say start with the DIDDoc we have today for peer DIDs, support that in a relatively generic way. That will uncover some other questions — like how far down the multibase encoded, multicodec-encoded rabbit hole we should go. Is there a library that we could depend on to provide that? It would be worth looking at how we are handling For other than Why @dbluhm @andrewwhitehead @TimoGlastra @ashcherbakov — any comments on this? Any existing code we should be using? |
@Jsyro — I was pointed to this repository within SICPA — https://github.com/sicpa-dlab/peer-did-python. You should definitely be looking at this. It will likely have most/all of what you need for |
Agree, it makes sense to use https://github.com/sicpa-dlab/peer-did-python. It doesn't have peer:did:3 support, but it's not so hard to add it there. |
I have been able to resolve did:peer:2's into the full did doc and generate the did from the document, with examples to work from. |
The library should be able to deal with padding — which is always a pain. Does the library also have did:peer:1 support? I notice that currently AFJ is using did:peer:1, so perhaps we do have to support that as well. Or we push on AFJ to move quickly to did:peer:2/3 support ASAP and skip the did:peer:1 stage. |
It does not appear to have did:peer:1 support. @andrewwhitehead ? |
Interesting Curveball, the spec actually provides a regex for identifying dids.... which allows for https://identity.foundation/peer-did-method-spec/index.html#matching-regex Should I open an issue on the spec? or in the sicpa library? or both? @swcurran @andrewwhitehead |
Method 1 support is a draft PR: sicpa-dlab/peer-did-python#46 |
Fascinating….my $0.02CDN (which is worth exactly that) would be to try the regex in the spec in the implementation and see if the tests pass (and add some more…). If it works, I’d say go with it…. But don’t listen to me. |
DID Spec conflict has been resolved here. Focused on constructing did:peer:2 from existing connection information. |
I'd like to get more eyes on this issue before we get too far on did:peer:3 |
Update: Working to integrate the peer-did-python library. https://github.com/sicpa-dlab/peer-did-python/ Would like to make all DID Documents extensions of the library DIDDocument class, with any modifications needed for each DIDMethod. However exisiting unqualified did's are not accepted by the library, so they need prefixed before being accepted. Unqualified DID's either need the prefix Few hurdles avenues to go from here. a) I could to try and migrate existing working code to leverage the library now, adding development time and tinkering with more existing working code. The library does not accept unqualified dids, so that is a pain point. I originally tried b) until the marshmallow validation blocked me, now I'm working with a) and trying to add the appropriate prefix JIT for the library classes to be used. Looking for input or support on where to go from here. @shaangill025? |
Sorry for the delay in replying to this. We talked about this yesterday, but adding here for completeness and to make sure we are in sync. The path the Aries community is planning to go for existing unqualified DIDs is to update them as follows:
We will have a “community coordinated update” which will formalize the process and timing for the upgrade, but basically:
|
As discussed as well, it appears it is the ACA-Py is making assumptions about the precise structure of DIDDocs that is not generalized to match the spec. Notably, what ACA-Py assumes is a verkey may in fact be a reference to a verkey that needs to be dereferenced. Confirmed with @dbluhm that the dereferencing step is not being done. |
Update: my immediate goal is to convert the connections protocol to create and recieve If I create a did/did_doc in the way defined by the example, the DIDDoc and DID are created, and sent as an aries message, however when the receiver resolves the did, it resolves the service entry to an I can construct the DIDDoc using the class constructors and add an instance of |
That’s a fun one! What constructor are you calling that requires a DID and DIDDoc and what is it you are constructing? Part of ACA-Py or one of the libraries you are using? |
@Jsyro What branch are you working from? Some of the challenges you're experiencing may stem from the problem solved by this PR (that really ought to get merged...): Indicio-tech/pydid#57 |
I've published a pre-release of pydid containing changes for supporting |
will carry fwd ( partially) |
Update for ACA-pug, @dbluhm 's merge of this PR resolve the serialization deserialization of the DIDDocument services. The active task is to change how acapy extracts ConnectionTargets from the DIDDocuments, to resolve the recipient_key reference instead of copying the string and assuming it is the verkey itself. After successfully getting a connection established using did's with Other items on the path to closing this issue are:
|
Update: Discovered the magic payload for the peer-did-python library to properly type the service classes. sicpa-dlab/peer-did-python#60 Migrated the required changes to the DIDExchange manager file and can create an OOB message, recieve an OOB message, and Establish a connection where both sides are using did:peer:2. |
Update: I have two agents that can send or receive the 'old' dids and DIDDocuments and consume them. Additionally there is a flag that allows for the sending of did:peer:2. These changes are prepared to consume an DIDExchange that uses a 'did:peer:2' |
Update (I'm away until the 15th): The DIDDoc class is only used for connections, but is being tested like it was built for multiple use cases. This means most of the tests are invalid and not representative of real situations. Connection did_docs (that use the RECORD_TYPE_DID_DOC='did_doc' storage type) will now be created using the peerdid library, which involves creating a new method that accepts the verkey and a service object, calling When loading a did_document from storage, if an exception is thrown, attempt a custom method that will assume the json loaded was from an obsolete "DIDDoc" object, extract the key details (ED25519 Key and Service), create a did:peer:2 and resolve_peer_did to create a new DIDDocument object, and updating the record in storage to the recovered value. In summary, there are three situations:
|
Some other notes/questions after more discussions. An open question @Jsyro and I discussed is about when a DID (the identifier) is used after a connection is created. It turns out that in DIDComm v1.0, the DID seems not to ever be used. All messages are sent, accompanied by the base58 Ed25519 public key, and that key is indexed by ACA-Py to allow finding the connection to which it is associated. In DIDComm v2.0, this changes (AFAIK), as the message can be accompanied by the key or a reference to the key — such as a I think we will need to resolve DIDs in the following ways for peer DIDs:
Other questions that came up. @dbluhm — let’s plan to talk with @Jsyro on Tuesday about these.
@Jsyro — re: questions about non-top level
In other words — anything non-standard in the ACA-Py test DIDDocs will be eliminated. |
Putting some thoughts down in advance of our discussion.
|
I was thinking the reverse — that on receipt, the In the DIDDoc, the I think this avoids the messiness of |
Interesting. I think my view derives from the idea that resolving a document where the ID doesn't match the DID being resolved is a problem. |
That’s where I started. But the more I thought about it, the more I thought that treating the DID as primarily a
|
Is it too late to pursue that direction? 😅 I think something like that would require relaxing some constraints in a few places. The DID Resolver expects to strictly resolve a DID for instance and dereferencing is defined to result in returning a portion of a document. I see what you mean about the existence of the did:peer:2 as being incidental. I don't feel strongly about whether the did:peer:2 itself sticks around. I think I am more strongly opinionated about what resolving a did:peer:2 should look like, though. Having it resolve to a document containing did:peer:3 might be a shortcut to our goals but it feels like a kludge. The DID Core spec says this about the
And then in the note below the section:
This feels more or less exactly like the relationship that exists between did:peer:2 and did:peer:3. I'm much more comfortable using mechanisms defined in the DID spec rather than coming up with our own conventions. However, I acknowledge that even following the |
update: peer_did_python.dids.resolve_peer_did decodes the components of the did:peer:2 as described, however the service entry has a recipient_key that is a DIDUrl that refers to one of the verificationmethods of the resolved diddoc, however the did:peer:2 encoding does not encode an A workaround that could be handled by the peer-did-python library, and potentially an issue with the spec. as raw verkey's in the recipient_key field is not recommended in DIDCommV1Service's, and DIDCommV2Service's don't use it. |
A follow up to issue #2156 — for high level details see the presentation and recording from today’s ACA-Pug meeting. Also relevant is the Peer DID Method Specification, where DID Peer 3 is defined.
In this ticket, we want to add support for did:peer:3 to ACA-Py such that when a DID initially created as a did:peer:2 is used for messaging, did:peer:3 is used in its place. I think (not certain) that only the peer of the other party would ever use this — I don’t think the creator of the DID ever references itself in a presentation.
The issue of two DIDs (the 2 and 3 forms) needs to be “handled” in the connection record and possibly the DID record. Perhaps “their_did” should always be the did:peer:3 whenever a DID Peer 2 is created? Or perhaps there needs to be the idea of a synonym DID so that multiple identifiers can be used for a single DID. That might be needed for the transition of unqualified DIDs to qualified ones, where we would like to use did:peer:3.
The text was updated successfully, but these errors were encountered: