Verifiable Credential

Credentials should conform to the Verifiable Credentials Data Model 1.1 or Verifiable Credentials Data Model 2.0, expressed as JSON-LD. The fields noted below consist only of those with requirements or semantics that differ from the underlying specification.

JSON-LD Contexts

The following JSON-LD context values are valid for use with DSNP:

Object@context
Verifiable Credentialhttps://www.w3.org/2018/credentials/v1
https://www.w3.org/ns/credentials/v2

Verifiable Credential Document

A DSNP Verifiable Credential JSON document specializes the following fields:

PropertyRequiredJSON TypeDescriptionRestrictions
@contextYESArray of stringsJSON-LD @contextMUST include "https://www.w3.org/2018/credentials/v1" or "https://www.w3.org/ns/credentials/v2"
typeYESArray of stringsType of credentialMUST contain "VerifiableCredential" per specification; if a credentialSchema is present, MUST also contain a string matching the referenced JSON Schema's title.
issuerYESString or ObjectDID or object identifying credential issuerSee Issuer
credentialSubjectYESObjectObject identifying subject and claimSee Credential Subject
credentialSchemanoObjectReference to schema for this credentialSee Credential Schema
proofnoObjectCryptographic proof of authorship by issuerSee Proof

Issuer

The issuer field is required, even for credentials that do not include a proof. Unsigned documents should still use the document creator's DID.

The issuer field may be a string that is the issuer's DID, or an object with the issuer's DID as the id property.

In the object form, the issuer may optionally include references to its own credentials, which may be used by a verifier processing the DSNP trust extension.

PropertyRequiredJSON TypeDescriptionRestrictions
idYESStringDID of issuerMust be a DSNP DID
authoritynoArrayList of relevant credentials with issuer as subjectSee Authority

Authority

Objects in the issuer.authority array MUST have the following properties:

PropertyRequiredJSON TypeDescriptionRestrictions
idYESStringURL of Verifiable CredentialMUST be a DSNP Verifiable Credential
relYESStringThe linked credential's attribute set typeMUST be a DSNP Attribute Set Type corresponding to the referenced credential document
digestMultibaseYESArrayArray of hashes for linked content validationMUST include at least one supported hash

Examples:

"issuer": "did:dsnp:86420"
"issuer": {
  "id": "did:dsnp:86420",
  "authority": [
    {
      "id": "https://mydsnpcreds.net/86420-fp",
      "rel": "did:dsnp:123456$FairTradeProducer",
      "digestMultibase": [
        "bciqdnu347gcfmxzbkhgoubiobphm6readngitfywktdtbdocgogop2q"
      ]
    },
    {
      "id": "https://mydsnpcreds.net/86420-ap",
      "rel": "did:dsnp:123456$AppleProducer",
      "digestMultibase": [
        "bdyqhwoxp2mc6oyaqpqyd2fvaxralslk32ggazv6nxpp342iec6652tq"
      ]
    }
  ]
}

Credential Subject

PropertyRequiredJSON TypeDescriptionRestrictions
idYESStringSubject of the claim dataIf describing a DSNP User, MUST be a DSNP User URI; if describing DSNP content, MUST be a DSNP Content URI

The remainder of the contents of the credentialSubject value MUST conform to the JSON schema found via the credentialSchema object.

Credential Schema

PropertyRequiredJSON TypeDescriptionRestrictions
idYESStringURL of schema documentIf type is JsonSchemaCredential, MUST reference a DSNP Verifiable Credential Schema

Proof

PropertyRequiredJSON TypeDescriptionRestrictions
typeYESStringProof typeMUST be DataIntegrityProof
verificationMethodYESStringURI of public keyMUST reference a public key within a DSNP DID document
cryptosuiteYESStringCryptographic algorithm identifierMUST be eddsa-rdfc-2022
proofPurposeYESStringContext for assessing proofMUST be assertionMethod
proofValueYESStringDigital signature proofMUST be a multibase-encoded signature using base58btc encoding

Example

{
  "@context": [
    "https://www.w3.org/ns/credentials/v2"
  ],
  "type": [
    "VehicleOwner",
    "VerifiableCredential"
  ],
  "issuer": "did:dsnp:654321",
  "issuanceDate": "2024-02-12T03:09:40.497Z",
  "credentialSchema": {
    "type": "JsonSchemaCredential",
    "id": "https://dsnp.org/schema/examples/vehicle_owner.json"
  },
  "credentialSubject": {
    "id": "dsnp://999999",
    "make": "DeLorean",
    "model": "DMC-12",
    "year": 1981
  },
  "proof": {
    "type": "DataIntegrityProof",
    "created": "2024-02-12T03:09:44Z",
    "verificationMethod": "did:dsnp:654321#z6Mkumvf8FpJybzi9byLX7qAhTPuKpqH7d5rWyqcrKJ9Mies",
    "cryptosuite": "eddsa-rdfc-2022",
    "proofPurpose": "assertionMethod",
    "proofValue": "z2YLydotgaGsbRGRxPzmoscd7dH5CgGHydXLKXJXefcT2SJGExtxmkJxGfUGoe81Vm62JGEYrwcS6ht1ixEvuZF9c"
  }
}