You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Augment existing swagger documentation for the `POST
/wallet/did/create` route
* Add `DIDMethods.md` documentation to introduce the concept of the
`DIDMethods` registry and its use to register new methods.
Signed-off-by: Clément Humbert <clement.humbert@sicpa.com>
Decentralized Identifiers, or DIDs, are URIs that point to documents that describe cryptographic primitives and protocols used in decentralized identity management.
3
+
DIDs include methods that describe where and how documents can be retrieved.
4
+
DID methods support specific types of keys and may or may not require the holder to specify the DID itself.
5
+
6
+
ACA-Py provides a `DIDMethods` registry holding all the DID methods supported for storage in a wallet
7
+
8
+
> :warning: Askar and InMemory are the only wallets supporting this registry.
9
+
10
+
## Registering a DID method
11
+
By default, ACA-Py supports `did:key` and `did:sov`.
12
+
Plugins can register DID additional methods to make them available to holders.
13
+
Here's a snippet adding support for `did:web` to the registry from a plugin `setup` method.
14
+
15
+
```python=
16
+
WEB = DIDMethod(
17
+
name="web",
18
+
key_types=[ED25519, BLS12381G2],
19
+
rotation=True,
20
+
holder_defined_did=HolderDefinedDid.REQUIRED # did:web is not derived from key material but from a user-provided respository name
21
+
)
22
+
23
+
async def setup(context: InjectionContext):
24
+
methods = context.inject(DIDMethods)
25
+
methods.register(WEB)
26
+
```
27
+
28
+
## Creating a DID
29
+
30
+
`POST /wallet/did/create` can be provided with parameters for any registered DID method. Here's a follow-up to the
31
+
`did:web` method example:
32
+
33
+
```json=
34
+
{
35
+
"method": "web",
36
+
"options": {
37
+
"did": "did:web:doma.in",
38
+
"key_type": "ed25519"
39
+
}
40
+
}
41
+
```
42
+
43
+
## Resolving DIDs
44
+
45
+
For specifics on how DIDs are resolved in ACA-Py, see: [DID Resolution](DIDResolution.md).
0 commit comments