From 70331c69331368671dda495a88982ae433d7dc99 Mon Sep 17 00:00:00 2001 From: Sownak Roy Date: Wed, 15 Jan 2025 15:14:58 +0000 Subject: [PATCH] GITBOOK-344: change request with no subject merged in GitBook --- SUMMARY.md | 3 ++ .../decentralized-identifiers-dids/README.md | 2 +- .../create-a-did.md | 8 +++- .../deactivate-a-did.md | 4 ++ .../update-a-did.md | 4 ++ sdk/aca-py/did-linked-resources/README.md | 8 ++++ .../create-anoncreds-credential-definition.md | 48 +++++++++++++++++++ .../create-anoncreds-schema.md | 48 +++++++++++++++++++ .../issue-a-verifiable-credential.md | 46 ++++++++++++++---- 9 files changed, 160 insertions(+), 11 deletions(-) create mode 100644 sdk/aca-py/did-linked-resources/README.md create mode 100644 sdk/aca-py/did-linked-resources/create-anoncreds-credential-definition.md create mode 100644 sdk/aca-py/did-linked-resources/create-anoncreds-schema.md diff --git a/SUMMARY.md b/SUMMARY.md index 70246fc..312e742 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -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) diff --git a/sdk/aca-py/decentralized-identifiers-dids/README.md b/sdk/aca-py/decentralized-identifiers-dids/README.md index 0ab6916..63ffa3f 100644 --- a/sdk/aca-py/decentralized-identifiers-dids/README.md +++ b/sdk/aca-py/decentralized-identifiers-dids/README.md @@ -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 diff --git a/sdk/aca-py/decentralized-identifiers-dids/create-a-did.md b/sdk/aca-py/decentralized-identifiers-dids/create-a-did.md index d7023ea..394e36f 100644 --- a/sdk/aca-py/decentralized-identifiers-dids/create-a-did.md +++ b/sdk/aca-py/decentralized-identifiers-dids/create-a-did.md @@ -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: @@ -40,7 +44,7 @@ Optional Object with Key-Value format for additional configuration options, reco -### List DIDs associated with your wallet +## List DIDs associated with your wallet After creating a DID or multiple DIDs, users can list all the created DIDs associated with their wallet. Using the `/wallet/did` API. diff --git a/sdk/aca-py/decentralized-identifiers-dids/deactivate-a-did.md b/sdk/aca-py/decentralized-identifiers-dids/deactivate-a-did.md index 0481657..104cccd 100644 --- a/sdk/aca-py/decentralized-identifiers-dids/deactivate-a-did.md +++ b/sdk/aca-py/decentralized-identifiers-dids/deactivate-a-did.md @@ -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 %} diff --git a/sdk/aca-py/decentralized-identifiers-dids/update-a-did.md b/sdk/aca-py/decentralized-identifiers-dids/update-a-did.md index 68d2b04..1599f64 100644 --- a/sdk/aca-py/decentralized-identifiers-dids/update-a-did.md +++ b/sdk/aca-py/decentralized-identifiers-dids/update-a-did.md @@ -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 %} diff --git a/sdk/aca-py/did-linked-resources/README.md b/sdk/aca-py/did-linked-resources/README.md new file mode 100644 index 0000000..660c579 --- /dev/null +++ b/sdk/aca-py/did-linked-resources/README.md @@ -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 + +
Understanding DLRsMore details about DID-Linked Resources on Cheqd.understanding-dlrs
Understanding AnonCredsMore details about AnonCreds Object Method.anoncreds
Create SchemaCreate an AnonCreds Schema.create-anoncreds-schema.md
Create Credential DefinitionCreate an AnonCreds Credential Definitioncreate-anoncreds-credential-definition.md
+ diff --git a/sdk/aca-py/did-linked-resources/create-anoncreds-credential-definition.md b/sdk/aca-py/did-linked-resources/create-anoncreds-credential-definition.md new file mode 100644 index 0000000..caa9356 --- /dev/null +++ b/sdk/aca-py/did-linked-resources/create-anoncreds-credential-definition.md @@ -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 + +
+ +credential_definition (mandatory) + +"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. + +
+ +
+ +options (optional) + +"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. + +
+ +## 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 %} + + + + + + + diff --git a/sdk/aca-py/did-linked-resources/create-anoncreds-schema.md b/sdk/aca-py/did-linked-resources/create-anoncreds-schema.md new file mode 100644 index 0000000..afc6623 --- /dev/null +++ b/sdk/aca-py/did-linked-resources/create-anoncreds-schema.md @@ -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 + +
+ +options (optional) + +Optional Key-Value pairs of additional options. + +
+ +
+ +schema (mandatory) + +"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) + +
+ +## Check the new Schema + +{% swagger src="../../../.gitbook/assets/swagger.json" path="/anoncreds/schema/{schema_id}" method="get" %} +[swagger.json](../../../.gitbook/assets/swagger.json) +{% endswagger %} + + + + + + + diff --git a/sdk/aca-py/verifiable-credentials-and-presentations/issue-a-verifiable-credential.md b/sdk/aca-py/verifiable-credentials-and-presentations/issue-a-verifiable-credential.md index 892376f..26b13b6 100644 --- a/sdk/aca-py/verifiable-credentials-and-presentations/issue-a-verifiable-credential.md +++ b/sdk/aca-py/verifiable-credentials-and-presentations/issue-a-verifiable-credential.md @@ -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//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. -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//issue` API endpoint. -By following these steps, you can effectively issue verifiable credentials using ACA-Py integrated with the cheqd ecosystem.