Indicio-tech / pydid

Python library for validating, constructing, and representing DIDs and DID Documents
Apache License 2.0
11 stars 12 forks source link

VerificationMethod.controller can be reference for did:peer:2 #67

Closed Jsyro closed 1 year ago

Jsyro commented 1 year ago

https://identity.foundation/peer-did-method-spec/#generation-method

This spec specifically allows for #id to be an acceptable value for a controller and act as a reference to the DIDDocument ID without needing to populate it with the full value.

dbluhm commented 1 year ago

According to the DID Core specification, the controller property of verification methods MUST be a string that conforms to the DID Syntax.

When the DID Peer specification allows for #id for the controller, I believe this was intended for use in the "genesis variant" of the DID Doc structure used in method 1 (an unfortunate amount of the DID peer spec has not been updated since the addition of method 2). This "genesis variant" is not the final form of the document; when resolved, the DID Document should correctly have the DID as the controller and not a DID URL. PyDID models should be used for representing the resolved variant and not the genesis variant; however, my intent with these models was always to make it simple for users to subclass and customize as required. You can create a subclass with the Union[DID, DIDUrl] for controller and use this to represent the genesis variant of the doc.

dbluhm commented 1 year ago

Discussed out of band as well and we agree that this PR can be closed.