Skip to content

Add support for Verifiable Credentials Data Model v2.0 #149

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

Closed
parviz-mv opened this issue Aug 11, 2023 · 7 comments
Closed

Add support for Verifiable Credentials Data Model v2.0 #149

parviz-mv opened this issue Aug 11, 2023 · 7 comments

Comments

@parviz-mv
Copy link

VC Data Model v2.0 introduces new contexts:

"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"

When I try to issue a credential with a new contexts:

const credential = {
  "@context": [
    "https://www.w3.org/ns/credentials/v2",
    "https://www.w3.org/ns/credentials/examples/v2",
  ],
  id: "https://example.com/credentials/1872",
  type: ["VerifiableCredential", "AlumniCredential"],
  issuer: "https://example.edu/issuers/565049",
  validFrom: date.toISOString(),
  validUntil: untildate.toISOString(),
  credentialSubject: {
    id: "did:example:ebfeb1f712ebc6f1c276e12ec21",
    alumniOf: "Example University",
  },
};
const verifiableCredential = await vc.issue({
  credential,
  suite,
  documentLoader,
});

I got an error:

Error: "https://www.w3.org/2018/credentials/v1" needs to be first in the list of contexts.

Also, if I use v1 contexts with a new validFrom and validUntil properties, credential successfully issued, but contains issuanceDate property which was renamed to validFrom in v2.0 spec:

{
  '@context': [
    'https://www.w3.org/2018/credentials/v1',
    'https://www.w3.org/2018/credentials/examples/v1'
  ],
  id: 'https://example.com/credentials/1872',
  type: [ 'VerifiableCredential', 'AlumniCredential' ],
  issuer: 'https://example.edu/issuers/565049',
  validFrom: '2023-08-11T10:07:34.116Z',
  validUntil: '2023-08-11T10:09:34.116Z',
  credentialSubject: {
    id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
    alumniOf: 'Example University'
  },
  issuanceDate: '2023-08-11T10:07:34Z',
  proof: {
    type: 'Ed25519Signature2020',
    created: '2023-08-11T10:07:34Z',
    verificationMethod: 'did:example:1234#z6MknsvN6TxRX8WQ3tC1MToBp9Wc6EX2jCYnVTnkNcXrDCg3',
    proofPurpose: 'assertionMethod',
    proofValue: 'z3m5SNbh5PGn7LYv2mZKLwNvyGKpV6mSytuDdWF4Xziv1pfkUNpiGFiRjTwRxX9kXR3LNshUnRM3tieBP3meqGAry'
  }
}
@JSAssassin
Copy link
Contributor

@parviz-mv Support for Verifiable Credentials (VC) Data Model 2.0 is currently under development. You can find the ongoing work in this PR: #148

@parviz-mv
Copy link
Author

@JSAssassin Got it, thanks!

@bparth24
Copy link

Hello @JSAssassin cc: @parviz-mv

  1. any updates on this issue?
  2. As you mentioned support for VC Data Model 2.0 is under development. Do you have any rough estimate of when it will be done/available?

@aljones15 aljones15 mentioned this issue Jun 26, 2024
12 tasks
@aljones15
Copy link
Contributor

aljones15 commented Jun 26, 2024

@bparth24 @parviz-mv you may use the existing release candidate for VC 2.0 here: #148

Also do note: the VC 2.0 context is changing relatively soon: digitalbazaar/credentials-v2-context#10

The R.C. has been reviewed multiple times so I believe the major hold up at this point is continued changes in the VC 2.0 spec and also some changes in dependent libraries (we want the newer version of jsonld.js in the next release).

p.s. any feedback or review comments are welcome.

@bparth24
Copy link

@bparth24 @parviz-mv you may use the existing release candidate for VC 2.0 here: #148

Also do note: the VC 2.0 context is changing relatively soon: digitalbazaar/credentials-v2-context#10

The R.C. has been reviewed multiple times so I believe the major hold up at this point is continued changes in the VC 2.0 spec and also some changes in dependent libraries (we want the newer version of jsonld.js in the next release).

p.s. any feedback or review comments are welcome.

@aljones15 thank you for the response.

@aljones15
Copy link
Contributor

aljones15 commented Oct 7, 2024

@bparth24 @parviz-mv The next major release of this library with VC 2.0 support has been released recently. https://www.npmjs.com/package/@digitalbazaar/vc

Are you ready to close this issue? Any problems with the latest release?

@parviz-mv
Copy link
Author

Yes, of course. VC 2.0 is supported by the latest version. Thanks!

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

No branches or pull requests

4 participants