decentralized-identity / veramo

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

Improve key/suite/algorithm choice when creating VC/VP #926

Open mirceanis opened 2 years ago

mirceanis commented 2 years ago

Background

It is very ambiguous exactly what key or algorithm will be used when creating a credential or presentation in Veramo 3.1 (&next).

Some keys can be used to sign using multiple algorithms / signature suites. For example, a Secp256k1 key can be used for: ES256K(jwt), ES256K-R(jwt), EthereumEIP712Signature2021(JSON), EcdsaSecp256k1RecoverySignature2020(JSON-LD), EcdsaSecp256k1Signature 2019(JSON-LD), and a few others.

Some issuer DIDs have multiple keys that can be used for signing. If a new key is added specifically to sign new credentials, it won't automatically be used, especially if another managed key of the same type is found first.

Proposal

I propose the following changes to the createVerifiable*() method arguments:

The algorithm for creating proofs would change to:

Implications

mirceanis commented 2 years ago

removing this from milestone v4 since it can be done as a feature release, without a breaking change

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.