Closed aaitor closed 5 years ago
Why wouldn't you just have id
s for each service, i.e.:
"service": [
{
"id": "did:example:123456789abcdefghi#myServiceId1",
"type": "VerifiableCredentialService",
"serviceEndpoint": "https://example.com/vc/"
}, {
"id": "did:example:123456789abcdefghi#myServiceId2",
"type": "VerifiableCredentialService2",
"serviceEndpoint": "https://example2.com/vc/"
}
]
This should also be easy to use with a standard JSON-LD / RDF processor (and be compatible with the service
matrix parameter).
Hi @peacekeeper , yep we are using already that. But for finding a specific entry of the services
array it would be necessary to read the elements of the array matching the id
.
For example, if you persist the DID Document in a datastore (search engine or nosql like Elastic or Mongo) is not possible to run efficient queries to find a specific entry unless.
In the services
case, where different kind of services can be provided by the same entity, it would be quite interesting to provide a way to find specific services. If the DID Document are going to be stored off-chain mainly, and especially when you have a lot of different DID Documents and services, search and retrieve specific information efficiently is a nice feature.
Closing because we've moved it to the DID WG did-spec repo. https://github.com/w3c/did-spec
Currently, in the DID spec the
services
entry included in the DID Document is an array. An array doesn't enforce position so when you use a DID Document with multiple services, to search a specific subentry of the differentservices
included is necessary to scan the complete array.Typically when DID Documents are used to persist information in off-chain systems, modeling allowing to retrieve a specific
service
by akey
orindex
would be recommended to search inside a specific subtree of the DID Document & retrieve specific service information in a more efficient way.From JSON-LD spec:
https://json-ld.org/spec/latest/json-ld/#data-indexing
For implementation purposes, only would be necessary to change the
services
to be amapping
ordict
instead of anarray
: