Skip to content

Commit

Permalink
GITBOOK-344: 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 15, 2025
1 parent 24a327c commit 70331c6
Show file tree
Hide file tree
Showing 9 changed files with 160 additions and 11 deletions.
3 changes: 3 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
* [Create a DID](sdk/aca-py/decentralized-identifiers-dids/create-a-did.md)
* [Update a DID](sdk/aca-py/decentralized-identifiers-dids/update-a-did.md)
* [Deactivate a DID](sdk/aca-py/decentralized-identifiers-dids/deactivate-a-did.md)
* [DID-Linked Resources](sdk/aca-py/did-linked-resources/README.md)
* [Create AnonCreds Schema](sdk/aca-py/did-linked-resources/create-anoncreds-schema.md)
* [Create AnonCreds Credential Definition](sdk/aca-py/did-linked-resources/create-anoncreds-credential-definition.md)
* [Verifiable Credentials and Presentations](sdk/aca-py/verifiable-credentials-and-presentations/README.md)
* [Issue a Verifiable Credential](sdk/aca-py/verifiable-credentials-and-presentations/issue-a-verifiable-credential.md)
* [Present a Verifiable Credential](sdk/aca-py/verifiable-credentials-and-presentations/present-a-verifiable-credential.md)
Expand Down
2 changes: 1 addition & 1 deletion sdk/aca-py/decentralized-identifiers-dids/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A Decentralized Identifier "DID" is a globally unique identifier that does not require a centralized registration authority because it is registered with distributed ledger technology or other form of decentralized network.

{% hint style="info" %}
**Learn about DIDs** If you want to learn about what [DIDs are, please go over to our learning site here.](https://learn.cheqd.io/overview/introduction-to-decentralised-identity/what-is-a-decentralised-identifier-did)
**Learn about DIDs** If you want to learn about what [DIDs are, please go over to our learning site here.](https://learn.cheqd.io/decentralised-identity/dids)
{% endhint %}

## Get started
Expand Down
8 changes: 6 additions & 2 deletions sdk/aca-py/decentralized-identifiers-dids/create-a-did.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ Follow these instructions to create a new DID from ACA-Py Agent and publish the
For wallet storage, utilise a Postgres database to ensure key persistence, enabling future updates to the DID.

## Create DID

Populate the various `options`and `features`in the JSON request body and call the API to create the DID. 

{% swagger src="../../../.gitbook/assets/swagger.json" path="/did/cheqd/create" method="post" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}

#### Request Body
## Request Body

These are the variables that can be passed in the Body:

Expand All @@ -40,7 +44,7 @@ Optional Object with Key-Value format for additional configuration options, reco

</details>

### List DIDs associated with your wallet <a href="#list-dids-associated-with-your-account" id="list-dids-associated-with-your-account"></a>
## List DIDs associated with your wallet <a href="#list-dids-associated-with-your-account" id="list-dids-associated-with-your-account"></a>

After creating a DID or multiple DIDs, users can list all the created DIDs associated with their wallet. Using the `/wallet/did` API.

Expand Down
4 changes: 4 additions & 0 deletions sdk/aca-py/decentralized-identifiers-dids/deactivate-a-did.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Follow these instructions to deactivate a did:cheqd DID from ACA-Py Agent.
>
> Your wallet must have the key(s) which were generated when the DID was created, without them signing will fail.
## Deactivate DID

To deactivate an active DID, pass the `did`id in the request body, with any additional `options`that you may have configured.

{% swagger src="../../../.gitbook/assets/swagger.json" path="/did/cheqd/deactivate" method="post" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}
Expand Down
4 changes: 4 additions & 0 deletions sdk/aca-py/decentralized-identifiers-dids/update-a-did.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Follow these instructions to update a did:cheqd DID from ACA-Py Agent.
>
> Your wallet must have the key(s) which were generated when the DID was created, without them signing will fail.
## Update DID

To update an existing DID, you must pass the `did` id and the complete `didDocument`in the request body. The main field that is updated using this method os the `service` object of the DID.

{% swagger src="../../../.gitbook/assets/swagger.json" path="/did/cheqd/update" method="post" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}
Expand Down
8 changes: 8 additions & 0 deletions sdk/aca-py/did-linked-resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# DID-Linked Resources

**"DID-Linked Resources"** are identified with a [`did:cheqd` Decentralized Identifier](https://docs.cheqd.io/product/architecture/adr-list/adr-002-did-linked-resources) with a [Universally Unique Identifier (UUID)](https://www.uuidgenerator.net/) that acts as a permanently-accessible link to fetch the resources from the cheqd ledger. We refer to this as the "**resource ID**". Through the "**resource ID**" or a set of DID URL query parameters, applications are able to persistently access a digital resource on the cheqd network.

## Get started

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Understanding DLRs</strong></mark></td><td>More details about DID-Linked Resources on Cheqd.</td><td></td><td><a href="../../../studio/did-linked-resources/understanding-dlrs/">understanding-dlrs</a></td></tr><tr><td><mark style="color:blue;"><strong>Understanding AnonCreds</strong></mark></td><td>More details about AnonCreds Object Method.</td><td></td><td><a href="../../../advanced/anoncreds/">anoncreds</a></td></tr><tr><td><mark style="color:blue;"><strong>Create Schema</strong></mark></td><td>Create an AnonCreds Schema.</td><td></td><td><a href="create-anoncreds-schema.md">create-anoncreds-schema.md</a></td></tr><tr><td><mark style="color:blue;"><strong>Create Credential Definition</strong></mark></td><td>Create an AnonCreds Credential Definition</td><td></td><td><a href="create-anoncreds-credential-definition.md">create-anoncreds-credential-definition.md</a></td></tr></tbody></table>

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Create AnonCreds Credential Definition

## Create Credential Definition

The request body must contain the `credential_definition` object with the Issuer DID and the Schema ID created in the previous steps.

To enable revocation, the `options` must contain the revocation flag, and the size of the revocation registry. Also, ensure that a [Tails Server](https://github.com/bcgov/indy-tails-server) is configured for the issuer.

{% swagger src="../../../.gitbook/assets/swagger.json" path="/anoncreds/credential-definition" method="post" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}

## Request Body

<details>

<summary>credential_definition (mandatory)</summary>

"issuerId": DID of the Issuer.

"schemaId": The AnonCreds Schema ID created by the Issuer (must be of the same DID).

"tag": Additional Name to identify the Credential Definition.

</details>

<details>

<summary>options (optional)</summary>

"support\_revocation": Boolean value to indicate that the Credential can be revoked or not. (Tails server must be configured if this is set to \`true\`)

"revocation\_registry\_size": Maximum size of the Revocation Registry.

</details>

## Check the new Credential Definition

{% swagger src="../../../.gitbook/assets/swagger.json" path="/anoncreds/credential-definition/{cred_def_id}" method="get" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}







48 changes: 48 additions & 0 deletions sdk/aca-py/did-linked-resources/create-anoncreds-schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Create AnonCreds Schema

To issue Verifiable Credentials, the issuer will have to first create a Schema and then a Credential Definition.

## Create Schema

The request body must contain the `schema` object, which defines the attributes, name and version of the Schema. This will create a [DID-Linked Resource](https://docs.cheqd.io/product/sdk/veramo-plugin/did-linked-resources) of type `anonCredsSchema`.

{% swagger src="../../../.gitbook/assets/swagger.json" path="/anoncreds/schema" method="post" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}

## Request Body

<details>

<summary>options (optional)</summary>

Optional Key-Value pairs of additional options.

</details>

<details>

<summary>schema (mandatory)</summary>

"attrNames": Array of attributes for the schema definition.

"issuerId": Issuer DID, use the did created by the Issuer.

"name": Name of the Schema

"version": Version of the Schema (To update existing Schema, use same name and different version)

</details>

## Check the new Schema

{% swagger src="../../../.gitbook/assets/swagger.json" path="/anoncreds/schema/{schema_id}" method="get" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}







Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
# Issue a Verifiable Credential

After creating cheqd DIDs, you can issue verifiable credentials using the ACA-Py agent. Here's how:
Using the `/issue-credential-2.0` API endpoints, it is possible to issue Verifiable Credentials, signed by a cheqd DID, in a few clicks or lines of code. By following the following steps, you can effectively issue verifiable credentials using ACA-Py integrated with the cheqd ecosystem.

## Step 1: Create a Connection with Holder

Use any supported method to create a connection with the Holder of the credential. Automated [out-of-band protocol](https://identity.foundation/didcomm-messaging/spec/#out-of-band-messages) is recommended.

## Step 2: Prepare Credential Offer

Generate a credential offer using the `/issue-credential-2.0/send-offer` API. This offer is sent to the holder, informing them about the available credential and its attributes.

{% swagger src="../../../.gitbook/assets/swagger.json" path="/issue-credential-2.0/send-offer" method="post" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}

## Step 3: Holder accepts credential offer

The Holder has to retrieve the credential exchange id, and call this API to accept the offer.

{% swagger src="../../../.gitbook/assets/swagger.json" path="/issue-credential/records/{cred_ex_id}/send-request" method="post" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}

## Step 4: Issue Credential

Once the credential request is received and validated, issue the credential using the `/issue-credential-2.0/records/<exchange-id>/issue` API endpoint.

{% swagger src="../../../.gitbook/assets/swagger.json" path="/issue-credential-2.0/records/{cred_ex_id}/issue" method="post" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}

## Step 5: Holder stores Credential

The Holder has to store the issued credential into their wallet using the following API.

{% swagger src="../../../.gitbook/assets/swagger.json" path="/issue-credential-2.0/records/{cred_ex_id}/store" method="post" %}
[swagger.json](../../../.gitbook/assets/swagger.json)
{% endswagger %}


1. **Create a Schema**: Create as Anoncreds Schema with the newly created DID as `issuerId` using the API `POST /anoncreds/schema`. This will create a [DID-Linked Resource](../../veramo-plugin/did-linked-resources/) of type `anonCredsSchema`.
2. **Create a Credential Definition**: Using the Schema ID from the previous step, create an Anoncreds Credential Definition using the API `POST /anoncreds/credential-definition`. Here you can pass the `support_revocation` option. Ensure that a [Tails Server](https://github.com/bcgov/indy-tails-server) is configured for the issuer.&#x20;
3. **Create Connection with Holder:** Use any supported method to create the connection with the holder of the credential. Automated [out-of-band protocol](https://identity.foundation/didcomm-messaging/spec/#out-of-band-messages) recommended.
4. **Prepare Credential Offer**: Generate a credential offer using the `/issue-credential-2.0/send-offer` API. This offer is sent to the holder, informing them about the available credential and its attributes.
5. **Receive Credential Request**: Wait for the holder to respond with a credential request, which will include proof of possession of the necessary private keys.
6. **Issue Credential**: Once the credential request is received and validated, issue the credential using the `/issue-credential-2.0/records/<exchange-id>/issue` API endpoint.

By following these steps, you can effectively issue verifiable credentials using ACA-Py integrated with the cheqd ecosystem.

0 comments on commit 70331c6

Please sign in to comment.