did-core icon indicating copy to clipboard operation
did-core copied to clipboard

Verification method controller property when working with intermediate DID document representations

Open wip-abramson opened this issue 1 year ago • 3 comments

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.

wip-abramson avatar Oct 21 '24 16:10 wip-abramson

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.

peacekeeper avatar Oct 25 '24 14:10 peacekeeper

Interesting, so the pattern should be.

  1. Construct the intermediate DID document (Without the DID identifier)
  2. Generate the DID identifier
  3. 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.

wip-abramson avatar Oct 25 '24 14:10 wip-abramson

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.

wip-abramson avatar Dec 03 '24 16:12 wip-abramson

PR #894 has been raised to address this issue. This issue will be closed once PR #894 has been merged.

msporny avatar May 31 '25 21:05 msporny

PR #894 has been merged; closing.

msporny avatar Jul 10 '25 13:07 msporny