Skip to content

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

@gmulhearn

Description

@gmulhearn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions