From a2157be2b3594a0dd9657d623d1e5b1b5000af16 Mon Sep 17 00:00:00 2001 From: Sownak Roy Date: Thu, 16 Jan 2025 08:57:07 +0000 Subject: [PATCH] GITBOOK-346: change request with no subject merged in GitBook --- .../present-a-verifiable-credential.md | 65 +++++++++++++++++-- .../revoke-a-verifiable-credential.md | 32 +++++++-- 2 files changed, 85 insertions(+), 12 deletions(-) diff --git a/sdk/aca-py/verifiable-credentials-and-presentations/present-a-verifiable-credential.md b/sdk/aca-py/verifiable-credentials-and-presentations/present-a-verifiable-credential.md index f0f2f61..59b29fc 100644 --- a/sdk/aca-py/verifiable-credentials-and-presentations/present-a-verifiable-credential.md +++ b/sdk/aca-py/verifiable-credentials-and-presentations/present-a-verifiable-credential.md @@ -1,11 +1,62 @@ # Present a Verifiable Credential -To present verifiable credentials, follow these steps: +Using the `/present-proof-2.0` API endpoints, it is possible to present Verifiable Credentials, signed by a cheqd DID, in a few clicks or lines of code. This process enables secure and trustworthy sharing of verifiable credentials within the ACA-Py framework and cheqd ecosystem. -1. **Establish a Connection with Verifier**: Initiate a DIDComm connection with the verifier using an out-of-band invitation or pre-existing connection. -2. **Receive Proof Request**: The verifier will request proof by sending a `/present-proof-2.0/send-request` message that outlines the required attributes and predicates. -3. **Create Proof**: Construct a proof presentation with valid credentials using the `/present-proof-2.0/records//send-presentation` API. -4. **Send Presentation**: Deliver the proof to the verifier and await their response. -5. **Verifiable Proof**: After the verifier evaluates the presentation, they will respond with either acceptance or rejection. +## Step 1: Create a Connection with Holder + +Use any supported method to create a connection with the Holder. Automated [out-of-band protocol](https://identity.foundation/didcomm-messaging/spec/#out-of-band-messages) is recommended. You can follow the same steps as described in [Issue a Verifiable Credential](issue-a-verifiable-credential.md#step-1-create-a-connection-with-holder). + +## Step 2: Send Proof Request + +After connection is established, the Verifier can send a proof request to the Holder. + +{% swagger src="../../../.gitbook/assets/swagger.json" path="/present-proof-2.0/send-request" method="post" %} +[swagger.json](../../../.gitbook/assets/swagger.json) +{% endswagger %} + +#### Sample Request Body + +The request body will depend on the credential, but here is a sample. + +```json +{ + "connection_id": "", + "auto_verify": false, + "auto_remove": false, + "comment": "Presentation request from Issuer", + "presentation_request": { + "anoncreds": { + "name": "proof", + "version": "1.0", + "requested_predicates": { + "additionalProp1": { + "name": "score", + "p_value": 40, + "p_type": ">", + "restrictions": [{"cred_def_id": ""}] + } + }, + "requested_attributes": {}, + "non_revoked": {"to": } + } + }, + "trace": false +} +``` + +## Step 3: Holder sends Presentation Proof + +Holder can get the stored credentials from own wallet and format a proof to send to the Verifier. + +{% swagger src="../../../.gitbook/assets/swagger.json" path="/present-proof-2.0/records/{pres_ex_id}/send-presentation" method="post" %} +[swagger.json](../../../.gitbook/assets/swagger.json) +{% endswagger %} + +## Step 4: Verifier verifies Presentation + +Verifier receives the presentation via the connection, and can use the following API to verify. The response must have `verified: true` . + +{% swagger src="../../../.gitbook/assets/swagger.json" path="/present-proof-2.0/records/{pres_ex_id}/verify-presentation" method="post" %} +[swagger.json](../../../.gitbook/assets/swagger.json) +{% endswagger %} -This process enables secure and trustworthy sharing of verifiable credentials within the ACA-Py framework and cheqd ecosystem. diff --git a/sdk/aca-py/verifiable-credentials-and-presentations/revoke-a-verifiable-credential.md b/sdk/aca-py/verifiable-credentials-and-presentations/revoke-a-verifiable-credential.md index c2663bc..b9f30f6 100644 --- a/sdk/aca-py/verifiable-credentials-and-presentations/revoke-a-verifiable-credential.md +++ b/sdk/aca-py/verifiable-credentials-and-presentations/revoke-a-verifiable-credential.md @@ -1,9 +1,31 @@ # Revoke a Verifiable Credential -To revoke credentials within the ACA-Py framework, follow these steps: +Revoking credentials is crucial for maintaining control over issued credentials and preventing misuse in the cheqd ecosystem. To revoke credentials within the ACA-Py framework, follow these steps: -1. **Identify Credential**: Determine the credential you need to revoke by referencing its unique identifier. -2. **Send Revoke Command**: Utilise the `/anoncreds/credentials/revoke` API endpoint to initiate the revocation process, supplying the necessary credential identifiers like the connection id and the credential exchange id. -3. **Confirm Revocation**: Verify that the credential has been successfully revoked by checking the response from the revocation API and sending a new presentation request (which should fail). +## Step 1: Issuer identifies Credential to be revoked -Revoking credentials is crucial for maintaining control over issued credentials and preventing misuse in the cheqd ecosystem. +The Issuer must determine the credential that needs to be revoked by getting the list of issued credentials and the connection id. + +## Step 2: Revoke Credential + +Initiate the credential revocation process by supplying the necessary credential identifiers like the connection id and the credential exchange id. + +{% swagger src="../../../.gitbook/assets/swagger.json" path="/anoncreds/revocation/revoke" method="post" %} +[swagger.json](../../../.gitbook/assets/swagger.json) +{% endswagger %} + +#### Sample Request Body + +```json +{ + "comment": "Revoke issued credential", + "connection_id": "", + "cred_ex_id": "", + "notify": true, + "publish": true +} +``` + +## Step 3: Verify Revocation + +Follow the steps to [Present a Verifiable Credential](present-a-verifiable-credential.md) to verify that the credential has been successfully revoked. The response should have `verified: false`.