Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ref-imp): remove controller and add context to deactivated docu… #1006

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

isaacJChen
Copy link
Contributor

…ment

@isaacJChen isaacJChen merged commit c07bfec into master Jan 20, 2021
@@ -18,7 +18,6 @@
"verificationMethod": [
{
"id": "#publicKeyModel1Id",
"controller": "",
Copy link
Contributor

@OR13 OR13 Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please read did core before making changes to test vectors.... https://w3c.github.io/did-core/#verification-methods

The properties MUST include the id, type, controller, and specific verification method properties, and MAY include additional properties.

I ideally you would also have tests that showed that JSON-LD was valid.

Copy link
Collaborator

@sandrask sandrask Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OR13 This change is my fault. I read the spec but I looked at wrong section (controller at top level of the document). Sorry about this. Can the controller be empty though?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the controller should equal didDocument.id in order for verifiable credentials to be valid.... see: https://github.com/OR13/did-params-and-you/blob/master/examples/case-0-legal-working.json#L35

and our version of sidetree: https://github.com/transmute-industries/sidetree.js/blob/main/packages/core/src/DocumentComposer.ts#L65

If his repo had CI tests that used the result of test vectors, with verifiable credentials, it would be obvious when breaking changes like this were introduced.

btw, the reason that "" is legal here, is because of @base / relative IRIs in sidetree did documents....

You can check the nquads to see that its the same...

if the iri is blank, it will get mapped to the didDocument.id... making what we had before legal (but only for relative ref based did documents).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it is legal because it will be populated when processing @base - thank you for this clarification.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly recommend against returning the empty string for the controller property.... if makes sidetree look different than every other did method, and its not guaranteed to work accross JSON-LD implementations... the controller property should match the didDocument.id.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching it. I will have a PR out fixing this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants