Giter VIP home page Giter VIP logo

transmute-industries / verifiable-data Goto Github PK

View Code? Open in Web Editor NEW
52.0 10.0 21.0 85.6 MB

Open Source Decentralized Identifiers and Verifiable Credentials Infrastructure and Tooling

Home Page: https://transmute-industries.github.io/verifiable-data/smoke-test-react/

License: Apache License 2.0

JavaScript 8.53% TypeScript 91.47%
did vc decentralized-identifiers verifiable-credentials linked-data

verifiable-data's Introduction

Verifiable Data

CI CD

What is Verifiable Data?

Verifiable Data is the library that powers W3C Decentralized Identifiers & W3C Verifiable Credentials for Transmute.

Table of Contents

Development

Node Version

nvm install 16.14.2
nvm use 16.14.2
npm i [email protected] -g

Install build and run tests for all packages

git clone https://github.com/transmute-industries/verifiable-data.git
cd verifiable-data
npm i
npm t

Lerna Information

It is important for developers working in this repo to understand that lerna is used to manage and link off the package contained. For more information regarding what lerna is and why it's used, click here.

Common Lerna Commands

Below is a short list of the lerna commands you will encounter while working in this repo, along with some information on when they should be used.

  1. lerna bootstrap: This command is used to build and link all of the packages in the repo. This command takes a significant amount of time to complete and should be used very conservatively. In your typical development workflow, you should only run this once when starting on a task or after running npm install inside one of the packages.

  2. lerna link: This command is used to symlink all of the packages. This command is what you will want to run when working in a package, and you want all of the other packages to include the latest changes. This means you should be using this command very frequently.

IMPORTANT: It is vital when running these commands, that you do not ever exit the commands early. If you do exit early, your environment will become completely broken. Should this happen, you can always get to a fresh working state by running npm run install:clean. This command will clean out all of your packages, and then rebuild everything with lerna bootstrap.

License

Apache-2.0 © Transmute Industries Inc.

verifiable-data's People

Contributors

acarnagey avatar benjaminmoe avatar brownoxford avatar gjgd avatar haardikk21 avatar ipbyrne avatar kalinchernev avatar lleifermann avatar mprorock avatar nissimsan avatar or13 avatar timoglastra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

verifiable-data's Issues

VC JWT Subject claim

JWT Verifiable Credential output in JWS-Test-Suite in some cases has claim "sub":{}:
https://github.com/decentralized-identity/JWS-Test-Suite/blob/5084057e83142f17a7656ca8f9d439eea97f08d3/implementations/transmute/credential-0--key-0-ed25519.vc-jwt.json (Edit: or a non-empty object for sub: decentralized-identity/JWS-Test-Suite#54 (comment))
This appears to be a conversion of an object credentialSubject from a verifiable credential (credentialSubject):
https://github.com/decentralized-identity/JWS-Test-Suite/blob/85e1b77be6197e21489526315fc3f5ec1e484dfe/data/credentials/credential-0.json
But the sub claim value is supposed to be a StringOrURI according to https://www.rfc-editor.org/rfc/rfc7519.html#section-4.1.2
In the case of credentialSubject without an id property, it might make sense to omit the sub claim.

"type": "MISSING_PROPERTIES_IN_CONTEXT",

I am trying to create a credential and getting MISSING_PROPERTIES_IN_CONTEXT, I have verified json-ld and seems to be valid. Can you please suggest what I am missing?

My VC


{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://w3id.org/security/suites/jws-2020/v1"
  ],
  "id": "http://example.edu/credentials/3732",
  "type": [
    "VerifiableCredential"
  ],
  "issuer": {
    "id": "did:key:z6MkokrsVo8DbGDsnMAjnoHhJotMbDZiHfvxM4j65d8prXUr"
  },
  "issuanceDate": "2010-01-01T19:23:24Z",
  "credentialSubject": {
    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21"
  }
}

And the error

