diff --git a/README.md b/README.md index 604a32a..756b260 100644 --- a/README.md +++ b/README.md @@ -84,47 +84,50 @@ Issue cryptographhically signed credentials by posting unsigned verifiable crede ``` curl --location 'http://localhost:4005/instance/test/credentials/issue' \ --header 'Content-Type: application/json' \ ---data-raw '{ +--data-raw '{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.2.json" ], - "id": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1", + "id": "urn:uuid:2fe53dc9-b2ec-4939-9b2c-0d00f6663b6c", "type": [ "VerifiableCredential", "OpenBadgeCredential" ], + "name": "DCC Test Credential", "issuer": { - "id": "the issuer code will set this as the issuing DID", - "type": "Profile", - "name": "DCC Test Issuer", - "description": "A test DID used to issue test credentials", - "url": "https://digitalcredentials.mit.edu", - "image": { - "id": "https://certificates.cs50.io/static/success.jpg", - "type": "Image" - } + "type": [ + "Profile" + ], + "id": "did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC", + "name": "Digital Credentials Consortium Test Issuer", + "url": "https://dcconsortium.org", + "image": "https://user-images.githubusercontent.com/752326/230469660-8f80d264-eccf-4edd-8e50-ea634d407778.png" }, - "issuanceDate": "2020-01-01T00:00:00Z", - "expirationDate": "2025-01-01T00:00:00Z", - "name": "Successful Installation", + "issuanceDate": "2023-08-02T17:43:32.903Z", "credentialSubject": { - "type": "AchievementSubject", - "name": "Me!", - "achievement": { - "id": "http://digitalcredentials.mit.edu", - "type": "Achievement", - "criteria": { - "narrative": "Successfully installed the DCC issuer." - }, - "description": "DCC congratulates you on your successful installation of the DCC Issuer.", - "name": "Successful Installation", - "image": { - "id": "https://certificates.cs50.io/static/success.jpg", - "type": "Image" - } + "type": [ + "AchievementSubject" + ], + "achievement": { + "id": "urn:uuid:bd6d9316-f7ae-4073-a1e5-2f7f5bd22922", + "type": [ + "Achievement" + ], + "achievementType": "Diploma", + "name": "Badge", + "description": "This is a sample credential issued by the Digital Credentials Consortium to demonstrate the functionality of Verifiable Credentials for wallets and verifiers.", + "criteria": { + "type": "Criteria", + "narrative": "This credential was issued to a student that demonstrated proficiency in the Python programming language that occurred from **February 17, 2023** to **June 12, 2023**." + }, + "image": { + "id": "https://user-images.githubusercontent.com/752326/214947713-15826a3a-b5ac-4fba-8d4a-884b60cb7157.png", + "type": "Image" } - } + }, + "name": "Jane Doe" + } }' ``` @@ -132,48 +135,59 @@ This should return a fully formed and signed credential printed to the terminal, ``` { - "@context": ["https://www.w3.org/2018/credentials/v1", "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.2.json", "https://w3id.org/vc/status-list/2021/v1", "https://w3id.org/security/suites/ed25519-2020/v1"], - "id": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1", - "type": ["VerifiableCredential", "OpenBadgeCredential"], - "issuer": { - "id": "did:key:z6Mkf2rgv7ef8FmLJ5Py87LMa7nofQgv6AstdkgsXiiCUJEy", - "type": "Profile", - "name": "DCC Test Issuer", - "description": "A test DID used to issue test credentials", - "url": "https://digitalcredentials.mit.edu", - "image": { - "id": "https://certificates.cs50.io/static/success.jpg", - "type": "Image" - } - }, - "issuanceDate": "2020-01-01T00:00:00Z", - "expirationDate": "2025-01-01T00:00:00Z", - "name": "Successful Installation", - "credentialSubject": { - "type": "AchievementSubject", - "name": "Me!", - "achievement": { - "id": "http://digitalcredentials.mit.edu", - "type": "Achievement", - "criteria": { - "narrative": "Successfully installed the DCC issuer." - }, - "description": "DCC congratulates you on your successful installation of the DCC Issuer.", - "name": "Successful Installation", - "image": { - "id": "https://certificates.cs50.io/static/success.jpg", - "type": "Image" - } - } - } - "proof": { - "type": "Ed25519Signature2020", - "created": "2023-05-19T14:47:25Z", - "verificationMethod": "did:key:z6Mkf2rgv7ef8FmLJ5Py87LMa7nofQgv6AstdkgsXiiCUJEy#z6Mkf2rgv7ef8FmLJ5Py87LMa7nofQgv6AstdkgsXiiCUJEy", - "proofPurpose": "assertionMethod", - "proofValue": "zviQazCEMihts4e6BrhxkEu5VbCPFqTFLY5qBkiRztf3eq1vXYXUCQrTL6ohxmMrsAPEJpB9WGbN1NH5DsSDHsCU" - } + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.2.json", + "https://w3id.org/security/suites/ed25519-2020/v1" + ], + "id": "urn:uuid:2fe53dc9-b2ec-4939-9b2c-0d00f6663b6c", + "type": [ + "VerifiableCredential", + "OpenBadgeCredential" + ], + "name": "DCC Test Credential", + "issuer": { + "type": [ + "Profile" + ], + "id": "did:key:z6MknNQD1WHLGGraFi6zcbGevuAgkVfdyCdtZnQTGWVVvR5Q", + "name": "Digital Credentials Consortium Test Issuer", + "url": "https://dcconsortium.org", + "image": "https://user-images.githubusercontent.com/752326/230469660-8f80d264-eccf-4edd-8e50-ea634d407778.png" + }, + "issuanceDate": "2023-08-02T17:43:32.903Z", + "credentialSubject": { + "type": [ + "AchievementSubject" + ], + "achievement": { + "id": "urn:uuid:bd6d9316-f7ae-4073-a1e5-2f7f5bd22922", + "type": [ + "Achievement" + ], + "achievementType": "Diploma", + "name": "Badge", + "description": "This is a sample credential issued by the Digital Credentials Consortium to demonstrate the functionality of Verifiable Credentials for wallets and verifiers.", + "criteria": { + "type": "Criteria", + "narrative": "This credential was issued to a student that demonstrated proficiency in the Python programming language that occurred from **February 17, 2023** to **June 12, 2023**." + }, + "image": { + "id": "https://user-images.githubusercontent.com/752326/214947713-15826a3a-b5ac-4fba-8d4a-884b60cb7157.png", + "type": "Image" + } + }, + "name": "Jane Doe" + }, + "proof": { + "type": "Ed25519Signature2020", + "created": "2023-10-05T11:17:41Z", + "verificationMethod": "did:key:z6MknNQD1WHLGGraFi6zcbGevuAgkVfdyCdtZnQTGWVVvR5Q#z6MknNQD1WHLGGraFi6zcbGevuAgkVfdyCdtZnQTGWVVvR5Q", + "proofPurpose": "assertionMethod", + "proofValue": "z5fk6gq9upyZvcFvJdRdeL5KmvHr69jxEkyDEd2HyQdyhk9VnDEonNSmrfLAcLEDT9j4gGdCG24WHhojVHPbRsNER" + } } + ``` WARNING: DO NOT USE THIS TO ISSUE `REAL` CREDENTIALS UNTIL YOU'VE [SET YOUR OWN SIGNING KEY](#generate-a-new-key) @@ -327,35 +341,50 @@ curl --location 'http://localhost:4005/instance/econ101/credentials/issue' \ --header 'Authorization: Bearer 988DKLAJH93KDSFV' \ --header 'Content-Type: application/json' \ --data-raw '{ - "@context": ["https://www.w3.org/2018/credentials/v1", "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.2.json", "https://w3id.org/vc/status-list/2021/v1"], - "id": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1", - "type": ["VerifiableCredential", "OpenBadgeCredential"], - "issuer": { - "id": "did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC", - "type": "Profile", - "name": "School of Wonderful", - "description": "The most wonderful school", - "url": "https://wonderful.edu/", - "image": { - "id": "https://user-images.githubusercontent.com/947005/133544904-29d6139d-2e7b-4fe2-b6e9-7d1022bb6a45.png", - "type": "Image" - } - }, - "issuanceDate": "2020-01-01T00:00:00Z", - "name": "A Simply Wonderful Course", - "credentialSubject": { - "type": "AchievementSubject", - "achievement": { - "id": "http://wonderful.wonderful", - "type": "Achievement", - "criteria": { - "narrative": "Completion of the Wonderful Course - well done you!" - }, - "description": "Wonderful.", - "name": "Introduction to Wonderfullness" - } - } - }' + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.2.json" + ], + "id": "urn:uuid:2fe53dc9-b2ec-4939-9b2c-0d00f6663b6c", + "type": [ + "VerifiableCredential", + "OpenBadgeCredential" + ], + "name": "DCC Test Credential", + "issuer": { + "type": [ + "Profile" + ], + "id": "did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC", + "name": "Digital Credentials Consortium Test Issuer", + "url": "https://dcconsortium.org", + "image": "https://user-images.githubusercontent.com/752326/230469660-8f80d264-eccf-4edd-8e50-ea634d407778.png" + }, + "issuanceDate": "2023-08-02T17:43:32.903Z", + "credentialSubject": { + "type": [ + "AchievementSubject" + ], + "achievement": { + "id": "urn:uuid:bd6d9316-f7ae-4073-a1e5-2f7f5bd22922", + "type": [ + "Achievement" + ], + "achievementType": "Diploma", + "name": "Badge", + "description": "This is a sample credential issued by the Digital Credentials Consortium to demonstrate the functionality of Verifiable Credentials for wallets and verifiers.", + "criteria": { + "type": "Criteria", + "narrative": "This credential was issued to a student that demonstrated proficiency in the Python programming language that occurred from **February 17, 2023** to **June 12, 2023**." + }, + "image": { + "id": "https://user-images.githubusercontent.com/752326/214947713-15826a3a-b5ac-4fba-8d4a-884b60cb7157.png", + "type": "Image" + } + }, + "name": "Jane Doe" + } +}' ``` ### Enable Revocation