Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpopulated DIDDoc Verification Method keys in did:sov resolution #1089

Open
gmulhearn opened this issue Dec 18, 2023 · 0 comments
Open

Unpopulated DIDDoc Verification Method keys in did:sov resolution #1089

gmulhearn opened this issue Dec 18, 2023 · 0 comments

Comments

@gmulhearn
Copy link
Contributor

https://github.com/hyperledger/aries-vcx/blob/main/did_core/did_methods/did_resolver_sov/src/resolution/utils.rs#L106C9-L106C54

The DIDDoc returned from .resolve of the did_resolver_sov crate does not have verification methods set in line with the spec.

https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html#crud-operation-definitions

My reading of the spec is that you're meant to do the following for verification methods:

  • read ledger for NYM
  • add 2 default keys to verificationMethod array: did:sov:...#key-1 & did:sov:...#key-agreement-1
  • add did:sov:...#key-1 as a reference in the authentication and assertionMethod arrays
  • add did:sov:...#key-agreement-1 as a reference in the keyAgreement array

e.g.:

{
...,
 "id": "did:sov:HR6vs6GEZ8rHaVgjg2WodM",
  "verificationMethod": [
    {
      "type": "Ed25519VerificationKey2018",
      "id": "did:sov:HR6vs6GEZ8rHaVgjg2WodM#key-1",
      "publicKeyBase58": "9wvq2i4xUa5umXoThe83CDgx1e5bsjZKJL4DEWvTP9qe"
    },
    {
      "type": "X25519KeyAgreementKey2019",
      "id": "did:sov:HR6vs6GEZ8rHaVgjg2WodM#key-agreement-1",
      "publicKeyBase58": "3mHtKcQFEzqeUcnce5BAuzAgLEbqKaV542pUf9xQ5Pf8"
    }
  ],
  "authentication": [
    "did:sov:HR6vs6GEZ8rHaVgjg2WodM#key-1"
  ],
  "assertionMethod": [
    "did:sov:HR6vs6GEZ8rHaVgjg2WodM#key-1"
  ],
  "keyAgreement": [
    "did:sov:HR6vs6GEZ8rHaVgjg2WodM#key-agreement-1"
  ],
}

Whereas we are returning:

{
...,
"id": "did:sov:E8GUCXah1MrW4NtxRxiDzt",
  "verificationMethod": [
    {
      "id": "did:sov:E8GUCXah1MrW4NtxRxiDzt",
      "controller": "did:sov:E8GUCXah1MrW4NtxRxiDzt",
      "type": "Ed25519VerificationKey2018",
      "publicKeyBase58": "89v9CRHEtKigUj6H4uPjc7pZ6H8RUvawp7zdD6iyyff7"
    }
  ],
}

Also note that this is a somewhat trivial fix, other than computing the #key-agreement-1 key. That will require a cryptographic conversion from the Ed25519 base58 pubkey to X25519 base58 pubkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant