{"id":19122879,"url":"https://github.com/digitalbazaar/ecdsa-sd-2023-cryptosuite","last_synced_at":"2025-04-16T01:19:56.969Z","repository":{"id":167365248,"uuid":"607839678","full_name":"digitalbazaar/ecdsa-sd-2023-cryptosuite","owner":"digitalbazaar","description":"A selective disclosure Data Integrity cryptosuite based on ECDSA for use with jsonld-signatures.","archived":false,"fork":false,"pushed_at":"2024-08-26T17:43:55.000Z","size":193,"stargazers_count":14,"open_issues_count":6,"forks_count":3,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-03-29T03:23:04.854Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalbazaar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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-28T19:30:14.000Z","updated_at":"2024-11-12T18:37:32.000Z","dependencies_parsed_at":"2024-01-17T19:11:57.694Z","dependency_job_id":"c389a27d-4190-447e-b88e-7e03c58b3b67","html_url":"https://github.com/digitalbazaar/ecdsa-sd-2023-cryptosuite","commit_stats":null,"previous_names":["digitalbazaar/ecdsa-sd-2023-cryptosuite"],"tags_count":15,"template":false,"template_full_name":"digitalbazaar/eddsa-2022-cryptosuite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fecdsa-sd-2023-cryptosuite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fecdsa-sd-2023-cryptosuite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fecdsa-sd-2023-cryptosuite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fecdsa-sd-2023-cryptosuite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalbazaar","download_url":"https://codeload.github.com/digitalbazaar/ecdsa-sd-2023-cryptosuite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855123,"owners_count":21172498,"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":[],"created_at":"2024-11-09T05:23:23.027Z","updated_at":"2025-04-16T01:19:56.889Z","avatar_url":"https://github.com/digitalbazaar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# An ECDSA Selective Disclosure Data Integrity Cryptosuite _(@digitalbazaar/ecdsa-sd-2023-cryptosuite)_\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/ecdsa-sd-2023-cryptosuite/main.yml)](https://github.com/digitalbazaar/ecdsa-sd-2023-cryptosuite/actions/workflows/main.yml)\n[![Coverage Status](https://img.shields.io/codecov/c/github/digitalbazaar/ecdsa-sd-2023-cryptosuite)](https://codecov.io/gh/digitalbazaar/ecdsa-sd-2023-cryptosuite)\n[![NPM Version](https://img.shields.io/npm/v/@digitalbazaar/ecdsa-sd-2023-cryptosuite.svg)](https://npm.im/@digitalbazaar/ecdsa-sd-2023-cryptosuite)\n\n\u003e A selective disclosure Data Integrity cryptosuite based on ECDSA for use with jsonld-signatures.\n\n## Table of Contents\n\n- [Background](#background)\n- [Security](#security)\n- [Install](#install)\n- [Usage](#usage)\n- [Contribute](#contribute)\n- [Commercial Support](#commercial-support)\n- [License](#license)\n\n## Background\n\nFor use with https://github.com/digitalbazaar/jsonld-signatures v11.2 and above.\n\nSee also related specs:\n\n* [Verifiable Credential Data Integrity](https://w3c.github.io/vc-data-integrity/)\n* [Data Integrity ECDSA Cryptosuite](https://www.w3.org/TR/vc-di-ecdsa/)\n\n## Security\n\nTBD\n\n## Install\n\n- Browsers and Node.js 18+ are supported.\n\nTo install from NPM:\n\n```sh\nnpm install @digitalbazaar/ecdsa-sd-2023-cryptosuite\n```\n\nTo install locally (for development):\n\n```sh\ngit clone https://github.com/digitalbazaar/ecdsa-sd-2023-cryptosuite.git\ncd ecdsa-sd-2023-cryptosuite\nnpm install\n```\n\n## Usage\n\n### Creating a base proof\n\nThe following code snippet provides an example of digitally signing\na verifiable credential using this library:\n\n```javascript\nimport * as EcdsaMultikey from '@digitalbazaar/ecdsa-multikey';\nimport * as ecdsaSd2023Cryptosuite\n  from '@digitalbazaar/ecdsa-sd-2023-cryptosuite';\nimport {DataIntegrityProof} from '@digitalbazaar/data-integrity';\nimport jsigs from 'jsonld-signatures';\n\nconst {createSignCryptosuite} = ecdsaSd2023Cryptosuite;\nconst {purposes: {AssertionProofPurpose}} = jsigs;\n\n// import the ECDSA key pair to use when signing\nconst publicKeyMultibase = 'zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9';\nconst secretKeyMultibase = 'z42tqZ5smVag3DtDhjY9YfVwTMyVHW6SCHJi2ZMrD23DGYS3';\nconst controller = `did:key:${publicKeyMultibase}`;\nconst keyId = `${controller}#${publicKeyMultibase}`;\nconst publicEcdsaMultikey = {\n  '@context': 'https://w3id.org/security/multikey/v1',\n  type: 'Multikey',\n  controller: `did:key:${publicKeyMultibase}`,\n  id: keyId,\n  publicKeyMultibase\n};\nconst keyPair = await EcdsaMultikey.from({...ecdsaMultikeyKeyPair});\n\n// create the unsigned credential\nconst unsignedCredential = {\n  '@context': [\n    'https://www.w3.org/2018/credentials/v1',\n    {\n      '@protected': true,\n      AlumniCredential: 'urn:example:AlumniCredential',\n      alumniOf: 'https://schema.org#alumniOf'\n    },\n    'https://w3id.org/security/data-integrity/v2'\n  ],\n  id: 'urn:uuid:98c5cffc-efa2-43e3-99f5-01e8ef404be0',\n  type: ['VerifiableCredential', 'AlumniCredential'],\n  issuer: controller,\n  issuanceDate: '2010-01-01T19:23:24Z',\n  credentialSubject: {\n    id: 'urn:uuid:d58b2365-0951-4373-96c8-e886d61829f2',\n    alumniOf: 'Example University'\n  }\n};\n\n// create suite\nconst suite = new DataIntegrityProof({\n  signer: keyPair.signer(),\n  cryptosuite: createSignCryptosuite(/*{\n    // optionally set any mandatory-to-reveal statements\n    mandatoryPointers: [\n      '/issuer',\n      '/issuanceDate'\n    ]\n  }*/)\n});\n\n// create signed credential\nconst signedCredential = await jsigs.sign(unsignedCredential, {\n  suite,\n  purpose: new AssertionProofPurpose(),\n  documentLoader\n});\n\n// results in the following signed VC\n{\n  \"@context\": [\n    \"https://www.w3.org/2018/credentials/v1\",\n    {\n      \"@protected\": true,\n      \"AlumniCredential\": \"urn:example:AlumniCredential\",\n      \"alumniOf\": \"https://schema.org#alumniOf\"\n    },\n    \"https://w3id.org/security/data-integrity/v2\"\n  ],\n  \"id\": \"urn:uuid:98c5cffc-efa2-43e3-99f5-01e8ef404be0\",\n  \"type\": [\n    \"VerifiableCredential\",\n    \"AlumniCredential\"\n  ],\n  \"issuer\": \"did:key:zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9\",\n  \"issuanceDate\": \"2010-01-01T19:23:24Z\",\n  \"credentialSubject\": {\n    \"id\": \"urn:uuid:d58b2365-0951-4373-96c8-e886d61829f2\",\n    \"alumniOf\": \"Example University\"\n  },\n  \"proof\": {\n    \"type\": \"DataIntegrityProof\",\n    \"created\": \"2023-03-01T21:29:24Z\",\n    \"verificationMethod\": \"did:key:zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9#zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9\",\n    \"cryptosuite\": \"ecdsa-sd-2023\",\n    \"proofPurpose\": \"assertionMethod\",\n    \"proofValue\": \"u2V0AhVhAJYHycsGSXfAeu3B79v_7bGXgV7PGt-g5THJoy5ozUnSLiEtlaQUJH8y-m7fA6SbAfsi_ib9dIlp5meEU0lVNElgjgCQCvZIjy3-f0ZY65-E4KboVApo9GhAN9qWKIR0ZIcaVE6BYIEVu230y2U_H_ibRuEk_5Z7jg5VTlhLqNF_m4T5T-LOChlhA8QcdE2gs6-4J-uLtL1-P1lbGwJISWk7oIXMTmTK72rtrOsXdaQeTkyN0CX-3sBhsciroYjbqpQcg8qAI4I2xxFhAPJE7FkZFOn8jMTGFhyAdLcK0T1jpzpIpSNhLmTIzZKhsYdpyijHsPMjM-CwpWuuHJbowZreNj7Xy-C_vHuMRQVhA87tpC5YTvVMx7epTcLKuVvOjVCYtDa95PApP7bg9NgIzycAUuJLTS2EZq1J19mji_G60IE-QiRzahEI4dy6ahVhA_BaNcvBqBQZ-pyCvfGuNkLwREHAYJpkZns5UyI_gZCynLxnoYfcvv9v5sWPghl-eJPhkKxlplDJmO93x3kbKplhAaIUQsz8V_t2r8VmawrAGEUgmEqEiecJ45HNuYJrWiBf0oE_vdiJOA9YP-l3FBeiGfCK10el6ugLkA9GiLCIfxVhAh-a-wrL7Z8mEVrfT_AHDuNnOAa2nwzWWFNwDEIkNum03LhRa3H0fUpFEZcP7MhdWgR4cxT0M-yhJUW5Nf03mW4A\"\n  }\n}\n```\n\n### Creating a derived proof\n\nThe following code snippet provides an example of deriving a verifiable\ncredential with selectively disclosed information using this library:\n\n```javascript\nimport * as EcdsaMultikey from '@digitalbazaar/ecdsa-multikey';\nimport * as ecdsaSd2023Cryptosuite\n  from '@digitalbazaar/ecdsa-sd-2023-cryptosuite';\nimport {DataIntegrityProof} from '@digitalbazaar/data-integrity';\nimport jsigs from 'jsonld-signatures';\n\nconst {createDiscloseCryptosuite} = ecdsaSd2023Cryptosuite;\nconst {purposes: {AssertionProofPurpose}} = jsigs;\n\n// create suite\nconst suite = new DataIntegrityProof({\n  // disclose only the `credentialSubject.id` and any IDs and types in its\n  // JSON path\n  cryptosuite: createDiscloseCryptosuite({\n    selectivePointers: [\n      '/credentialSubject/id'\n    ]\n  })\n});\n\n// create derived credential from the signed credential\nconst derivedCredential = await jsigs.derive(signedCredential, {\n  suite,\n  purpose: new AssertionProofPurpose(),\n  documentLoader\n});\n\n// results in the following derived VC\n{\n  \"@context\": [\n    \"https://www.w3.org/2018/credentials/v1\",\n    {\n      \"@protected\": true,\n      \"AlumniCredential\": \"urn:example:AlumniCredential\",\n      \"alumniOf\": \"https://schema.org#alumniOf\"\n    },\n    \"https://w3id.org/security/data-integrity/v2\"\n  ],\n  \"id\": \"urn:uuid:98c5cffc-efa2-43e3-99f5-01e8ef404be0\",\n  \"type\": [\n    \"VerifiableCredential\",\n    \"AlumniCredential\"\n  ],\n  \"credentialSubject\": {\n    \"id\": \"urn:uuid:d58b2365-0951-4373-96c8-e886d61829f2\"\n    // notably, `alumniOf` is not present\n  },\n  \"proof\": {\n    \"type\": \"DataIntegrityProof\",\n    \"created\": \"2023-03-01T21:29:24Z\",\n    \"verificationMethod\": \"did:key:zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9#zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9\",\n    \"cryptosuite\": \"ecdsa-sd-2023\",\n    \"proofPurpose\": \"assertionMethod\",\n    \"proofValue\": \"u2V0BhVhAJYHycsGSXfAeu3B79v_7bGXgV7PGt-g5THJoy5ozUnSLiEtlaQUJH8y-m7fA6SbAfsi_ib9dIlp5meEU0lVNElgjgCQCvZIjy3-f0ZY65-E4KboVApo9GhAN9qWKIR0ZIcaVE6CDWEDxBx0TaCzr7gn64u0vX4_WVsbAkhJaTughcxOZMrvau2s6xd1pB5OTI3QJf7ewGGxyKuhiNuqlByDyoAjgjbHEWEA8kTsWRkU6fyMxMYWHIB0twrRPWOnOkilI2EuZMjNkqGxh2nKKMew8yMz4LCla64clujBmt42PtfL4L-8e4xFBWEDzu2kLlhO9UzHt6lNwsq5W86NUJi0Nr3k8Ck_tuD02AjPJwBS4ktNLYRmrUnX2aOL8brQgT5CJHNqEQjh3LpqFoIA\"\n  }\n}\n```\n\n### Verifying a derived proof\n\nThe following code snippet provides an example of deriving a verifiable\ncredential with selectively disclosed information using this library:\n\n```javascript\nimport * as EcdsaMultikey from '@digitalbazaar/ecdsa-multikey';\nimport * as ecdsaSd2023Cryptosuite\n  from '@digitalbazaar/ecdsa-sd-2023-cryptosuite';\nimport {DataIntegrityProof} from '@digitalbazaar/data-integrity';\nimport jsigs from 'jsonld-signatures';\n\nconst {createVerifyCryptosuite} = ecdsaSd2023Cryptosuite;\nconst {purposes: {AssertionProofPurpose}} = jsigs;\n\n// create suite\nconst suite = new DataIntegrityProof({\n  cryptosuite: createVerifyCryptosuite()\n});\n\n// verify the derived credential\nconst result = await jsigs.verify(derivedCredential, {\n  suite,\n  purpose: new AssertionProofPurpose(),\n  documentLoader\n});\n```\n\n## Advanced Usage\n\n### Creating a base proof with mandatory field(s)\n\nThe following code snippet provides an example of digitally signing\na verifiable credential with mandatory field(s):\n\n```javascript\nimport * as EcdsaMultikey from '@digitalbazaar/ecdsa-multikey';\nimport * as ecdsaSd2023Cryptosuite\n  from '@digitalbazaar/ecdsa-sd-2023-cryptosuite';\nimport {DataIntegrityProof} from '@digitalbazaar/data-integrity';\nimport jsigs from 'jsonld-signatures';\n\nconst {createSignCryptosuite} = ecdsaSd2023Cryptosuite;\nconst {purposes: {AssertionProofPurpose}} = jsigs;\n\n// import the ECDSA key pair to use when signing\nconst publicKeyMultibase = 'zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9';\nconst secretKeyMultibase = 'z42tqZ5smVag3DtDhjY9YfVwTMyVHW6SCHJi2ZMrD23DGYS3';\nconst controller = `did:key:${publicKeyMultibase}`;\nconst keyId = `${controller}#${publicKeyMultibase}`;\nconst publicEcdsaMultikey = {\n  '@context': 'https://w3id.org/security/multikey/v1',\n  type: 'Multikey',\n  controller: `did:key:${publicKeyMultibase}`,\n  id: keyId,\n  publicKeyMultibase\n};\nconst keyPair = await EcdsaMultikey.from({...ecdsaMultikeyKeyPair});\n\n// create the unsigned credential\nconst unsignedCredential = {\n  \"@context\": [\n    \"https://www.w3.org/2018/credentials/v1\",\n    {\n      \"@protected\": true,\n      \"DriverLicenseCredential\": \"urn:example:DriverLicenseCredential\",\n      \"DriverLicense\": {\n        \"@id\": \"urn:example:DriverLicense\",\n        \"@context\": {\n          \"@protected\": true,\n          \"id\": \"@id\",\n          \"type\": \"@type\",\n          \"documentIdentifier\": \"urn:example:documentIdentifier\",\n          \"dateOfBirth\": \"urn:example:dateOfBirth\",\n          \"expirationDate\": \"urn:example:expiration\",\n          \"issuingAuthority\": \"urn:example:issuingAuthority\"\n        }\n      },\n      \"driverLicense\": {\n        \"@id\": \"urn:example:driverLicense\",\n        \"@type\": \"@id\"\n      }\n    },\n    \"https://w3id.org/security/data-integrity/v2\"\n  ],\n  \"type\": [\n    \"VerifiableCredential\",\n    \"DriverLicenseCredential\"\n  ],\n  \"issuer\": \"did:key:zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9\",\n  \"issuanceDate\": \"2010-01-01T19:23:24Z\",\n  \"credentialSubject\": {\n    \"driverLicense\": {\n      \"type\": \"DriverLicense\",\n      \"documentIdentifier\": \"T21387yc328c7y32h23f23\",\n      \"dateOfBirth\": \"01-01-1990\",\n      \"expirationDate\": \"01-01-2030\",\n      \"issuingAuthority\": \"VA\"\n    }\n  }\n};\n\n// create suite\nconst suite = new DataIntegrityProof({\n  signer: keyPair.signer(),\n  // require a particular field and any IDs or types in its JSON path to\n  // always be disclosed\n  cryptosuite: createSignCryptosuite({\n    mandatoryPointers: [\n      '/credentialSubject/driverLicense/issuingAuthority'\n    ]\n  })\n});\n\n// create signed credential\nconst signedCredential = await jsigs.sign(unsignedCredential, {\n  suite,\n  purpose: new AssertionProofPurpose(),\n  documentLoader\n});\n\n// results in the following signed VC\n{\n  \"@context\": [\n    \"https://www.w3.org/2018/credentials/v1\",\n    {\n      \"@protected\": true,\n      \"DriverLicenseCredential\": \"urn:example:DriverLicenseCredential\",\n      \"DriverLicense\": {\n        \"@id\": \"urn:example:DriverLicense\",\n        \"@context\": {\n          \"@protected\": true,\n          \"id\": \"@id\",\n          \"type\": \"@type\",\n          \"documentIdentifier\": \"urn:example:documentIdentifier\",\n          \"dateOfBirth\": \"urn:example:dateOfBirth\",\n          \"expirationDate\": \"urn:example:expiration\",\n          \"issuingAuthority\": \"urn:example:issuingAuthority\"\n        }\n      },\n      \"driverLicense\": {\n        \"@id\": \"urn:example:driverLicense\",\n        \"@type\": \"@id\"\n      }\n    },\n    \"https://w3id.org/security/data-integrity/v2\"\n  ],\n  \"type\": [\n    \"VerifiableCredential\",\n    \"DriverLicenseCredential\"\n  ],\n  \"issuer\": \"did:key:zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9\",\n  \"issuanceDate\": \"2010-01-01T19:23:24Z\",\n  \"credentialSubject\": {\n    \"driverLicense\": {\n      \"type\": \"DriverLicense\",\n      \"documentIdentifier\": \"T21387yc328c7y32h23f23\",\n      \"dateOfBirth\": \"01-01-1990\",\n      \"expirationDate\": \"01-01-2030\",\n      \"issuingAuthority\": \"VA\"\n    }\n  },\n  \"proof\": {\n    \"type\": \"DataIntegrityProof\",\n    \"created\": \"2023-03-01T21:29:24Z\",\n    \"verificationMethod\": \"did:key:zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9#zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9\",\n    \"cryptosuite\": \"ecdsa-sd-2023\",\n    \"proofPurpose\": \"assertionMethod\",\n    \"proofValue\": \"u2V0AhVhAyM2mwjJlTYkC2QZgunbbnJlRP2coA8DJXHlrm9hzud-3bvwuMVjdhrVK3hydgvr8nze_di7QfIhZGDOt6_Tq6VgjgCQCq8WlSUFA784Z-aFwkE8lM-Z0e5k4noED75rKV9nyEyVYIK13wQfUQGW7f5XNOIVHcKi0O3TkM2McH4T8IdcJ30zIhVhAJEA2_9chguC4iMvtMSG99PvRsY37BcrWih1tHNT-4imz4fmxwxohMzx0xvH8CawiJ9E1slwszhi43VmfPgwmgVhAFEV21IU4BslgrGBAf-0HcBwGRPN38yRZ8e7G-GF8oXBUGtl5Sot9mTX3Ee6hSektBkpop5ozbbic8j4IYiA13lhAPzDD6Gp8LgaJL5b3ne26jFBOAbklJ6Zo_b3dj6FBYpV3vlb64rvATGdjYaaKyTCW9NcazpjninLckVZ9CKB3PlhAGcYAEAZUUmHbEoq0-mpbFn24qHuVkmlhQUyhIP2TNd2Tl-tsFqOhoitK6TjOUT3Bj1qLw-x8RWMi8lLoppc4_lhA7hMMIfnKM4CajB5lkM8f_b0OdFF_ZSLaJJcujlNzAHVTiOSKSvswYKzKDk0ZdHUeej3KgfJ7QmB-fDI9PkCkx4F4MS9jcmVkZW50aWFsU3ViamVjdC9kcml2ZXJMaWNlbnNlL2lzc3VpbmdBdXRob3JpdHk\"\n  }\n}\n```\n\n### Creating a derived proof with only mandatory fields revealed\n\nThe following code snippet provides an example of deriving a verifiable\ncredential with only mandatory fields revealed using this library:\n\n```javascript\nimport * as EcdsaMultikey from '@digitalbazaar/ecdsa-multikey';\nimport * as ecdsaSd2023Cryptosuite\n  from '@digitalbazaar/ecdsa-sd-2023-cryptosuite';\nimport {DataIntegrityProof} from '@digitalbazaar/data-integrity';\nimport jsigs from 'jsonld-signatures';\n\nconst {createDiscloseCryptosuite} = ecdsaSd2023Cryptosuite;\nconst {purposes: {AssertionProofPurpose}} = jsigs;\n\n// create suite\nconst suite = new DataIntegrityProof({\n  // disclose only the `credentialSubject.id` and any IDs and types in its\n  // JSON path\n  cryptosuite: createDiscloseCryptosuite(/* nothing selectively disclosed */)\n});\n\n// create derived credential from the signed credential\nconst derivedCredential = await jsigs.derive(signedCredential, {\n  suite,\n  purpose: new AssertionProofPurpose(),\n  documentLoader\n});\n\n// results in the following derived VC\n{\n  \"@context\": [\n    \"https://www.w3.org/2018/credentials/v1\",\n    {\n      \"@protected\": true,\n      \"DriverLicenseCredential\": \"urn:example:DriverLicenseCredential\",\n      \"DriverLicense\": {\n        \"@id\": \"urn:example:DriverLicense\",\n        \"@context\": {\n          \"@protected\": true,\n          \"id\": \"@id\",\n          \"type\": \"@type\",\n          \"documentIdentifier\": \"urn:example:documentIdentifier\",\n          \"dateOfBirth\": \"urn:example:dateOfBirth\",\n          \"expirationDate\": \"urn:example:expiration\",\n          \"issuingAuthority\": \"urn:example:issuingAuthority\"\n        }\n      },\n      \"driverLicense\": {\n        \"@id\": \"urn:example:driverLicense\",\n        \"@type\": \"@id\"\n      }\n    },\n    \"https://w3id.org/security/data-integrity/v2\"\n  ],\n  \"type\": [\n    \"VerifiableCredential\",\n    \"DriverLicenseCredential\"\n  ],\n  \"credentialSubject\": {\n    \"driverLicense\": {\n      \"type\": \"DriverLicense\",\n      \"issuingAuthority\": \"VA\"\n    }\n  },\n  \"proof\": {\n    \"type\": \"DataIntegrityProof\",\n    \"created\": \"2023-03-01T21:29:24Z\",\n    \"verificationMethod\": \"did:key:zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9#zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9\",\n    \"cryptosuite\": \"ecdsa-sd-2023\",\n    \"proofPurpose\": \"assertionMethod\",\n    \"proofValue\": \"u2V0BhVhAyM2mwjJlTYkC2QZgunbbnJlRP2coA8DJXHlrm9hzud-3bvwuMVjdhrVK3hydgvr8nze_di7QfIhZGDOt6_Tq6VgjgCQCq8WlSUFA784Z-aFwkE8lM-Z0e5k4noED75rKV9nyEyWAowBYIEzd7S14pdeAy8d6-JBVTp0n-mBfmbUarg6kMqld__3EAVggqp46s-1-ncOZRvtre3UOk2THbeYHrLLdlVWrGAzBy9ICWCCdItOD0ZvYLgDNfJyYSFlnqpVtPURbhECsquANRIU5r4YAAQIDBAU\"\n  }\n}\n```\n\n### Creating a derived proof with mandatory and selective fields revealed\n\nThe following code snippet provides an example of deriving a verifiable\ncredential with mandatory and selective fields revealed using this library:\n\n```javascript\nimport * as EcdsaMultikey from '@digitalbazaar/ecdsa-multikey';\nimport * as ecdsaSd2023Cryptosuite\n  from '@digitalbazaar/ecdsa-sd-2023-cryptosuite';\nimport {DataIntegrityProof} from '@digitalbazaar/data-integrity';\nimport jsigs from 'jsonld-signatures';\n\nconst {createDiscloseCryptosuite} = ecdsaSd2023Cryptosuite;\nconst {purposes: {AssertionProofPurpose}} = jsigs;\n\n// create suite\nconst suite = new DataIntegrityProof({\n  // disclose only the `credentialSubject.id` and any IDs and types in its\n  // JSON path\n  cryptosuite: createDiscloseCryptosuite({\n    selectivePointers: [\n      '/credentialSubject/driverLicense/dateOfBirth'\n    ]\n  })\n});\n\n// create derived credential from the signed credential\nconst derivedCredential = await jsigs.derive(signedCredential, {\n  suite,\n  purpose: new AssertionProofPurpose(),\n  documentLoader\n});\n\n// results in the following derived VC\n{\n  \"@context\": [\n    \"https://www.w3.org/2018/credentials/v1\",\n    {\n      \"@protected\": true,\n      \"DriverLicenseCredential\": \"urn:example:DriverLicenseCredential\",\n      \"DriverLicense\": {\n        \"@id\": \"urn:example:DriverLicense\",\n        \"@context\": {\n          \"@protected\": true,\n          \"id\": \"@id\",\n          \"type\": \"@type\",\n          \"documentIdentifier\": \"urn:example:documentIdentifier\",\n          \"dateOfBirth\": \"urn:example:dateOfBirth\",\n          \"expirationDate\": \"urn:example:expiration\",\n          \"issuingAuthority\": \"urn:example:issuingAuthority\"\n        }\n      },\n      \"driverLicense\": {\n        \"@id\": \"urn:example:driverLicense\",\n        \"@type\": \"@id\"\n      }\n    },\n    \"https://w3id.org/security/data-integrity/v2\"\n  ],\n  \"type\": [\n    \"VerifiableCredential\",\n    \"DriverLicenseCredential\"\n  ],\n  \"credentialSubject\": {\n    \"driverLicense\": {\n      \"type\": \"DriverLicense\",\n      \"issuingAuthority\": \"VA\",\n      \"dateOfBirth\": \"01-01-1990\"\n    }\n  },\n  \"proof\": {\n    \"type\": \"DataIntegrityProof\",\n    \"created\": \"2023-03-01T21:29:24Z\",\n    \"verificationMethod\": \"did:key:zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9#zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9\",\n    \"cryptosuite\": \"ecdsa-sd-2023\",\n    \"proofPurpose\": \"assertionMethod\",\n    \"proofValue\": \"u2V0BhVhAyM2mwjJlTYkC2QZgunbbnJlRP2coA8DJXHlrm9hzud-3bvwuMVjdhrVK3hydgvr8nze_di7QfIhZGDOt6_Tq6VgjgCQCq8WlSUFA784Z-aFwkE8lM-Z0e5k4noED75rKV9nyEyWBWEAkQDb_1yGC4LiIy-0xIb30-9GxjfsFytaKHW0c1P7iKbPh-bHDGiEzPHTG8fwJrCIn0TWyXCzOGLjdWZ8-DCaBowBYIKqeOrPtfp3DmUb7a3t1DpNkx23mB6yy3ZVVqxgMwcvSAVggnSLTg9Gb2C4AzXycmEhZZ6qVbT1EW4RArKrgDUSFOa8CWCBM3e0teKXXgMvHeviQVU6dJ_pgX5m1Gq4OpDKpXf_9xIYAAgMEBQY\"\n  }\n}\n```\n\n## Contribute\n\nSee [the contribute file](https://github.com/digitalbazaar/bedrock/blob/master/CONTRIBUTING.md)!\n\nPRs accepted.\n\nIf editing the Readme, please conform to the\n[standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## Commercial Support\n\nCommercial support for this library is available upon request from\nDigital Bazaar: support@digitalbazaar.com\n\n## License\n\n[New BSD License (3-clause)](LICENSE) © 2022 Digital Bazaar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Fecdsa-sd-2023-cryptosuite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalbazaar%2Fecdsa-sd-2023-cryptosuite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Fecdsa-sd-2023-cryptosuite/lists"}