> For the complete documentation index, see [llms.txt](https://docs.cheqd.io/product/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cheqd.io/product/sdk/veramo/dids/create-subject-did.md).

# Create an off-ledger holder DID

This tutorial offers step-by-step guidance on how to create a subject DID to be used for a holder that will receive a Verifiable Credentials.

> ⚠️ **Before you begin...**
>
> Make sure you've correctly [configured the cheqd plugin's agent settings](/product/sdk/veramo/setup.md) for Veramo CLI

## Background

We chose to use [`did:key`](https://w3c-ccg.github.io/did-key-spec/) for the holder because the [`did:key`](https://w3c-ccg.github.io/did-key-spec/) specification has a lot synergy with cheqd did method, [`did:cheqd`](/product/architecture/adr-list/adr-001-cheqd-did-method.md).

Using [`did:key`](https://w3c-ccg.github.io/did-key-spec/) also keeps holder DIDs off-ledger. This is very important for the privacy and data protection of the holder. If holder DIDs and DIDDocs were stored on-ledger, this could constitute a risk where data written within the DIDDoc could not be removed in line with a holder's right to be forgotten.

It is also easily managable by a client agent as a full ledger backup for the writing of a DID / DID Doc is not required, thereby making it easily reproducable in a client environment.

Creating a subject [`did:key`](https://w3c-ccg.github.io/did-key-spec/) DID can be achieved through both the Veramo CLI, or directly through an application that has been setup to read and write to the cheqd ledger, using the Veramo SDK for cheqd.

## Instructions

### 1. Invoke Veramo CLI DID create function

This off-ledger DID, of type `did:key`, is used for the recipient of the Verifiable Credential and Verifiable Presentation using:

```bash
veramo did create
```

### 2. Select the `did:key` provider and KMS

Select `did:key` as the provider when prompted as well as a key management system (KMS) to use (default is `local`).

The [`agent.yml`](https://github.com/cheqd/did-provider-cheqd/blob/main/agent.yml) file used for the Veramo SDK for cheqd has a preloaded local key management system which is bootstrapped along with the CLI.

The KMS is stored in a local SQLite database.

### 3. Enter an alias for the DID

This is the nickname for your DID, which will be managed by Veramo KMS. Providing a memorable alias will help reference this for future uses, e.g., `Alice off ledger DID`.

Once you have entered this, you will receive a response in a table, e.g:

| provider | alias                | did                                                        |   |
| -------- | -------------------- | ---------------------------------------------------------- | - |
| did:key  | Alice off ledger DID | `did:key:z6MkjxdqDUWoudesywsGYbzGozUeVYiYVArdoqPcMV6m6MG4` |   |

## Next steps

If you got the table above, your off-ledger `did:key` has been created


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cheqd.io/product/sdk/veramo/dids/create-subject-did.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
