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

Enhancement: did document fields #292

Closed
6 tasks done
borisrizov-zf opened this issue Apr 26, 2024 · 1 comment
Closed
6 tasks done

Enhancement: did document fields #292

borisrizov-zf opened this issue Apr 26, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@borisrizov-zf
Copy link
Contributor

borisrizov-zf commented Apr 26, 2024

Description

The current implementation of the MIW doesn't fully describe the DID document. The verificationMethod field and the assertionMethod field must be optimised.

Acceptance Criteria

  • both the Ed25519 and the secp256k1 curve keys must be present in the verificationMethod of a did document
  • both public keys must be expressed in the assertionMethod
  • both public keys will use the JsonWebKey2020 verification method type
  • both public keys will include the publicKeyJwk format to express the public key
  • the keys MAY be referenced by their id inside the assertionMethod field or they can be embedded (JsonWebKey2020 type)
  • the controller for the keys is the MIW

Additional Information

Examples:

VerificationMethod with one embedded public key (Ed25519) in JsonWebKey2020 format and a reference inside the assertionMethod

# a snippet from a did document
...
"verificationMethod": [{
    "id": "did:example:123#_Qq0UL2Fq651Q0Fjd6TvnYE-faHiOpRlPVQcY_-tA4A",
    "type": "JsonWebKey2020", 
    "controller": "did:example:123",
    "publicKeyJwk": {
      "crv": "Ed25519", 
      "x": "VCpo2LMLhn6iWku8MKvSLg2ZAoC-nlOyPVQaO3FxVeQ", 
      "kty": "OKP", 
      "kid": "_Qq0UL2Fq651Q0Fjd6TvnYE-faHiOpRlPVQcY_-tA4A" 
    }
  }],
"assertionMethod" ["did:example:123#_Qq0UL2Fq651Q0Fjd6TvnYE-faHiOpRlPVQcY_-tA4A"],
...

Same as above, but a 'secp256k1' key

# a snippet from a did document
...
"verificationMethod": [{
      "id": "did:example:123#key-2",
      "type": "JsonWebKey2020",
      "controller": "did:example:123",
      "publicKeyJwk": {
        "kty": "EC", // external (property name)
        "crv": "secp256k1", // external (property name)
        "x": "Z4Y3NNOxv0J6tCgqOBFnHnaZhJF6LdulT7z8A-2D5_8", // external (property name)
        "y": "i5a2NtJoUKXkLm6q8nOEu9WOkso1Ag6FTUT6k_LMnGk" // external (property name)
      }
    }],
"assertionMethod" ["did:example:123#key-2"],
...
@nitin-vavdiya
Copy link
Contributor

updated did document:

{
  "assertionMethod": [
    "did:web:localhost:BPNL000000000000#719273e5-f1d4-4a48-b981-c29f47d99d60",
    "did:web:localhost:BPNL000000000000#a14a1135-09d7-4ff1-9896-2336f915a698"
  ],
  "id": "did:web:localhost:BPNL000000000000",
  "verificationMethod": [
    {
      "publicKeyJwk": {
        "kty": "OKP",
        "crv": "Ed25519",
        "x": "J7bSq0d5Vq7hfGJNBv7W-JLf6YndRLC2JGLLFi0f7-A"
      },
      "controller": "did:web:localhost:BPNL000000000000",
      "id": "did:web:localhost:BPNL000000000000#719273e5-f1d4-4a48-b981-c29f47d99d60",
      "type": "JsonWebKey2020"
    },
    {
      "publicKeyJwk": {
        "crv": "secp256k1",
        "y": "KYE6l0muY7iVCbyipjo3r-6oro5UKi5THbOH5AQGiI8",
        "x": "O8z3qeiui-zJy2-rf98j3-vchUK_G6RZz1vSGltFC0o",
        "kty": "EC"
      },
      "controller": "did:web:localhost:BPNL000000000000",
      "id": "did:web:localhost:BPNL000000000000#a14a1135-09d7-4ff1-9896-2336f915a698",
      "type": "JsonWebKey2020"
    }
  ],
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://w3c.github.io/vc-jws-2020/contexts/v1"
  ],
  "service": [
    {
      "serviceEndpoint": "https://localhost/api/token",
      "id": "did:web:localhost:BPNL000000000000#SecurityTokenService",
      "type": "SecurityTokenService"
    },
    {
      "serviceEndpoint": "https://localhost",
      "id": "did:web:localhost:BPNL000000000000#CredentialService",
      "type": "CredentialService"
    }
  ]
}

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

No branches or pull requests

4 participants