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

Add Support for the VC Data Model #27

Merged
merged 5 commits into from
Jan 31, 2020
Merged

Conversation

OR13
Copy link
Contributor

@OR13 OR13 commented Jan 17, 2020

Attempting to address: #25

This PR Adds tests for supporting for the JWT Proof format of the VC Data Model.

I used did:ethr and https://github.com/decentralized-identity/did-jwt-vc

To demonstrate the VC Data Model format.

I have also included support for Linked Data Proofs, because it was trivial to show how they can be supported.

No spec changes have been made, and no changes to the demo in its current form have been made.

The security context of the JWT Proof Variant of VC Data Model is the same as it was before. No JSON-LD processing is occurring (in fact there appears to be very little validation of the vc data structure performed by did-jwt-vc).

It appears that the spec language would need to be revised to align with the VC Data Model, further discussion is required.

Copy link
Member

@awoie awoie left a comment

Choose a reason for hiding this comment

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

@OR13 IMO, the JWT in the existing spec does not have to match the VC JWT as they are different concepts. One could use DIDs without VCs. I expect that many people would opt in for that. Why don't we use the following format the VC? Would there be any issue with the RDF graph?

JWT-Proof style:

{
  "sub": "did:example:ebfeb1f712ebc6f1c276e12ec21",
  "iss": "did:example:ebfeb1f712ebc6f1c276e12ec21",
  "exp": 1573029723,
  "vc": {
    "@context": [
      ...
    ],
    "type": ["VerifiableCredential", "DomainLinkageAssertion"],
    "credentialSubject": {
      "domain": "example.com"
    }
  }
}

LD-Proof style:

{
  "@context": [
    ...
  ],
  "type": ["VerifiableCredential", "DomainLinkageAssertion"],
  "expirationDate": "...",
  "issuer": "did:example:ebfeb1f712ebc6f1c276e12ec21",
  "credentialSubject": {
    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
    "domain": "example.com"
  },
  "proof": {  }
}

@OR13
Copy link
Contributor Author

OR13 commented Jan 17, 2020

@awoie I don't think the examples you provided would be an issue, they are certainly more compact. The context can only provide definitions for things underneath it, so there would be no semantic definition for sub and iss... but I'm not sure we need that, the vc data model would probably have discussed this in depth, there most be a reason they chose the structure we have today.

@OR13 OR13 requested a review from gjgd January 17, 2020 16:14
@csuwildcat
Copy link
Member

Why can't we just leave the existing top-level properties and current validation rules, then specify that the domain property must also be present inside the VC portion to ensure validating it that way also works? How is that not valid?

@awoie
Copy link
Member

awoie commented Jan 20, 2020

@awoie I don't think the examples you provided would be an issue, they are certainly more compact. The context can only provide definitions for things underneath it, so there would be no semantic definition for sub and iss... but I'm not sure we need that, the vc data model would probably have discussed this in depth, there most be a reason they chose the structure we have today.

@OR13 The examples for LD-Proofs and JWT that I provided are semantically equivalent. By following the W3C VC spec one will be able to construct a JSON-LD credential from the JWT. So, I would be in favour of using my examples in the spec. Note, iss, sub and exp will be mapped onto issuer, id and expirationDate after applying the transformation rules, so there is a semantic definition of these three properties.

@OR13
Copy link
Contributor Author

OR13 commented Jan 31, 2020

Screen Shot 2020-01-31 at 3 31 43 PM

@OR13 OR13 requested review from csuwildcat and tplooker January 31, 2020 22:13
@OR13
Copy link
Contributor Author

OR13 commented Jan 31, 2020

I have added tests for creating and verifying that a given did is linked via the configuration.

I think the next step is to merge this demo and then update the spec to reflect the VC Data Model as is.

@OR13 OR13 merged commit 0532ed2 into master Jan 31, 2020
@gjgd gjgd deleted the feat/explore-vc-data-model branch February 2, 2020 10:10
@awoie
Copy link
Member

awoie commented Feb 3, 2020

@OR13 why was the nesting of domainLinkageAssertion necessary? Isn't that the point of JSON-LD to avoid name clashes, so it would have been save to remove that nesting?

@OR13
Copy link
Contributor Author

OR13 commented Feb 3, 2020

@awoie good question, I have opened this issue to gather feedback: #29

I made it that way because I thought there might at some point in the future be other links of assertions in the credential subject... but I'm happy to make the credential look however we want.

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.

4 participants