Background

The Presentation Exchange (PEX) Library implements the functionality described in the DIF Presentation Exchange specification for both version 1 and 2.

Sphereon’s PEX Library is useful for both verifier systems and holders (e.g. wallets) and can be used in client side browsers and mobile applications as well as on server side technology such as REST APIs (e.g. built with NodeJS). It allows anyone to add DIF Presentation Exchange logic to their existing wallets, agents and/or verifiers, without making any further assumptions about technologies like cryptography, credential representations used in their products.

A Presentation Exchange generally goes as follows; The verifier creates a Presentation Definition asking for credentials from the holder. The Presentation Definition for the credentials is sent to the holder, who returns a Verifiable Presentation containing Presentation Submission data that links the Credentials in the Presentation to the received Definition as a response. The Presentation Submission describes the relationship between the Verifiable Presentation and the Presentation Definition. It can either be part of the Verifiable Presentation or be external, like in OpenID4VC specifications. Now the verifier will verify the Verifiable Presentation by checking the signature and other accompanying proofs as well as ensuring the Submission Data fulfills the requirements from the specification.

Presentation Exchange will ensure that the model used by the verifier, can be interpreted by the holder. It then ensures that the correct parts from the holders credentials are used to create the presentation. The PEX-library contains all the logic to interpret the models, therefore removing the need for the verifier and holder to align their specific models.

The Typescript data objects (models) used in PEX are generated from Sphereon’s DIF PEX OpenAPI Spec component. The code for the component can be found at PEX-OpenAPI github repository. This allows the generation of the objects in many programming languages and frameworks consistently by configuring the maven plugin.

WARNING: Please be aware that this library does not support the latest V2 specification!. Support will be added as part of a V3 major version of this library

Workflow Diagram

The below diagram shows how a typical interaction between a verifier and a wallet looks like. It makes no assumptions about the actual transport (DIDComm, SIOPv2/OIDC4VP, CHAPI, REST)

Setting up

The first step to world-class documentation is setting up your editing environments.