hyperledger/identus-mediator

Address did:peer:2 spec changes

Closed this issue · 0 comments

There are some spec changes for did:peer:2... that are breaking changes for DID Comm.

The changes were merged in this commit decentralized-identity/peer-did-method-spec@a5eca6b

Both issues have possible mitigation solutions that allow a smoother migration.
Although previous implementations are considered faulty! Since DID methods have no version.
This is important to be fixed to achieve interoperability

Dependencies

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. Because 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).