digitalbazaar / did-method-key

A did-io driver for the DID "key" method
Other
25 stars 10 forks source link

Ensure "keyAgreement-only" DIDs such as one based on X25519 work properly #57

Open dlongley opened 1 year ago

dlongley commented 1 year ago

We should add examples and tests showing X25519-based DIDs. These are different from DIDs that use Ed25519 and then include a converted X25519 keyAgreement verification method. These DIDs use only X25519 and use the X25519 multibase-multikey header in the DID itself.

JSAssassin commented 1 year ago

@dlongley I had few questions regarding this issue:

  1. Is this what X25519-based DIDs will look like?
    const did = 'did:key:z6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc';
    const keyId = `${did}#z6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc`;
  2. Should I be using X25519KeyAgreementKey2020.from as the multibase-multikey deserializer for this?
  3. Are new changes required in the current methods to resolve such DIDs and to get their DID documents, or will the existing methods work for them just as well as for the other DIDs?
dlongley commented 1 year ago

@JSAssassin,

@dlongley I had few questions regarding this issue:

  1. Is this what X25519-based DIDs will look like?
const did = 'did:key:z6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc';
const keyId = `${did}#z6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc`;

Yes.

  1. Should I be using X25519KeyAgreementKey2020.from as the multibase-multikey deserializer for this?

We could -- and it should be possible to do that, but we need to make it all work with Multikey and that should be the main way to do it (the other way is legacy).

  1. Are new changes required in the current methods to resolve such DIDs and to get their DID documents, or will the existing methods work for them just as well as for the other DIDs?

I'm not quite sure I understand the question here -- but I think the answer is: You'll have to try it and see what breaks :). I expect there to be a few changes since this type of DID will be keyAgreement only.