peer-did-method-spec icon indicating copy to clipboard operation
peer-did-method-spec copied to clipboard

Address did:peer:2 spec changes

Open FabioPinheiro opened this issue 2 years ago • 8 comments

The goal of this ticket is just to track the adoption of the community for the specs change.

There are some spec changes for did:peer:2... that are breaking changes for DID Comm. In order to achieve interoperability. It's important to fix libraries that implement did:peer:2 and update all applications that depend on those libraries.

I'm pretty sure this list is far from being complete. Feel free to add to this list. Also, help us contact the maintainers by creating tickets on the respective libraries.


Context

The changes were merged in this commit https://github.com/decentralized-identity/peer-did-method-spec/commit/a5eca6b4e0e41f70364949f7008c30879cbcb3ad Both issues have possible mitigation solutions that allow a smoother migration. Although previous implementations are considered faulty! Since DID methods have no version.

Issue 1

The first is to fix the encoding to follow the DID Document. The DID Document's service example in did:peer looks like

"service":{
  ...
  "serviceEndpoint": "https://example.com/endpoint",
  "routingKeys": [...],
  "accept": [...]
}

But it should instead look like

"service":{
  ...
  "serviceEndpoint": {
    "uri":"https://example.com/endpoint",
    "routingKeys": [...],
    "accept": [...]
  }
}

We should make sure that our did:peer used on the applications are encoded correctly. when decrypting you look for that key

Issue 2

The second problem is about the id of the keys (kid). It was unspecified before. So each library generates the kid in its own way.

The major problem is that the kid is used on the DID Comm message itself. More specifically the field skid in the message's Protected Header is the kid of the sender and the recipients.header.kid is also the kid recipient. When decrypting you look for that key. So the agent encrypting and the agent decrypting MUST have the same or an equivalent resolver (the key id needs to be deterministic).

FabioPinheiro avatar Oct 27 '23 12:10 FabioPinheiro

https://identity.foundation/peer-did-method-spec/ I was expecting the specs web pages to be updated by the GitHub job. @dbluhm @swcurran do you know if the job failed or do we still need to do something?

FabioPinheiro avatar Oct 27 '23 13:10 FabioPinheiro

https://identity.foundation/peer-did-method-spec/ I was expecting the specs web pages to be updated by the GitHub job. @dbluhm @swcurran do you know if the job failed or do we still need to do something?

It should have been updated... good catch, I'll investigate what went wrong!

dbluhm avatar Oct 27 '23 14:10 dbluhm

Thanks for putting this issue together, by the way! This is excellent. We'll work on getting the didcomm-demo updated as well as the Indicio Mediator (no public repo to link to at the moment but feel free to add to your list). We will likely update those two projects in tandem.

dbluhm avatar Oct 27 '23 14:10 dbluhm

For sicpa peer-did-jvm library I have raised a PR which is an initiative to start the work required for the changes in PeerDID Spec https://github.com/sicpa-dlab/peer-did-jvm/pull/37 This PR doesn't handle all the PeerDID Spec changes required.

mineme0110 avatar Dec 04 '23 14:12 mineme0110

Looking at the list, there's a library under the uniresolver that is missing. The veramo labs depends on a library that handles the actual parsing of DIDs and here's a PR for the fixes https://github.com/aviarytech/did-peer/pull/3

TheTechmage avatar Dec 07 '23 15:12 TheTechmage

Thanks @frostyfrog. So now we can update the version of @aviarytech/[email protected] in veramolabs/peer-did-resolver

FabioPinheiro avatar Dec 15 '23 01:12 FabioPinheiro

@FabioPinheiro @frostyfrog I bumped the versions of the libraries in the uniresolver chain of dependencies. The last step is merging the changes in teh universal resolver repo: https://github.com/decentralized-identity/universal-resolver/pull/395

mirceanis avatar Jan 23 '24 13:01 mirceanis

@FabioPinheiro @frostyfrog I bumped the versions of the libraries in the uniresolver chain of dependencies. The last step is merging the changes in teh universal resolver repo: decentralized-identity/universal-resolver#395

That is great. I'm seeing a lot of fix/PRs for this lately. Let me try to update the list

FabioPinheiro avatar Jan 23 '24 14:01 FabioPinheiro