-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add documentation for DIDMethods
* 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 <[email protected]>
- Loading branch information
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# DID methods in ACA-Py | ||
Decentralized Identifiers, or DIDs, are URIs that point to documents that describe cryptographic primitives and protocols used in decentralized identity management. | ||
DIDs include methods that describe where and how documents can be retrieved. | ||
DID methods support specific types of keys and may or may not require the holder to specify the DID itself. | ||
|
||
ACA-Py provides a `DIDMethods` registry holding all the DID methods supported for storage in a wallet | ||
|
||
> :warning: Askar and InMemory are the only wallets supporting this registry. | ||
## Registering a DID method | ||
By default, ACA-Py supports `did:key` and `did:sov`. | ||
Plugins can register DID additional methods to make them available to holders. | ||
Here's a snippet adding support for `did:web` to the registry from a plugin `setup` method. | ||
|
||
```python= | ||
WEB = DIDMethod( | ||
name="web", | ||
key_types=[ED25519, BLS12381G2], | ||
rotation=True, | ||
holder_defined_did=HolderDefinedDid.REQUIRED # did:web is not derived from key material but from a user-provided respository name | ||
) | ||
async def setup(context: InjectionContext): | ||
methods = context.inject(DIDMethods) | ||
methods.register(WEB) | ||
``` | ||
|
||
## Creating a DID | ||
|
||
`POST /wallet/did/create` can be provided with parameters for any registered DID method. Here's a follow-up to the | ||
`did:web` method example: | ||
|
||
```json= | ||
{ | ||
"method": "web", | ||
"options": { | ||
"did": "did:web:doma.in", | ||
"key_type": "ed25519" | ||
} | ||
} | ||
``` | ||
|
||
## Resolving DIDs | ||
|
||
For specifics on how DIDs are resolved in ACA-Py, see: [DID Resolution](DIDResolution.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters