{"id":19122882,"url":"https://github.com/digitalbazaar/eddsa-rdfc-2022-cryptosuite","last_synced_at":"2025-05-05T18:26:28.028Z","repository":{"id":206265618,"uuid":"716219555","full_name":"digitalbazaar/eddsa-rdfc-2022-cryptosuite","owner":"digitalbazaar","description":"An eddsa-rdfc-2022 Data Integrity cryptosuite","archived":false,"fork":false,"pushed_at":"2024-11-25T17:53:13.000Z","size":49,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-05T18:26:22.315Z","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-11-08T17:20:50.000Z","updated_at":"2025-02-14T15:11:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"fde612bf-6797-4eaa-9fa8-c23bad68ed43","html_url":"https://github.com/digitalbazaar/eddsa-rdfc-2022-cryptosuite","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":0.6153846153846154,"last_synced_commit":"c9f2707488f73d5748ddc00765e3655006c11fee"},"previous_names":["digitalbazaar/eddsa-rdfc-2022-cryptosuite"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Feddsa-rdfc-2022-cryptosuite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Feddsa-rdfc-2022-cryptosuite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Feddsa-rdfc-2022-cryptosuite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Feddsa-rdfc-2022-cryptosuite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalbazaar","download_url":"https://codeload.github.com/digitalbazaar/eddsa-rdfc-2022-cryptosuite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252552057,"owners_count":21766630,"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:24.114Z","updated_at":"2025-05-05T18:26:28.006Z","avatar_url":"https://github.com/digitalbazaar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EdDSA RDFC 2022 Data Integrity Cryptosuite _(@digitalbazaar/eddsa-rdfc-2022-cryptosuite)_\n\n[![Build status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/eddsa-rdfc-2022-cryptosuite/main.yml)](https://github.com/digitalbazaar/eddsa-rdfc-2022-cryptosuite/actions?query=workflow%3A%22Node.js+CI%22)\n[![Coverage status](https://img.shields.io/codecov/c/github/digitalbazaar/eddsa-rdfc-2022-cryptosuite)](https://codecov.io/gh/digitalbazaar/eddsa-rdfc-2022-cryptosuite)\n[![NPM Version](https://img.shields.io/npm/v/@digitalbazaar/eddsa-rdfc-2022-cryptosuite.svg)](https://npm.im/@digitalbazaar/eddsa-rdfc-2022-cryptosuite)\n\n\u003e EdDSA 2022 Data Integrity Cryptosuite 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.0 and above.\n\nSee also related specs:\n\n* [Verifiable Credential Data Integrity](https://w3c.github.io/vc-data-integrity/)\n\n## Security\n\nTBD\n\n## Install\n\n- Browsers and Node.js 16+ are supported.\n\nTo install from NPM:\n\n```\nnpm install @digitalbazaar/eddsa-rdfc-2022-cryptosuite\n```\n\nTo install locally (for development):\n\n```\ngit clone https://github.com/digitalbazaar/eddsa-rdfc-2022-cryptosuite.git\ncd eddsa-rdfc-2022-cryptosuite\nnpm install\n```\n\n## Usage\n\nThe following code snippet provides a complete example of digitally signing\na verifiable credential using this library:\n\n```javascript\nimport * as Ed25519Multikey from '@digitalbazaar/ed25519-multikey';\nimport {DataIntegrityProof} from '@digitalbazaar/data-integrity';\nimport {cryptosuite as eddsaRdfc2022CryptoSuite} from\n  '@digitalbazaar/eddsa-rdfc-2022-cryptosuite';\nimport jsigs from 'jsonld-signatures';\nconst {purposes: {AssertionProofPurpose}} = jsigs;\n\n\n// create the unsigned credential\nconst unsignedCredential = {\n  '@context': [\n    'https://www.w3.org/2018/credentials/v1',\n    {\n      AlumniCredential: 'https://schema.org#AlumniCredential',\n      alumniOf: 'https://schema.org#alumniOf'\n    }\n  ],\n  id: 'http://example.edu/credentials/1872',\n  type: [ 'VerifiableCredential', 'AlumniCredential' ],\n  issuer: 'https://example.edu/issuers/565049',\n  issuanceDate: '2010-01-01T19:23:24Z',\n  credentialSubject: {\n    id: 'https://example.edu/students/alice',\n    alumniOf: 'Example University'\n  }\n};\n\n// create the keypair to use when signing\nconst controller = 'https://example.edu/issuers/565049';\nconst keyPair = await Ed25519Multikey.from({\n  '@context': 'https://w3id.org/security/multikey/v1',\n  type: 'Multikey',\n  controller,\n  id: controller + '#z6MkwXG2WjeQnNxSoynSGYU8V9j3QzP3JSqhdmkHc6SaVWoT',\n  publicKeyMultibase: 'z6MkwXG2WjeQnNxSoynSGYU8V9j3QzP3JSqhdmkHc6SaVWoT',\n  secretKeyMultibase: 'zrv3rbPamVDGvrm7LkYPLWYJ35P9audujKKsWn3x29EUiGwwhdZQd' +\n    '1iHhrsmZidtVALBQmhX3j9E5Fvx6Kr29DPt6LH'\n});\n\n// export public key and add to document loader\nconst publicKey = await keyPair.export({publicKey: true, includeContext: true});\naddDocumentToLoader({url: publicKey.id, document: publicKey});\n\n// create key's controller document\nconst controllerDoc = {\n  '@context': [\n    'https://www.w3.org/ns/did/v1',\n    'https://w3id.org/security/multikey/v1'\n  ],\n  id: controller,\n  assertionMethod: [publicKey]\n};\naddDocumentToLoader({url: controllerDoc.id, document: controllerDoc});\n\n// create suite\nconst suite = new DataIntegrityProof({\n  signer: keyPair.signer(), cryptosuite: eddsaRdfc2022CryptoSuite\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      \"AlumniCredential\": \"https://schema.org#AlumniCredential\",\n      \"alumniOf\": \"https://schema.org#alumniOf\"\n    },\n    \"https://w3id.org/security/data-integrity/v2\"\n  ],\n  \"id\": \"http://example.edu/credentials/1872\",\n  \"type\": [\n    \"VerifiableCredential\",\n    \"AlumniCredential\"\n  ],\n  \"issuer\": \"https://example.edu/issuers/565049\",\n  \"issuanceDate\": \"2010-01-01T19:23:24Z\",\n  \"credentialSubject\": {\n    \"id\": \"https://example.edu/students/alice\",\n    \"alumniOf\": \"Example University\"\n  },\n  \"proof\": {\n    \"type\": \"DataIntegrityProof\",\n    \"created\": \"2022-09-06T21:29:24Z\",\n    \"verificationMethod\": \"https://example.edu/issuers/565049#z6MkwXG2WjeQnNxSoynSGYU8V9j3QzP3JSqhdmkHc6SaVWoT\",\n    \"cryptosuite\": \"eddsa-rdfc-2022\",\n    \"proofPurpose\": \"assertionMethod\",\n    \"proofValue\": \"z4uwHCobmxKqQfZb7i8QRnNR9J4TR6u4Wkm4DB3ms337gfSpL4UwhTD7KKdPjyAaVJQ4y896FEnB1Vz3uEz14jWoC\"\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) © 2023 Digital Bazaar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Feddsa-rdfc-2022-cryptosuite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalbazaar%2Feddsa-rdfc-2022-cryptosuite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Feddsa-rdfc-2022-cryptosuite/lists"}