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

Divergence from jsonld-signatures #64

Open
JaceHensley opened this issue May 5, 2021 · 1 comment
Open

Divergence from jsonld-signatures #64

JaceHensley opened this issue May 5, 2021 · 1 comment

Comments

@JaceHensley
Copy link

I was testing compatibility between linked-data-proof and jsonld-signatures and noticed some divergence here https://github.com/transmute-industries/vc.js/blob/master/packages/linked-data-proof/src/ProofSet.ts#L150 and here https://github.com/digitalbazaar/jsonld-signatures/blob/master/lib/ProofSet.js#L188. I believe the fix would be:

+ const context = document['@context'] || constants.SECURITY_CONTEXT_URL
  const proofSet = proofSet.map((proof: any) => ({
-   '@context': constants.SECURITY_CONTEXT_URL,
+   '@context': context,
    ...proof,
  }));

When testing that out I also noticed that vc.js will need to be updated too: https://github.com/transmute-industries/vc.js/blob/master/packages/vc.js/src/vc-ld/purposes/CredentialIssuancePurpose.ts#L62. The fix here I think would be:

  const issuer = jsonld.getValues(
    document,
-   'https://www.w3.org/2018/credentials#issuer'
+   'issuer'
  );
+ const issuerId = const issuerId = typeof issuer[0] === 'string' ? issuer[0] : issuer[0].id;
-  if (result.controller.id !== issuer[0].id) {
+  if (result.controller.id !== issuerId) {
    throw new Error(
      'Credential issuer must match the verification method controller.'
    );
  }

I tried to create a PR that fixes and tests these things but to do so I needed a signing suite that wasn't supported by sec-v2 context I tried using https://github.com/digitalbazaar/ed25519-signature-2020 but that requires the latest jsonld-signatures and that has other changes that impact compatibility (no more compact proof support)

@OR13
Copy link
Member

OR13 commented Jun 26, 2021

stumbled on this again today.

The main changes seem to be:

  1. SEC_V2 is not longer required when verifying / issuing
  2. documentLoader does dereference instead of resolve now.

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

2 participants