Verification method controller property when working with intermediate DID document representations
A DID method I am working on (did:btc1) supports a method-id that is an encoding of an intermediate DID document representation. E.g. did:btc:<intermediateDocHash>.
In these cases, what value should I put in the controller property of the intermediate representations verificationMethods?
The controller property is a required field for verificationMethod. I believe this can be a relative URL, but I am not sure what is the appropriate relative URL in this case. Is it just empty quotes? Or is it #id? Or something else.
Alternatively, I could populate the controller properties of the verificationMethods in the intermediate DID document representation after generating the DID just as I do with the id field. But ideally there is a relative URL solution I can use.
It cannot be a relative URL.
See: https://www.w3.org/TR/did-core/#verification-methods
The value of the controller property MUST be a string that conforms to the rules in 3.1 DID Syntax.
So it should be the same DID as in the top-level id field.
Interesting, so the pattern should be.
- Construct the intermediate DID document (Without the DID identifier)
- Generate the DID identifier
- Fill in necessary fields with the DID:
- didDoc.id = did
- didDoc.verificationMethods[n].controller = did (for all n verificationMethods)
I guess you probably should also check if a verificationMethod already has a controller before setting it aswell. Since people could create intermediate DID documents with controllers for verificationMethods that are intentionally not the DID of the document.
After further discussion, I think the approach is to set a placeholder value for the did and use that throughout the intermediate DID document representation. Then the resolver can use a find and replace to put in the correct DID in all the intended locations.
Not sure if any action is required in the DID spec. Possibly some additional text to the Note on intermediate representations in the DID Subject section - https://www.w3.org/TR/did-core/#did-subject.
PR #894 has been raised to address this issue. This issue will be closed once PR #894 has been merged.
PR #894 has been merged; closing.