Resolution (DCP)

Specifications and best practice implementations for Verifiable Credentials are currently being developed. This page is expected to be updated, closely following these developments.

The POST request to the /presentations/query endpoint queries the holder for credentials, after which the holder sends a set of Verifiable Presentations as a response.

The POST request to the /presentations/query is an OPTIONAL endpoint and is part of the iSHARE Framework's Verifiable Credentials support in line with the Decentralised Claims Protocol (DCP).

Verifier requests Verifiable Presentation from holder

post

The Resolution API defines the Credential Service endpoint for querying credentials and returning a set of Verifiable Presentations. More information in the [DCP specification](https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/#resolution-api.

Authorizations
AuthorizationstringRequired

iSHARE JWT Bearer token authentication

Body
all ofOptional
Responses
200

VP request received successfully

application/json
Responseall of
post
/presentations/query
POST /presentations/query HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
{}

Request model

The model for the PresentationQueryMessage is defined in: https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/resources/presentation/presentation-query-message-schema.json. Verifiable presentations containing credentials may be requested using scopes or using a presentation definition.

  • @context Array of Strings. Root level. (Required) Specifies a valid Json-Ld context. Must contain "https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"

  • type String. Root level. (Required) A string specifying the PresentationQueryMessage type. Must contain "PresentationQueryMessage"

  • scope Array of Strings. Root level. A non-empty array of scopes.

  • presentationDefinition Object. Root level. An object containing the definition of the requested presentation. Further details on https://identity.foundation/presentation-exchange/spec/v2.1.1/#presentation-definition.

A PresentationQueryMessage MUST contain either a presentationDefinition or a scope parameter. If both parameters are present it is an error and the client MUST return an HTTP 400 BAD REQUEST response.

Example request

Example using scopes

POST /presentations/query
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json

{
  "@context": [
    "https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
  ],
  "type": "PresentationQueryMessage",
  "scope": [
    "presentation1",
    "presentation2"
  ]
}

Example using presentation definition

POST /presentations/query
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json

{
  "@context": [
    "https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
  ],
  "type": "PresentationQueryMessage",
  "presentationDefinition": {
    "id": "ishareFrameworkCompliance",
    "name": "iSHARE Framework Compliance",
    "purpose": "Request proof of compliance with the iSHARE Framework",
    "input_descriptors": [
      {
        "id": "ishareFrameworkComplianceFrameworkIdAndStatus",
        "format": {
          "ldp_vc": {
            "proof_type": [
              "Ed25519Signature2018"
            ]
          }
        },
        "constraints": {
          "fields": [
            {
              "path": [
                "$.type"
              ],
              "filter": {
                "type": "string",
                "pattern": "FrameworkCompliance"
              }
            },
            {
              "path": [
                "$.frameworkId"
              ],
              "filter": {
                "type": "string",
                "pattern": "iSHARE"
              }
            },
            {
              "path": [
                "$.status"
              ],
              "filter": {
                "type": "string",
                "pattern": "active"
              }
            }
          ]
        }
      }
    ]
  }
}

Response model

On succesfull receipt of the PresentationRequestMessage, the holder must return a 200 code and a PresentationResponseMessage. A PresentationResponseMessage should only include valid (non-expired, non-revoked, non-suspended) credentials. The model for the PresentationQueryMessage is defined in: https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/resources/presentation/presentation-response-message-schema.json.

  • @context Array of Strings. Root level. (Required) Specifies a valid Json-Ld context. Must contain "https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"

  • type String. Root level. (Required) A string specifying the PresentationResponseMessage type. Must contain "PresentationResponseMessage"

  • presentation Array of Strings. Root level. An array of Verifiable Presentations. The Verifiable Presentations may be strings, JSON objects, or a combination of both depending on the format.

  • presentationSubmission Object. Root level. A valid Presentation Submission. Further details on https://identity.foundation/presentation-exchange/spec/v2.1.1/.

Implementations that support the presentationDefinition parameter MUST include the presentationSubmission parameter.

Example response

Example including presentations

{
  "@context": [
    "https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
  ],
  "type": "PresentationResponseMessage",
  "presentation": [
    "presentation1",
    "presentation2"
  ]
}

Example including presentation and presentationSubmission

{
  "@context": [
    "https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
  ],
  "type": "PresentationResponseMessage",
  "presentation": [
    "jwtPresentation"
  ],
  "presentationSubmission": {
    "id": "ishareFrameworkCompliancePresentation",
    "definition_id": "ishareFrameworkCompliance",
    "descriptor_map": [
      {
        "id": "ishareFrameworkComplianceFrameworkIdAndStatus",
        "format": "jwt_vp",
        "path": "$.presentation[0]"
      }
    ]
  }
}

Last updated