-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix: corrections and clarifications for did:peer:2 #62
fix: corrections and clarifications for did:peer:2 #62
Conversation
Signed-off-by: Daniel Bluhm <[email protected]>
A couple of decisions to call out: The method for generating identifiers for verification methods that I proposed follows the same method used in I added some clarifications on how multiple services are expressed with did:peer:2. This is done by appending more I added clarification that services should include I added clarification that common string abbreviation should recursively descend through the service object. I added clarification around what verification method types should be used for a given multibase encoded key, specifically selecting the "2020" variants so we get I added clarification that when using these verification method types, additional contexts are required in the resolved document. |
IN AFJ we use sort of the same method as did:key (but without the z prefix). I think i got this from the spec.
This doesn't really matter right? As long as i can resolve the Multibase key to a verification method and can use that, i could use 2018, 2020, or even JsonWebKey2020. You also have MultibaseKey2022 now I think. I've seen a lot of did:key resolvers that do things slightly different, but they all succeed in extracting the needed the key material. |
@TimoGlastra the problem is not extracting the key material. Is the name/ref/id to give the key. I do agree with @swcurran to use a index base name. Do over complicated stuff. Ex: |
I don't have strong feelings about the IDs; however, I agree that just indexing them based on order they appear in the DID seems like the simplest and least "arbitrary" scheme. @TimoGlastra what do you think of going with
I think this is true. How your did:peer:2 resolver decides to decode the document influences internal handling more than it does anything external. I'm okay with relaxing these constraints. I believe the real critical piece is consistent identifiers for the resources in the document and being able to reliably handle references to those resources. |
Signed-off-by: Daniel Bluhm <[email protected]>
I like this. |
Looks good to me. Really want to get to did:peer:4, so am a little worried about the comment above that the libraries that do did:peer:2 as documented here, but if others think that is reasonable, I won’t argue. That said, the sooner we deprecate numalgos 0, 1, 2 and 3, the better. |
I like that key for numalgos 2 gets define in the specs. I would prefer index-based. For being more easy. |
@FabioPinheiro literally every implementation I'm aware of has done it differently, unfortunately. peerdid-python uses characters 1-9 of the multibase/multicodec encoded key. AFJ is using multibase minus the z. Agents tested in the didcomm v2 mediator test suite use the full multibase, as you've described. The didcomm-demo follows peerdid-python (mostly since interacting with a mediator using that library ended up being first integration target). So I think no matter how we shake it, there's going to need to be changes in one library or another. I'm not sure how best to address that besides continuing to communicate about this interop challenge (which, in my view, is still less problematic after these changes than it was before) and implementing the changes in well known locations like the didcomm v2 mediator test suite, didcomm demo, ACA-Py, AFJ, etc. If we hit those well known projects, I think we should eventually get a majority of the ecosystem by osmosis. Still, better yet, if implementations don't want to mess around with fixing did:peer:2, we can encourage everyone to push to did:peer:4. I think this is also an acceptable outcome and would consider these clarifications to be more for posterity's sake rather than the real solution to the interop challenges presented by an ambiguous did:peer:2 spec. |
@TimoGlastra I've added a note conceding that exactly how you choose to "resolve" the DID doesn't matter too much as long as it's only used internally and the |
Signed-off-by: Daniel Bluhm <[email protected]>
Signed-off-by: Daniel Bluhm <[email protected]>
Signed-off-by: Daniel Bluhm <[email protected]>
I've implemented a minimal did:peer:2 library in python demonstrating these fixes: https://github.com/dbluhm/did-peer-2 |
I took a deeper look at what is intended by Given this, I think I will adjust the spec further to represent verification methods using Multikey which will simplify things in two ways. First, there's no need to vary the context depending on the presence of keys of different types. And second, there's no need to transform the key from it's serialized representation to remove the multicodec prefix. |
Signed-off-by: Daniel Bluhm <[email protected]>
Signed-off-by: Daniel Bluhm <[email protected]>
Signed-off-by: Daniel Bluhm <[email protected]>
Speaking frankly, I felt that the peerdid library was a bit overly complicated. On top of that, peerdid is not up to date with the corrections proposed in this PR to the did:peer method specification: decentralized-identity/peer-did-method-spec#62 did-peer-2 is a minimal implementation of did:peer:2 and did:peer:3. It is up to date with the above PR. The corrections to the spec and the library lend themselves to a simpler implementation of the did:peer:2 and did:peer:3 resolvers. This refactor supports work to add did:peer:2 support to OOB + DID Exchange. New in this PR is a cleanup mechanism for the did:peer:3 to did:peer:2 mapping records. When a connection is deleted, we check whether there are any potential mappings to remove. Signed-off-by: Daniel Bluhm <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, @dbluhm — thanks for getting this done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just added some small notes that I think can still be improved
Oh I forgot to submit my review
Signed-off-by: Daniel Bluhm <[email protected]>
As the author of the did:peer:4 generation algorithm, I obviously would like to see us all move to that method. However, it seems inevitable that we'll continue to use did:peer:2, at least for a while. To ease interop challenges across did:peer:2 implementations, I propose these clarifications to the did:peer:2 spec.
I believe this should address the concerns raised in #56.
cc @TelegramSam @FabioPinheiro @swcurran @genaris @TimoGlastra