(node:41427) Warning: Accessing non-existent property 'abort' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
Error: credential is not valid JSON-LD: {
  "type": "MISSING_PROPERTIES_IN_CONTEXT",
  "details": [
    "credentialSubject",
    "issuanceDate",
    "issuer"
  ]
}
    at /Users/Code/research/testvc/node_modules/@transmute/vc.js/src/checkCredential.ts:58:11
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Thanks

vc.js fails to verify a MTR credential

On testing a MTR credential the library fails to expand the document on verification of the credential

{
      verified: false,
      error: VerificationError: Verification error(s).
          at /Users/adam/git/mute/verifiable-data/packages/linked-data-proof/src/verify.ts:33:22
          at processTicksAndRejections (internal/process/task_queues.js:93:5) {
        errors: [
          Error: The property "grade" in the input was not defined in the context.
              at strictExpansionMap (/Users/adam/git/mute/verifiable-data/packages/linked-data-proof/src/strictExpansionMap.ts:4:11)
              at _expandObject (/Users/adam/git/mute/verifiable-data/packages/ed25519-signature-2018/node_modules/jsonld/lib/expand.js:445:26)
              at Object.<anonymous>.api.expand (/Users/adam/git/mute/verifiable-data/packages/ed25519-signature-2018/node_modules/jsonld/lib/expand.js:248:9)
              at _expandObject (/Users/adam/git/mute/verifiable-data/packages/ed25519-signature-2018/node_modules/jsonld/lib/expand.js:795:35)
              at processTicksAndRejections (internal/process/task_queues.js:93:5)
              at Object.<anonymous>.api.expand (/Users/adam/git/mute/verifiable-data/packages/ed25519-signature-2018/node_modules/jsonld/lib/expand.js:248:3)
              at _expandObject (/Users/adam/git/mute/verifiable-data/packages/ed25519-signature-2018/node_modules/jsonld/lib/expand.js:795:25)
              at Object.<anonymous>.api.expand (/Users/adam/git/mute/verifiable-data/packages/ed25519-signature-2018/node_modules/jsonld/lib/expand.js:248:3)
              at Function.jsonld.expand (/Users/adam/git/mute/verifiable-data/packages/ed25519-signature-2018/node_modules/jsonld/lib/jsonld.js:325:18)
              at Function.jsonld.toRDF (/Users/adam/git/mute/verifiable-data/packages/ed25519-signature-2018/node_modules/jsonld/lib/jsonld.js:671:16)
        ]
      }
    }

Broken dependency in ed25519-signature-2018

"@transmute/credentials-context": "^0.7.0-unstable.6" should be a dependency and not a devDependency of @transmute/ed25519-signature-2018"

    Cannot find module '@transmute/credentials-context' from 'node_modules/@transmute/ed25519-signature-2018/dist/ed25519-signature-2018.cjs.development.js'

    Require stack:
      node_modules/@transmute/ed25519-signature-2018/dist/ed25519-signature-2018.cjs.development.js
      node_modules/@transmute/ed25519-signature-2018/dist/index.js
      packages/credential-w3c/src/ld-credential-module.ts
      packages/credential-w3c/src/index.ts
      __tests__/localAgent.test.ts

      at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:311:11)
      at Object.<anonymous> (node_modules/@transmute/ed25519-signature-2018/dist/ed25519-signature-2018.cjs.development.js:12:12)

when only using "@transmute/ed25519-signature-2018": "^0.7.0-unstable.6", in package.json.

update suite contexts

https://w3id.org/security/suites/ed25519-2018/v1
https://w3id.org/security/suites/ed25519-2020/v1
https://w3id.org/security/suites/x25519-2020/v1

for JWS and PGP

Update GitHub Pages Site for this Repo

We are currently using it to sanity test web compatibility of modules.

We should keep doing that, but it would be nice to use the github and npm apis to try and pull together some usage metrics and transparency for the packages hosted here.

something like this

Invalid issuanceDate for credential does not throw error

The following unsigned credential with an invalid issuanceDate is able to be signed.

    {
      '@context': [
        'https://www.w3.org/2018/credentials/v1',
        'https://www.w3.org/2018/credentials/examples/v1'
      ],
      id: 'http://example.edu/credentials/1872',
      type: [ 'VerifiableCredential', 'AlumniCredential' ],
      issuer: 'https://example.edu/issuers/565049',
      issuanceDate: {
        years: 1991,
        months: 7,
        date: 25,
        hours: 21,
        minutes: 33,
        seconds: 56,
        milliseconds: 789
      },
      credentialSubject: {
        id: 'https://example.edu/students/alice',
        alumniOf: 'Example University'
      }
    }

Will be signed in the ED25519-Signature suite.

    {
      '@context': [
        'https://www.w3.org/2018/credentials/v1',
        'https://www.w3.org/2018/credentials/examples/v1'
      ],
      id: 'http://example.edu/credentials/1872',
      type: [ 'VerifiableCredential', 'AlumniCredential' ],
      issuer: 'https://example.edu/issuers/565049',
      issuanceDate: {
        years: 1991,
        months: 7,
        date: 25,
        hours: 21,
        minutes: 33,
        seconds: 56,
        milliseconds: 789
      },
      credentialSubject: {
        id: 'https://example.edu/students/alice',
        alumniOf: 'Example University'
      },
      proof: {
        type: 'Ed25519Signature2018',
        created: '2021-10-15T12:33:56Z',
        verificationMethod: 'did:key:z6MktWjP95fMqCMrfNULcdszFeTVUCE1zcgz3Hv5bVAisHgk#z6MktWjP95fMqCMrfNULcdszFeTVUCE1zcgz3Hv5bVAisHgk',
        proofPurpose: 'assertionMethod',
        jws: 'eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..sSFwXkauRrVVmNmTJnRNK70WzU81gVz0mS9bJ6quIR5XyuIq2L29DS2zhJ8GKHjKkytLmR2MBVcfzRwBSDb0Cw'
      }
    }

The expected behavior is to throw an error when a date is found that doesn't match the schema.

Adding new packages causes CI to fail

#134

Screen Shot 2022-01-09 at 10 42 15 AM

This is caused by trying to be too smart with lerna, the package does not exist on main... because we are trying to add it.

We can try to merge the PR and see if the error resolves, but this makes us nervous and sad.

Credential issuer must match the verification method controller

Hi @OR13,

I tried to create signing key and passed to sidetree element did method to generate the did e.g.

did:elem:ganache:EiD351yY0XqnbCJN2MaZSQJMgG-bqmgFMDRGKawfu6_mZA

I used the same key to create the credential with the result

{
      "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://w3id.org/security/suites/jws-2020/v1"
      ],
      "id": "http://example.edu/credentials/3732",
      "type": ["VerifiableCredential"],
      "issuer": {
        "id": "did:elem:ganache:EiD351yY0XqnbCJN2MaZSQJMgG-bqmgFMDRGKawfu6_mZA"
      },
      "issuanceDate": "2010-01-01T19:23:24Z",
      "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21" },
      "proof": {
        "type": "JsonWebSignature2020",
        "created": "2010-01-01T19:23:24Z",
        "verificationMethod": "did:key:z6MkokrsVo8DbGDsnMAjnoHhJotMbDZiHfvxM4j65d8prXUr#z6MkokrsVo8DbGDsnMAjnoHhJotMbDZiHfvxM4j65d8prXUr",
        "proofPurpose": "assertionMethod",
        "jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..k_7t6h5IGSWFAqIlqru3zyZ0FDPQGo88p9jDeKC1yw8oxd7xj6B70tZNSaspWkMyWbXFmZ5yCO8dlZZ9_kKbAQ"
      }
    },

However, during the verification, there was an error: Credential issuer must match the verification method controller.

The documentLoader can resolve the did:elem:ganache:EiD351yY0XqnbCJN2MaZSQJMgG-bqmgFMDRGKawfu6_mZA and return the diddocument from the sidetree and it also can resolve the verificationMethod in the proof did:key:z6MkokrsVo8DbGDsnMAjnoHhJotMbDZiHfvxM4j65d8prXUr#z6MkokrsVo8DbGDsnMAjnoHhJotMbDZiHfvxM4j65d8prXUr.

