decentralized-identity / veramo

A JavaScript Framework for Verifiable Data
https://veramo.io
Apache License 2.0
414 stars 130 forks source link

[proposal] forward DID resolution options to the DID resolver when creating or verifying credentials #1343

Closed mirceanis closed 4 months ago

mirceanis commented 4 months ago

Is your feature request related to a problem? Please describe. Issuing and verifying credentials and presentations relies on calls to the DID resolver. This resolver can behave differently depending on some options provided to it.

Describe the solution you'd like The arguments object for createVerifiableCredential() and similar methods should accept a resolutionOptions parameter so that the resolver behavior can be tweaked to suit certain constraints.

Describe alternatives you've considered The alternative is to use highly customized resolvers with these options hardcoded which severely limits the general purpose use of Veramo instances created like that.

Additional context Example: resolving an Ed25519 did:key results in a document containing Multikey or JsonWebKey2020 verification methods by default. However, Ed25519Signature2020 proofs require the issuer keys to be expressed as Ed25519VerificationKey2020. Having such resolution options would allow did:key resolvers to return properly formatted documents using the publicKeyFormat tweak that can be used with them.