credo-ts: DIDCommMessaging Service Endpoint is in the wrong format

It was recently brought to my attention that the DIDComm services being generated from AFJ are either using the wrong service type (DIDCommMessaging vs did-communication) or that the service block isn’t structured according to the spec of it’s type. Upon closer inspection, I believe the situation to be the latter case.

It’s been observed that when generating DIDs for did:peer:2 with a service endpoint type of DIDCommMessaging, the serviceEndpoint follows the format of the did-communication endpoint type instead of the DIDCommMessaging endpoint type.

Current service block format:

    {
      "id": "#service",
      "type": "DIDCommMessaging",
      "serviceEndpoint": "https://example.com",
      "recipientKeys": [
        "#key-2"
      ],
      "routingKeys": [],
      "priority": 0
    }

Expected service block format:

    {
      "id": "#service",
      "type": "DIDCommMessaging",
      "serviceEndpoint": {
        "uri": "https://example.com",
        "accept": [
          "didcomm/v2",
          "didcomm/aip2;env=rfc19"
        ],
        "routingKeys": []
      }
    }

About this issue

  • Original URL
  • State: open
  • Created 4 months ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

https://github.com/sicpa-dlab/peer-did-jvm

My understanding from did-core spec is that the service object must have those three fields but may define other extra fields:

Each service map MUST contain id, type, and serviceEndpoint properties. Each service extension MAY include additional properties and MAY further restrict the properties associated with the extension.

Anyway, I think this is something we cannot modify at this point, since those old service types do rely on those fields. Surely we’ll all agree as soon as we properly support this new DIDCommMessaging endpoint (hopefully soon!!).

I think abbreviation is not the issue. The problem is the structure of the “service” object. According to the spec, a service object has only three fields, id, type and serviceEndpoint. Other fields in the service object will be ignored or throw an error depending on the implementation.

I’m currently testing with https://github.com/beatt83/peerdid-swift, ~and https://github.com/sicpa-dlab/peer-did-jvm will behave the same.~