JSON Web Signature Browser vs Node differences

the module works in node, but fails in the browser.

It looks like the browser does not convert the public key to a buffer, but the node module does...

from the node module:

Screen Shot 2022-01-16 at 2 53 25 PM

from the browser:

Screen Shot 2022-01-16 at 2 54 16 PM

npm install breaks on root

steps to repro:

  1. git clone [email protected]:transmute-industries/verifiable-data.git
  2. cd verifiable-data
  3. npm i

this error shows up. have tried 3x, same stuff.

npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build=false
npm ERR! 404 status code downloading tarball https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.11.0/node-v102-darwin-arm64.tar.gz
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | darwin | arm64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download 
npm ERR! node-pre-gyp info check checked for "/Users/gcohen/Development/verifiable-data/packages/bls12381-key-pair/node_modules/@mattrglobal/node-bbs-signatures/native/index.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.11.0/node-v102-darwin-arm64.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.11.0/node-v102-darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install error 
npm ERR! node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.11.0/node-v102-darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! stack     at Request.<anonymous> (/Users/gcohen/Development/verifiable-data/packages/bls12381-key-pair/node_modules/node-pre-gyp/lib/install.js:142:27)
npm ERR! node-pre-gyp ERR! stack     at Request.emit (node:events:532:35)
npm ERR! node-pre-gyp ERR! stack     at Request.onRequestResponse (/Users/gcohen/Development/verifiable-data/packages/bls12381-key-pair/node_modules/request/request.js:1059:10)
npm ERR! node-pre-gyp ERR! stack     at ClientRequest.emit (node:events:520:28)
npm ERR! node-pre-gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:618:27)
npm ERR! node-pre-gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
npm ERR! node-pre-gyp ERR! stack     at TLSSocket.socketOnData (node:_http_client:482:22)
npm ERR! node-pre-gyp ERR! stack     at TLSSocket.emit (node:events:520:28)
npm ERR! node-pre-gyp ERR! stack     at addChunk (node:internal/streams/readable:324:12)
npm ERR! node-pre-gyp ERR! stack     at readableAddChunk (node:internal/streams/readable:297:9)
npm ERR! node-pre-gyp ERR! System Darwin 21.3.0
npm ERR! node-pre-gyp ERR! command "/opt/homebrew/Cellar/node/17.4.0/bin/node" "/Users/gcohen/Development/verifiable-data/packages/bls12381-key-pair/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build=false"
npm ERR! node-pre-gyp ERR! cwd /Users/gcohen/Development/verifiable-data/packages/bls12381-key-pair/node_modules/@mattrglobal/node-bbs-signatures
npm ERR! node-pre-gyp ERR! node -v v17.4.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.14.0
npm ERR! node-pre-gyp ERR! not ok

Trying to resolve https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.11.0/node-v102-darwin-arm64.tar.gz directly also returns a 404

Unable to create credential with context https://schema.org

When I added the https://schema.org to the credential context. The following error occurred
"type": "jsonld.InvalidUrl",
"details": "Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context."

How to write the documentLoader to support https://schema.org for the following credential

{
 "credential": {
   "@context": [
     "https://www.w3.org/2018/credentials/v1",
      "https://schema.org"
   ],
   "type": [
     "VerifiableCredential",
     "CourseCredential"
   ],
   "issuer": {
     "id": "did:key:z6MkndAHigYrXNpape7jgaC7jHiWwxzB3chuKUGXJg2b5RSj",
   },
   "issuanceDate": "2021-07-26T01:05:05.152Z",
   "credentialSubject": {
     "id": "did:key:z6MkfxQU7dy8eKxyHpG267FV23agZQu9zmokd8BprepfHALi",
     "givenName": "Chris",
     "familyName": "Shin",
     "educationalCredentialAwarded": "Certificate Name"
   },
 }
}

