decentralized-identity / peer-did-method-spec

A rich DID method that has no blockchain dependencies. The verifiable data registry is a synchronization protocol between peers.
https://decentralized-identity.github.io/peer-did-method-spec/index.html
Apache License 2.0
27 stars 17 forks source link

method 3 service id property encoding/decoding #39

Closed TimoGlastra closed 2 years ago

TimoGlastra commented 2 years ago

I'm currently implementing the peer did spec in aries framework javascript and wondering how service ids should be encoded/decoded when using method 3 did documents.

The spec mentions:

Add id attribute according to the form #service

It seems incomplete, or maybe I'm just not sure how to interpet this. Looking at the example did document, the id is not included in the service block before being encoded, but the decoded did document contains the service id of #didcommmessaging-0.

Is there a process to generate consistent ids for peer did documents?

dhh1128 commented 2 years ago

Tagging @TelegramSam , who may have a clearer idea about the intentions of this verbiage.

TimoGlastra commented 2 years ago

Question answered by looking at the python peer did implementation!

The service id should be lowercase variant of the service type + index:

peer_did + "#" + service_type.lower() + "-" + str(i)

Will try to make a PR to clarify this in the spec soon