Skip to content

Commit

Permalink
GITBOOK-346: change request with no subject merged in GitBook
Browse files Browse the repository at this point in the history
  • Loading branch information
sownak authored and gitbook-bot committed Jan 16, 2025
1 parent 112354b commit a2157be
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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/<exchange-id>/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": "<verifier-to-holder-conn-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": "<cred-def-id>"}]
}
},
"requested_attributes": {},
"non_revoked": {"to": <some-time-in-future>}
}
},
"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.
Original file line number Diff line number Diff line change
@@ -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": "<issuer--to-holder-conn-id>",
"cred_ex_id": "<issuer-cred-exchange-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`.

0 comments on commit a2157be

Please sign in to comment.