Matrix node versions and wasm errors

currently we are stuck on node14 because of static fixture issues with wasm and bls12381.

I suggest we skip all bls12381 tests that break, and bump ci to use matrix and support node 16.

vc-api design and requirements

Abstract

We want a shared code base for implementing the vc-api , using libraries in this repo.

We want this code base to expose a docker and bare metal api that can be configured to expose cryptographic capabilities in an extensible manner, such that a standard build process can deploy a secured instance of the api that is unique per vendor (no key or auth-reuse, no bundling of keys for demo purposes).

Requirements

API Documentation

The documentation for the API SHALL be OAS3.0 and shall include security configuration associated with authentication and authorization.

API Features

The API SHALL support all defined http endpoints and schemas associated with the vc-api.

This includes stateful operations such as revocation and presentation exchange.

This implies database integrations and associated security considerations.

The API SHALL support did:key and did:web.

The API SHALL support well known did configuration.

The API SHALL support extensibility mechanisms for securely exposing key based capabilities, such as signing.

Testing

The API SHALL be testable in CI using github actions.

Conformance tests shall cover all exposed endpoints and all supported did methods.

The API SHALL cover all "credentials of interests" as defined in the traceability use cases and requirements section here:

https://w3c-ccg.github.io/traceability-vocab/#use-cases-and-requirements

The API SHALL expose digital bazaar libraries for testing in CI as part of conformance testing, using a facade pattern. This is to ensure that all test vectors associated with API conformance have been evaluated by at least 2 independent implementations.

Existing implementations:

@transmute/ed25519-signature-2018 complains on wrong date when using toISOString

The lib says that toISOString of new Date is wrong format, and It is because of the . fractions on the seconds that toISOString produces.

But according to the spec: https://www.w3.org/TR/xmlschema11-2/#nt-seFrag, that is a valid format?

And is not this the time format the verifiable credentials following?

It only seems to accepts this format "YYYY-MM-DDTHH:mm:ss[Z]"

Where the [Z] is just a string. This test running does not accepte offsetData such as +0100 which is pretty critical

Upgrade our documentLoader behavior for DID URLs from resolvers to dereferencers

Digital Bazaar changed their document loader from a resolver to a derferencers
This means to remain interopable, we need to change our document loaders to also implement this change
so that for the same input, we return the same document fragment

In terms of disambiguation, the difference between a resolver and a derferencer.
A resolver will load a document from a url, and return the entire document
A derferencer will load a specific fragment after loading the document from a url

In terms of dids, the use-case is that a resolver returns an entire did document, and
a derferencer will return a specific key inside the did document.

This is a container issue on this repository to track and make sure that we update our document loaders
in this repository.

dilithium deterministic keys

 async generate() {
    const keyPtr = this.instance._dilithiumGenerate();
    const keyPair = this.getCString(keyPtr, KEYPAIR_BYTES_B64 * 2, true);
    return JSON.parse(keyPair);
  }

it would be nice to be able to pass a secureRandom function that we could link up to mnemonics or other dangerous sources of low entropy... for testing purposes.

Better interoperability tests with digitalbazaar

Due to jest / esm module issues, we are having trouble testing things, and its leading to less tests.

We need to fix this issue by generating some test vectors from their libraries, and confirming support for them in ours.

We should treat digital bazaar libraries as the source of truth.

We should create a package in this repo which imports their libraries, and produces test vectors as a node module for the following cases:

  • Ed25519Signature2018
  • linked data proofs (jsonld-signatures)
  • vc.js - verifiable credentials
  • revocation list verifiable credentials

Then we should add to this package, suites we have written which they don't currently maintain:

  • JsonWebSignature2020
  • BbsBls.... (be careful with blank nodes and derive)

Then we should add to this package test vectors of interest, starting small and ending complex:

  • simple single context credentials
  • permanent resident card vc
  • vaccination vc
  • CMTR vc
  • verifiable business card vc

At the end of this process, we should have a node module called @transmute/vc-data-model-test-vectors, it should export json for all inputs and outputs, it should have only dev dependencies, it should have a document loader that hard codes all contexts, revocation lists, dids and any URI that might normally require network.

Fix did:key dependencies

Refactor key pair classes:

  • secp256k1
  • ed25519
  • x25519
  • bls12381
  • p256
  • p384
  • p521

Refactor did-key-common:

  • generalize resolution for content types
  • ensure ld-key-pair-class conformance

Refactor did-key.js :

  • include all key pair classes
  • add support for dereferencing

Error: 'staticImplements' is not exported by node_modules/@transmute/ld-key-pair/dist/index.js

Hi,

I am implementing some did verification process in a library that runs both in the browser and on node. One of the dependencies (I believe it would be @transmute/did-key-secp256k1) relies on this library.

When I am bundling with rollup, I get the following error:

[!] Error: 'staticImplements' is not exported by node_modules/@transmute/ld-key-pair/dist/index.js, imported by node_modules/@transmute/secp256k1-key-pair/dist/secp256k1-key-pair.esm.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
node_modules/@transmute/secp256k1-key-pair/dist/secp256k1-key-pair.esm.js (3:9)
1: import { __decorate } from 'tslib';
2: import secp256k1 from 'secp256k1';
3: import { staticImplements } from '@transmute/ld-key-pair';
                  ^

indeed the entry file looks like this:

if (process.env.NODE_ENV === 'production') {
  module.exports = require('./ld-key-pair.cjs.production.min.js')
} else {
  module.exports = require('./ld-key-pair.cjs.development.js')
}

And it does not seem rollup is capable of interpreting this dynamic import? Or do you know of a way?

Thanks

compactProof should NEVER be set to true

When using the non default options for verifying a mill test report verifiable credential, specifically compactProof, results in a failure to verify.
compactProof: true with expansionMap: undefined or true results in the error The property "grade" in the input was not defined in the context.
compactProof: true with expansionMap: false results in an invalid signature. All other expansionMap and compactProof result in successful verification.

Handling suite date variations differently than digital bazaar

  1. we don't convert to datetime xml format e.g. 2010-10-19T14:47:38-05:00 -> 2010-10-19T19:47:38Z, 2010-10-19T14:47:38.123Z -> 2010-10-19T14:47:38Z, currently it passes the incorrectly formatted date as is
  2. we don't error on nonsense strings e.g. foobar -> error, currently it passes the nonsense string as is
  3. we don't error on empty strings e.g. "" -> error, currently it gets set to current time
  4. we don't pass current time for null e.g. null -> current time, currently it passes epoch time.

Is this suppose to fail?

I have a VC that is trying to stick to JSON LD structure, and should really fail accroding to: https://github.com/transmute-industries/verifiable-data/blob/main/packages/jsonld-schema/src/check/check.ts#L68

But this is not failing with the current library any idea why?
Im trying to understand how the context and the type stick together and help my code and me understand what to do.

{
  '@context': [
    'https://www.w3.org/2018/credentials/v1',
    'https://w3id.org/traceability/v1'
  ],
  issuer: 'did:key:z6MkqjFswaqkXJ7SRUZ8G9m1RtcjpXps1RZRKo4mFYZy5bWx',
  type: [ 'VerifiableCredential', 'ContactPoint' ],
  name: 'Verified phone number',
  description: 'This is a credential of phone number attribute that has been verified through sending an sms to the owner',
  issuanceDate: '2021-12-06T11:38:21Z',
  credentialSubject: {
    id: 'did:key:z6MkfwmZep5ZvkHfeXszxhxEuvkmGFRc8H9Nv9ZaQG4vhFzZ',
    identifier: '7870dab0-f8f5-11eb-b356-657b2e987fed',
    hhohoo: '+46456812311'
  }
}

VC-JWT signatures are bugged

Recent changes appear to have encoded the JWT signature as a JWT with detached payload...

The JOSE package on npm should be used to create a series of JWT test vectors and their interop with our libraries here should be confirmed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.