{"id":13891277,"url":"https://github.com/w3c/vc-data-model-2.0-test-suite","last_synced_at":"2025-10-20T00:30:52.671Z","repository":{"id":136582189,"uuid":"607720334","full_name":"w3c/vc-data-model-2.0-test-suite","owner":"w3c","description":"W3C Verifiable Credentials v2.0 test suite","archived":false,"fork":false,"pushed_at":"2025-01-27T20:16:29.000Z","size":3438,"stargazers_count":14,"open_issues_count":15,"forks_count":18,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-01-30T09:34:21.189Z","etag":null,"topics":["standard","vc-wg","w3c"],"latest_commit_sha":null,"homepage":"https://w3c.github.io/vc-data-model-2.0-test-suite/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/w3c.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-28T14:45:56.000Z","updated_at":"2025-01-27T20:16:30.000Z","dependencies_parsed_at":"2023-09-24T08:19:07.369Z","dependency_job_id":"191efe32-05a7-49f8-854a-0aac769ab43b","html_url":"https://github.com/w3c/vc-data-model-2.0-test-suite","commit_stats":null,"previous_names":["w3c/vc-data-model-2-test-suite"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w3c%2Fvc-data-model-2.0-test-suite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w3c%2Fvc-data-model-2.0-test-suite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w3c%2Fvc-data-model-2.0-test-suite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w3c%2Fvc-data-model-2.0-test-suite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/w3c","download_url":"https://codeload.github.com/w3c/vc-data-model-2.0-test-suite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237236940,"owners_count":19277081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["standard","vc-wg","w3c"],"created_at":"2024-08-06T16:01:25.358Z","updated_at":"2025-10-20T00:30:52.665Z","avatar_url":"https://github.com/w3c.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003c!--\nCopyright 2024 Digital Bazaar, Inc.\n\nSPDX-License-Identifier: LicenseRef-w3c-3-clause-bsd-license-2008 OR LicenseRef-w3c-test-suite-license-2023\n--\u003e\n\n# Verifiable Credentials v2.0 Test Suite\n\nThis is the test suite for the W3C Verifiable Credentials Data Model (VCDM) v2.0\nspecification.\n\n## Table of Contents\n\n\u003c!-- TOC tocDepth:2..3 --\u003e\n\n- [Background](#background)\n- [Install](#install)\n- [Setup](#setup)\n- [Usage](#usage)\n  - [Testing Locally](#testing-locally)\n  - [Allure Reporting](#allure-reporting)\n- [Implementation](#implementation)\n  - [Test Suite HTTP API](#test-suite-http-api)\n  - [Enveloping Proof](#enveloping-proof)\n- [Contribute](#contribute)\n- [License](#license)\n\n\u003c!-- /TOC --\u003e\n\n## Background\n\nThis test suite provides interoperability tests for verifiable credential\nprocessors (issuers/verifiers) that support the\n[W3C Verifiable Credentials Data Model v2.0](https://www.w3.org/TR/vc-data-model-2.0/).\n\n## Install\n\n```js\nnpm i\n```\n\n## Setup\n\nThis test suite uses an HTTP API (based on the\n[VC-API](https://w3c-ccg.github.io/vc-api/)) for passing  credentials into\nissuer and verifier implementations. If your implementation is not already\ncompatible with the VC-API, it is possible to \"wrap\" the implementation in a\nminimal VC-API implementation (example code is available at\n\u003chttps://github.com/Wind4Greg/Server-for-VCs\u003e).\n\nAdditionally, verifier implementations will need to be able to process Verifiable Credentials\nand Verifiable Presentations signed with `eddsa-rdfc-2022`. We recommend\nthat any issuer endpoints used with this test suite also issue using\n`eddsa-rdfc-2022`. Both signed and unsigned Verifiable Presentations will\nbe submitted for verification. Signed Verifiable Presentations from this suite\nwill have a domain and challenge set. The domain should be the test repo, and\nthe challenge is static.\n\n#### Required Contexts\n\nImplementations are expected to not error when any of the following context\nfiles are used in a verifiable credential or a verifiable presentation:\n\n- [VC 2.0 Context - https://www.w3.org/ns/credentials/v2](https://www.w3.org/ns/credentials/v2)\n- [VC Examples Context - https://www.w3.org/ns/credentials/examples/v2](https://www.w3.org/ns/credentials/examples/v2)\n\n## Usage\n\nTo add your implementation to this test suite, add a test manifest describing\nyour implementation to the\n[`w3c/vc-test-suite-implementations`](https://github.com/w3c/vc-test-suite-implementations)\nrepo by following the\n[Adding a new implementation](https://github.com/w3c/vc-test-suite-implementations/tree/main?tab=readme-ov-file#adding-a-new-implementation)\ninstructions.\n\nAll endpoints will need the tag `vc2.0`. A simplified manifest will roughly\nlook like the following:\n\n```js\n{\n  \"name\": \"My Company\",\n  \"implementation\": \"My implementation\",\n  \"issuers\": [{\n    \"id\": \"\",\n    \"endpoint\": \"https://issuer.mycompany.com/credentials/issue\",\n    \"tags\": [\"vc2.0\"]\n  }],\n  \"verifiers\": [{\n    \"id\": \"\",\n    \"endpoint\": \"https://verifier.mycompany.com/credentials/verify\",\n    \"tags\": [\"vc2.0\"]\n  }],\n  \"vpVerifiers\": [{\n    \"id\": \"\",\n    \"endpoint\": \"https://verifier.mycompany.com/presentations/verify\",\n    \"tags\": [\"vc2.0\"]\n  }]\n}\n```\n\nThe example above is for a set of unauthenticated endpoints. You can add\n[ZCAP](https://w3c-ccg.github.io/zcap-spec/)\nor [OAuth2 authentication](https://oauth.net/2/client-authentication/) to your endpoints.\n\nSee\n[Adding a new implementation](https://github.com/w3c/vc-test-suite-implementations/tree/main?tab=readme-ov-file#adding-a-new-implementation)\nfor more information.\n\n### Testing Locally\n\nTo test a single implementation or endpoint running locally, you can\ncopy `localConfig.example.cjs` to `localConfig.cjs`\nin the root directory of the test suite.\n\n```bash\ncp localConfig.example.cjs localConfig.cjs\n```\n\nThis file must be a CommonJS module that exports an object containing a\n`settings` object (for configuring the test suite code itself) and an\n`implementations` array (for configuring the implementation(s) to test against).\n\nThe format of the object contained in the `implementations` array is\nidentical to the one defined in\n[the **_Testing locally_** section of VC Test Suite Implementations](https://github.com/w3c/vc-test-suite-implementations?tab=readme-ov-file#testing-locally).\nThe `implementations` array may contain more than one implementation object,\nenabling you to test multiple implementations in one run.\n\n```js\n// localConfig.cjs defines local implementations\n// Before running the tests, you can specify a BASE_URL, such as\n// BASE_URL=http://localhost:40443/zDdfsdfs npm test\nconst baseUrl = process.env.BASE_URL || 'https://localhost:40443/id';\nmodule.exports = {\n  settings: {\n    enableInteropTests: false, // default\n    testAllImplementations: false // default\n  },\n  implementations: [{\n    name: 'My Company',\n    implementation: 'My Implementation Name',\n    issuers: [{\n      id: 'did:myMethod:implementation:issuer:id',\n      endpoint: `${baseUrl}/credentials/issue`\n    }],\n    verifiers: [{\n      id: 'did:myMethod:implementation:verifier:id',\n      endpoint: `${baseUrl}/credentials/verify`\n    }]\n  }];\n```\n\nThen...\n\n```sh\nnpm test\n```\n\n### Allure Reporting\nIt's also possible to generate local allure reports for analyzing and debugging results. [Allure](https://allurereport.org/) is a language agnostic reporting framework which enables useful features for developers and test-suite designers.\n\nTo run the tests and browse the report, use the following commands:\n```bash\n# Running the tests\nnpx mocha tests/\n\n# Running the reporting server\nallure serve allure-results\n```\n\n## Implementation\n\n### Test Suite HTTP API\n\n\nA request to **issue a credential** (`/credentials/issue`) will look like this:\n\n```http\nPOST /credentials/issue\n```\n\n```json\n{\n  \"credential\": {\n    \"@context\": [\n      \"https://www.w3.org/ns/credentials/v2\",\n      \"https://www.w3.org/ns/credentials/examples/v2\"\n    ],\n    \"id\": \"http://university.example/credentials/1872\",\n    \"type\": [\"VerifiableCredential\", \"ExampleAlumniCredential\"],\n    \"issuer\": \"https://university.example/issuers/565049\",\n    \"validFrom\": \"2023-07-01T19:23:24Z\",\n    \"credentialSubject\": {\n      \"id\": \"did:example:ebfeb1f712ebc6f1c276e12ec21\",\n      \"alumniOf\": {\n        \"id\": \"did:example:c276e12ec21ebfeb1f712ebc6f1\",\n        \"name\": \"Example University\"\n      }\n    }\n  },\n  \"options\": {}\n}\n```\n\nThe response from a call to issue a credential (`/credentials/issue`) will\nlook like this:\n\n```http\nHTTP/1.1 200 OK\n```\n\n```json\n{\n  \"verifiableCredential\": {\n    \"@context\": [\n      \"https://www.w3.org/ns/credentials/v2\",\n      \"https://www.w3.org/ns/credentials/examples/v2\"\n    ],\n    \"id\": \"http://university.example/credentials/1872\",\n    \"type\": [\"VerifiableCredential\", \"ExampleAlumniCredential\"],\n    \"issuer\": \"https://university.example/issuers/565049\",\n    \"validFrom\": \"2023-07-01T19:23:24Z\",\n    \"credentialSubject\": {\n      \"id\": \"did:example:ebfeb1f712ebc6f1c276e12ec21\",\n      \"alumniOf\": {\n        \"id\": \"did:example:c276e12ec21ebfeb1f712ebc6f1\",\n        \"name\": \"Example University\"\n      }\n    },\n    \"proof\": {\n      \"type\": \"DataIntegrityProof\",\n      \"cryptosuite\": \"eddsa-rdfc-2022\",\n      \"created\": \"2023-06-18T21:19:10Z\",\n      \"proofPurpose\": \"assertionMethod\",\n      \"verificationMethod\": \"https://university.example/issuers/565049#key-1\",\n      \"proofValue\": \"zQeVbY4oey...V6doDwLWx\"\n    }\n  }\n}\n```\n\nA request to the **verifier endpoint** (`/credentials/verify`) for a credential\nwill look like this:\n\n```http\nPOST /credentials/verify\n```\n\n```json\n{\n  \"verifiableCredential\": {\n    \"@context\": [\n      \"https://www.w3.org/ns/credentials/v2\",\n      \"https://www.w3.org/ns/credentials/examples/v2\"\n    ],\n    \"id\": \"http://university.example/credentials/1872\",\n    \"type\": [\"VerifiableCredential\", \"ExampleAlumniCredential\"],\n    \"issuer\": \"https://university.example/issuers/565049\",\n    \"validFrom\": \"2023-07-01T19:23:24Z\",\n    \"credentialSubject\": {\n      \"id\": \"did:example:ebfeb1f712ebc6f1c276e12ec21\",\n      \"alumniOf\": {\n        \"id\": \"did:example:c276e12ec21ebfeb1f712ebc6f1\",\n        \"name\": \"Example University\"\n      }\n    },\n    \"proof\": {\n      \"type\": \"DataIntegrityProof\",\n      \"cryptosuite\": \"eddsa-rdfc-2022\",\n      \"created\": \"2023-06-18T21:19:10Z\",\n      \"proofPurpose\": \"assertionMethod\",\n      \"verificationMethod\": \"https://university.example/issuers/565049#key-1\",\n      \"proofValue\": \"zQeVbY4oey...V6doDwLWx\"\n    }\n  },\n  \"options\": {}\n}\n```\n\nA response from the verifier endpoint (`/credentials/verify`) for a\nverifiable credential might look like this (only HTTP response codes are\nchecked):\n\n```http\nHTTP/1.1 200 OK\n```\n\n```json\n{\n  \"verified\": true,\n  \"results\": {},\n  \"problemDetails\": []\n}\n```\n\nThe credential verifier endpoint is based on the\n[VC-API Verify Credential](https://w3c-ccg.github.io/vc-api/#verify-credential)\nendpoint.\n\n---\n\nA request to the **verifier endpoint** for a presentation\n(`/presentations/verify`) will look like this:\n\n```http\nPOST /presentations/verify\n```\n\n```json\n{\n  \"verifiablePresentation\": {\n    \"@context\": [\"https://www.w3.org/ns/credentials/v2\"],\n    \"type\": [\"VerifiablePresentation\"],\n    \"holder\": \"did:example:holder123456789\",\n    \"verifiableCredential\": [{\n      \"@context\": [\n        \"https://www.w3.org/ns/credentials/v2\",\n        \"https://www.w3.org/ns/credentials/examples/v2\"\n      ],\n      \"id\": \"http://university.example/credentials/1872\",\n      \"type\": [\"VerifiableCredential\", \"ExampleAlumniCredential\"],\n      \"issuer\": \"https://university.example/issuers/565049\",\n      \"validFrom\": \"2023-07-01T19:23:24Z\",\n      \"credentialSubject\": {\n        \"id\": \"did:example:ebfeb1f712ebc6f1c276e12ec21\",\n        \"alumniOf\": {\n          \"id\": \"did:example:c276e12ec21ebfeb1f712ebc6f1\",\n          \"name\": \"Example University\"\n        }\n      },\n      \"proof\": {\n        \"type\": \"DataIntegrityProof\",\n        \"cryptosuite\": \"eddsa-rdfc-2022\",\n        \"created\": \"2023-06-18T21:19:10Z\",\n        \"proofPurpose\": \"assertionMethod\",\n        \"verificationMethod\": \"https://university.example/issuers/565049#key-1\",\n        \"proofValue\": \"zQeVbY4oey...V6doDwLWx\"\n      }\n    }],\n    \"proof\": {\n      \"type\": \"DataIntegrityProof\",\n      \"cryptosuite\": \"eddsa-rdfc-2022\",\n      \"challenge\": \"08cf4ce0-2bd0-11ee-8622-83054936f200\",\n      \"domain\": \"example.com\",\n      \"created\": \"2023-06-18T21:19:10Z\",\n      \"proofPurpose\": \"assertionMethod\",\n      \"verificationMethod\": \"did:example:holder123456789#key-1\",\n      \"proofValue\": \"zQeVbY4y...oDwLWxV6d\"\n    }\n  },\n  \"options\": {\n    \"challenge\": \"secret\",\n    \"domain\": \"example.com\"\n  }\n}\n```\n\nA response from the verifier endpoint (`/credentials/verify`) for a\nverifiable presentation might look like this (only HTTP response codes are\nchecked):\n\n```http\nHTTP/1.1 200 OK\n```\n\n```json\n{\n  \"verified\": true,\n  \"problemDetails\": []\n}\n```\n\nThe presentation verifier endpoint is based on the\n[VC API Verify Presentation](https://w3c-ccg.github.io/vc-api/#verify-presentation) endpoint.\n\n### Enveloping Proof\nImplementers who rely on an enveloping proof securing mechanism can add the `EnvelopingProof` tag to their implementation registration.\n\nThis will instruct the test suite to conduct further testing on the implementation and assert the Data Model based on the payload instead of the direct output.\n\n```json\n{\n  \"name\": \"My Company\",\n  \"implementation\": \"My implementation\",\n  \"issuers\": [{\n    \"id\": \"\",\n    \"endpoint\": \"https://issuer.mycompany.com/credentials/issue\",\n    \"tags\": [\"vc2.0\", \"EnvelopingProof\"]\n  }],\n  \"verifiers\": [{\n    \"id\": \"\",\n    \"endpoint\": \"https://verifier.mycompany.com/credentials/verify\",\n    \"tags\": [\"vc2.0\", \"EnvelopingProof\"]\n  }],\n  \"vpVerifiers\": [{\n    \"id\": \"\",\n    \"endpoint\": \"https://verifier.mycompany.com/presentations/verify\",\n    \"tags\": [\"vc2.0\", \"EnvelopingProof\"]\n  }]\n}\n```\n\n## Contribute\n\nSee [the CONTRIBUTING.md file in the `w3c/vc-test-suite-implementations` repo](https://github.com/w3c/vc-test-suite-implementations/blob/main/CONTRIBUTING.md).\n\nPull Requests are welcome!\n\n## License\n\nSee [the LICENSE.md file](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw3c%2Fvc-data-model-2.0-test-suite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw3c%2Fvc-data-model-2.0-test-suite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw3c%2Fvc-data-model-2.0-test-suite/lists"}