Open mirceanis opened 2 years ago
removing this from milestone v4 since it can be done as a feature release, without a breaking change
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.
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:proofType
will describe the algorithm (e.g.EdDSA
,Ed25519Signature2018
), instead ofjwt
/lds
/712
keyRef
will specify either theid
of the verification method from the issuer DID document, or the internalkid
known by@veramo/key-manager
/@veramo/did-manager
The algorithm for creating proofs would change to:
keyRef
, if one is supplied,proofType
.Implications
keyRef
does not refer to an internal key IDKMS
implementations becomes very important to decide if an algorithm or proof type is supported by a key. If this metadata is not available, some heuristics can be hardcoded, based on known key types.