# DID Controller Keypair

Create a new DID controller keypair using openssl. In this example, we use Ed25519, but other algorithms are also supported (see specification).

{% hint style="info" %}
Make sure you have openssl & GNU coreutils installed and avalible on command line (e.g. `brew install coreutils` on macOS)
{% endhint %}

```bash
openssl genpkey -algorithm ed25519 -outform DER >privkey
openssl pkey -in privkey -pubout -out pubkey -inform DER -outform DER
```

This creates two files, `pubkey` and `privkey`.

Depending on the method, the public key is encoded in either

* Base64 URL (`base64url`)
* Base58 (`base58`)

### FAQ

#### How do I install `base58` app (on macOS).

There are two ways to install it. If one app doesn't work, try the other one.

```bash
# using howbrew
brew install base58
# using cargo (requires rust tooling to be installed)
cargo install bs58-cli
## hint latter works best by symlinking: ln -s source_path target_in_path/base58
```

#### How to install & use `openssl 3` (on macOS).

Some newer features are only available in the latest version of openssl, version 3. To install it

```bash
brew install openssl@3
```

It is not automatically added to the path as macOS uses LibreSSL. Therefore you can use the absolute path.

```
/opt/homebrew/opt/openssl@3/bin/openssl
```


---

# Agent Instructions: 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:

```
GET https://docs.meeco.me/guides/api-guides/dids/did-controller-keypair.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
