-
Notifications
You must be signed in to change notification settings - Fork 239
Description
It's based on did-registration, but i've found it to be always very complex and error prone. You need to know exactly which parameters to provide to make it work.
I was thinking that instead, especially for update, we make an improved API that supports a set of well-known operations on a did document. A did registrar can choose to implement these operations if they are supported for the did method.
I think in the end there are four operations for a did document:
removeKeyaddKeyaddServiceremoveService
So providing an array of operations to perform on a did document sounds more logical, and will prevent a lot of complexity i think.
Thoughts? I'd also like to update the API to be more like other modules, where it detects the registered di methods, and the API is automatically adjusted.
A registrar could define a minimal set of operations (e.g. MUST have at least one addKey operation for key type Ed25519 as the first operation), or custom operations (if they have extensions, like endorsement on Indy).
An example is:
await agent.dids.create({
method: 'cheqd',
operations: [{
operation: 'addKey',
createKey: {
kty: 'OKP',
crv: 'Ed25519'
},
// or provide existing keyId
}]
})