Friday, January 1, 2021

minimal did document from did core:::

expanding:

Example 2: Minimal self-managed DID document
(https://www.w3.org/TR/did-core/)


Start with: https://json-ld.org/playground/ :

{
  "@context": "https://www.w3.org/ns/did/v1",
  "id": "did:example:123456789abcdefghi",
  "authentication": [{
    


    "id": "did:example:123456789abcdefghi#keys-1",
    "type": "Ed25519VerificationKey2018",
    "controller": "did:example:123456789abcdefghi",
    "publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
  }],
  "service": [{
    


    "id":"did:example:123456789abcdefghi#vcs",
    "type": "VerifiableCredentialService",
    "serviceEndpoint": "https://example.com/vc/"
  }]
}

--------------

[
  {
    "https://w3id.org/security#authenticationMethod": [
      {
        "https://w3id.org/security#controller": [
          {
            "@id": "did:example:123456789abcdefghi"
          }
        ],
        "@id": "did:example:123456789abcdefghi#keys-1",
        "https://w3id.org/security#publicKeyBase58": [
          {
            "@value": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
          }
        ],
        "@type": [
          "https://w3id.org/security#Ed25519VerificationKey2018"
        ]
      }
    ],
    "@id": "did:example:123456789abcdefghi",
    "https://w3id.org/did#service": [
      {
        "@id": "did:example:123456789abcdefghi#vcs",
        "https://w3id.org/did#serviceEndpoint": [
          {
            "@id": "https://example.com/vc/"
          }
        ],
        "@type": [
          "https://json-ld.org/playground/VerifiableCredentialService"
        ]
      }
    ]
  }
]

------------------------------

https://www.easyrdf.org/converter

leads to::

-----------------------------------

@prefix ns0: <https://w3id.org/did#> .
@prefix ns1: <https://w3id.org/security#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<did:example:123456789abcdefghi>
  ns0:service <did:example:123456789abcdefghi#vcs> ;
  ns1:authenticationMethod <did:example:123456789abcdefghi#keys-1> .

<did:example:123456789abcdefghi#vcs>
  a <https://json-ld.org/playground/VerifiableCredentialService> ;
  ns0:serviceEndpoint <https://example.com/vc/> .

<did:example:123456789abcdefghi#keys-1>
  a ns1:Ed25519VerificationKey2018 ;
  ns1:controller <did:example:123456789abcdefghi> ;
  ns1:publicKeyBase58 "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"^^xsd:string .




No comments:

Post a Comment