@trustvc/trustvc 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +25 -26
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## About
4
4
 
5
- TrustVC is a comprehensive wrapper library designed to simplify the signing and verification processes for TrustVC W3C [Verifiable Credentials (VC)](https://github.com/TrustVC/w3c) and OpenAttestation Verifiable Documents (VD), adhering to the W3C [VC](https://www.w3.org/TR/vc-data-model/) Data Model v1.1 (W3C Standard). It ensures compatibility and interoperability for Verifiable Credentials while supporting OpenAttestation [Verifiable Documents (VD)](https://github.com/Open-Attestation/open-attestation) v6.9.5. TrustVC seamlessly integrates functionalities for handling W3C Verifiable Credentials and OpenAttestation Verifiable Documents, leveraging existing TradeTrust libraries and smart contracts for [Token Registry](https://github.com/TradeTrust/token-registry) (V4 and V5). Additionally, it includes essential utility functions for strings, networks, and chains, making it a versatile tool for developers working with decentralized identity and verifiable data solutions.
5
+ TrustVC is a comprehensive wrapper library designed to simplify the signing and verification processes for TrustVC W3C [Verifiable Credentials (VC)](https://github.com/TrustVC/w3c) and OpenAttestation Verifiable Documents (VD), adhering to the W3C [VC](https://www.w3.org/TR/vc-data-model/) Data Model v2.0 (W3C Standard). It ensures compatibility and interoperability for Verifiable Credentials while supporting OpenAttestation [Verifiable Documents (VD)](https://github.com/Open-Attestation/open-attestation) v6.9.5. TrustVC seamlessly integrates functionalities for handling W3C Verifiable Credentials and OpenAttestation Verifiable Documents, leveraging existing TradeTrust libraries and smart contracts for [Token Registry](https://github.com/TradeTrust/token-registry) (V4 and V5). Additionally, it includes essential utility functions for strings, networks, and chains, making it a versatile tool for developers working with decentralized identity and verifiable data solutions.
6
6
 
7
7
  ## Table of Contents
8
8
 
@@ -114,7 +114,7 @@ console.log(wrappedDocuments);
114
114
 
115
115
  ### 2. **Signing**
116
116
 
117
- > The TrustVC Signing feature simplifies the signing process for OA documents and W3C-compliant verifiable credentials using BBS+ signatures. This feature allows you to easily sign W3C Verifiable Credentials (VCs) and ensure they comply with the latest standards.
117
+ > The TrustVC Signing feature simplifies the signing process for OA documents and W3C-compliant verifiable credentials using ECDSA signature. This feature allows you to easily sign W3C Verifiable Credentials (VCs) and ensure they comply with the latest standards.
118
118
 
119
119
  The signing functionality is split into two methods:
120
120
 
@@ -169,7 +169,7 @@ const rawDocument = {
169
169
  ],
170
170
  credentialStatus: {
171
171
  id: 'https://trustvc.github.io/did/credentials/statuslist/1#1',
172
- type: 'StatusList2021Entry',
172
+ type: 'BitstringStatusListEntry',
173
173
  statusPurpose: 'revocation',
174
174
  statusListIndex: '10',
175
175
  statusListCredential: 'https://trustvc.github.io/did/credentials/statuslist/1',
@@ -241,12 +241,11 @@ const signedDocument = {
241
241
  '@context': [
242
242
  'https://www.w3.org/ns/credentials/v2',
243
243
  'https://w3id.org/security/data-integrity/v2',
244
- 'https://w3id.org/vc/status-list/2021/v1',
245
244
  'https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v2.jsonld'
246
245
  ],
247
246
  credentialStatus: {
248
247
  id: 'https://trustvc.github.io/did/credentials/statuslist/1#1',
249
- type: 'StatusList2021Entry',
248
+ type: 'BitstringStatusListEntry',
250
249
  statusPurpose: 'revocation',
251
250
  statusListIndex: '10',
252
251
  statusListCredential: 'https://trustvc.github.io/did/credentials/statuslist/1'
@@ -260,14 +259,14 @@ const signedDocument = {
260
259
  type: ['VerifiableCredential'],
261
260
  validFrom: '2024-04-01T12:19:52Z',
262
261
  validUntil: '2029-12-03T12:19:52Z',
263
- id: 'urn:uuid:0198bd9e-6686-7ccd-9b2a-ce763ae710d7',
262
+ id: 'urn:uuid:0198e4a3-b601-7117-9d02-8c9a9a54ab5d',
264
263
  proof: {
265
264
  type: 'DataIntegrityProof',
266
265
  created: '2025-08-18T14:38:51Z',
267
266
  verificationMethod: 'did:web:trustvc.github.io:did:1#multikey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zD6IUGYXCUIVhABjkqmiaLL9PY20li9JBOd0VR7udnu0eM8JMGnnHm_gEIKM3eHWPqyfJyw9AfFymBwm0fgBqRxf0LIo9uDkLlwYJnL2lzc3VlcmovdmFsaWRGcm9t'
271
270
  }
272
271
  };
273
272
 
@@ -283,42 +282,42 @@ const derivationResult = await deriveW3C(signedDocument, {
283
282
 
284
283
  ### 4. **Verifying**
285
284
 
286
- > TrustVC simplifies the verification process with a single function that supports both W3C Verifiable Credentials (VCs) and OpenAttestation Verifiable Documents (VDs). Whether you're working with W3C standards or OpenAttestation standards, TrustVC handles the verification seamlessly.
285
+ > TrustVC simplifies the verification process with a single function that supports both W3C Verifiable Credentials (VCs) and OpenAttestation Verifiable Documents (VDs). Whether you're working with W3C standards or OpenAttestation standards, TrustVC handles the verification seamlessly. For ECDSA-signed documents, which normally require derivation before verification, TrustVC automatically handles this process internally - if a document is not derived, the `verifyDocument` function will automatically derive and verify the document in a single step.
287
286
 
288
287
  ```ts
289
288
  import { verifyDocument } from '@trustvc/trustvc';
290
289
 
291
290
  const signedDocument = {
292
291
  '@context': [
293
- 'https://www.w3.org/2018/credentials/v1',
294
- 'https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v1.jsonld',
295
- 'https://w3id.org/security/bbs/v1',
296
- 'https://w3id.org/vc/status-list/2021/v1',
292
+ 'https://www.w3.org/ns/credentials/v2',
293
+ 'https://w3id.org/security/data-integrity/v2',
294
+ 'https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v2.jsonld'
297
295
  ],
298
296
  credentialStatus: {
299
297
  id: 'https://trustvc.github.io/did/credentials/statuslist/1#1',
300
- type: 'StatusList2021Entry',
298
+ type: 'BitstringStatusListEntry',
301
299
  statusPurpose: 'revocation',
302
300
  statusListIndex: '10',
303
- statusListCredential: 'https://trustvc.github.io/did/credentials/statuslist/1',
301
+ statusListCredential: 'https://trustvc.github.io/did/credentials/statuslist/1'
304
302
  },
305
303
  credentialSubject: {
306
- name: 'TrustVC',
307
- birthDate: '2024-04-01T12:19:52Z',
308
- type: ['PermanentResident', 'Person'],
304
+ type: ['Person'],
305
+ givenName: 'TrustVC',
306
+ birthDate: '2024-04-01T12:19:52Z'
309
307
  },
310
- expirationDate: '2029-12-03T12:19:52Z',
311
308
  issuer: 'did:web:trustvc.github.io:did:1',
312
309
  type: ['VerifiableCredential'],
313
- issuanceDate: '2024-04-01T12:19:52Z',
310
+ validFrom: '2024-04-01T12:19:52Z',
311
+ validUntil: '2029-12-03T12:19:52Z',
312
+ id: 'urn:uuid:0198e4a3-b601-7117-9d02-8c9a9a54ab5d',
314
313
  proof: {
315
- type: 'BbsBlsSignature2020',
316
- created: '2024-10-14T04:11:49Z',
314
+ type: 'DataIntegrityProof',
315
+ created: '2025-08-18T14:38:51Z',
316
+ verificationMethod: 'did:web:trustvc.github.io:did:1#multikey-1',
317
+ cryptosuite: 'ecdsa-sd-2023',
317
318
  proofPurpose: 'assertionMethod',
318
- proofValue:
319
- 'l79dlFQMowalep+WCFqgCvpVBcCAr0GDEFUV6S7gRVY/TQ+sp/wcwaT61PaD19rJYUHlKfzccE4m7waZyoLEkBLFiK2g54Q2i+CdtYBgDdkUDsoULSBMcH1MwGHwdjfXpldFNFrHFx/IAvLVniyeMQ==',
320
- verificationMethod: 'did:web:trustvc.github.io:did:1#keys-1',
321
- },
319
+ proofValue: 'u2V0AhVhAWvyp4W7vt4DBhJy2JjKdbDjNSjh3mFsIfPv68Xk2uc4PSFf1iiAeq19rvnHou1LW_Ff0MrRxzcmuTsBO54q3vVgjgCQDz9CT1s28B8Wsk-i8hgzexvcOZgInRbK9VpG6pMwSfbNYIA0xoaqSwjMxAISQ2l2uRmBFlIdL3XFduNUlo93wj5EMilhA24fPUQHaYlpN2hezHkI2QbUpUzVdIoRFA9KdzA1JNWM9GuCKWF0A62W91QmN82237JIiF1d2aLq3lnCpgR_Y-VhAdhqKN1MXPH5BNYAmM1rSZLHGF92dYt2k3XLb84UsgBYNx0f5VKOKFKNY-ZNho59RdsSTRNbsUzU-zzH1CLkc-lhAKgI6LHZPLePwB-Vsad2jOO-_PGHoHas5-uNJDDSp-xTO2auFGmpI6OGx-U_xwcKYX3su3qwtYCJ3nf2-l-t5SFhAfNLg1QbwjJBStUFCcVZWzu1wDh1d9owiox2nNm9EDun4DU40ThWLoWJEEGtqJYE0XFeMxCNkGJGvBQkXJxKZYlhAXBhzKu4D8oXuUHymh5rXvp-a4cUHI0Mh0H0eEifx41FqPc_hNNhCEZKAl_lB6mxIAA-5rqDkUH8zj-gH0TDgq1hA8GZCjLF6wE5feS14DscTe_oVIAfe_2YYTdDLwtklycGXiIGjMs3XmX002URnASJU2RcX1hROupc2tpXFGOQZmlhAPwgkCD6aSL2gusl56goodXi7lg5GDJyh3iYSSA2qL0HkBs7q3FsbijIvscH3-bIEWZHUX127ZC3f1UL85WPR01hAQi-48VLrcfPC1aFuwuUQm_UEwkZ4LZsEvvPrPtrC1WjtGq7-NDAfNkz6cO9MgsUwjAncXliJW-tTNX3ujDfEA1hAARmh7uujgnsv7CoQt4suDhtVJKZA5UdKahJkUvqXZKRFfhRmJHPwJKnM04IV_AcQd8RH--v2ZUzD6IUGYXCUIVhABjkqmiaLL9PY20li9JBOd0VR7udnu0eM8JMGnnHm_gEIKM3eHWPqyfJyw9AfFymBwm0fgBqRxf0LIo9uDkLlwYJnL2lzc3VlcmovdmFsaWRGcm9t'
320
+ }
322
321
  };
323
322
 
324
323
  const resultFragments = await verifyDocument(signedDocument);
@@ -809,7 +808,7 @@ Example Output After Signing
809
808
  },
810
809
  "credentialStatus": {
811
810
  "id": "https://example.com/status-list#<placeholder>",
812
- "type": "StatusList2021Entry",
811
+ "type": "BitstringStatusListEntry",
813
812
  "statusPurpose": "revocation",
814
813
  "statusListIndex": "<placeholder>",
815
814
  "statusListCredential": "https://example.com/status-list"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustvc/trustvc",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "TrustVC library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -125,7 +125,7 @@
125
125
  "@trustvc/w3c-context": "^1.3.0-alpha.7",
126
126
  "@trustvc/w3c-credential-status": "^1.3.0-alpha.7",
127
127
  "@trustvc/w3c-issuer": "^1.3.0-alpha.5",
128
- "@trustvc/w3c-vc": "^1.3.0-alpha.7",
128
+ "@trustvc/w3c-vc": "^1.3.0-alpha.8",
129
129
  "ethers": "^5.8.0",
130
130
  "ethersV6": "npm:ethers@^6.14.4",
131
131
  "js-sha3": "^0.9.3",