VC-API is specification of a data model and HTTP protocols to issue, verify, present, and manage data in a Verifiable Credentials ecosystem.
Energy Web provides an implementation of VC-API to reduce difficulties for organizations to start issuing and verifying Verifiable Credentials. Using these APIs it becomes easy for anyone to do Proof of Concepts for SSI use cases.
VC-API can be easily integrated with existing systems and are configurable for complex exchanges. Implementers can choose to implement APIs that fits their use case. One can keep it simple with minimal set of APIs even for complex data exchanges (presentation).
Refer VC-API specification for more information.
Portable, can be easily deployed to any environment and can be kept generic.
Easy integration and configuration.
Selective implementation of APIs based on the use case. For an application that provides feature to issue a credential only need to consume APIs specific to issuance.
Supports both Mediated and Unmediated exchange.
The Verifiable Credentials data model introduces three actors Issuers, Holders and Verifier. VC-API defines components that these actors may use for credential issuance, verification and exchange.
Each actors can have their own set of components to participate in the credential exchange.
Coordinators : execute the business rules and policies set by the actors. Also acts as mediator between these actors.
Services : enable general VC-API functionality.
Status Service : facilitate publishing and checking of status of Verifiable Credentials.
Admin : responsible for configuring and managing all the other components.
Storage Services : provide mechanisms to store and manage Verifiable Credential of the associated actor.
Energy Web's implementation of VC-API only provides services which enable VC-API functionality. A developer can implement their own components that are mentioned above.
Applications can perform authorisation, issuance, verification and presentation exchanges using VC-API.
Servers implementing VC-API can confirm clients to utilise authorisation mechanism when performing certain requests. The request APIs endpoint can specify whether authorisation is needed or not.
For issuance of Verifiable Credentials, a holder can request any authority (Issuer) to issue a credential or can self-sign a credential.
A Holder can present their Verifiable Credential to the Verifier for verification. The Verifier can request the required credential from the holder using presentation-exchange protocol.
The sharing / exchange of Verifiable Credentials happen through presentation. These exchanges are executed based on the exchange-definition that are configured at run time.
A general exchange flow would look like :
The VC-API implementation can be easily deployed to any environment and can be kept generic, in other words exchanges are configured rather than coded in the application. This configuration is done at runtime via the use of Exchange Definitions.
In order to configure the credential exchange, you can use the exchange definition data transfer object. For reference see the Exchange Definition Data Transfer Object implemented by Energy Web.
Some different types of exchange definitions are :
Sample DIDAuth
query VP Request
Sample PresentationDefinition
query VP request
Exchange Definition Structure and Properties
exchangeId
exchangeId
is definition identifier, used to fetch exchange-definition
Exchange Queries
The Exchange Definition has a query
property that tells which data needs to be requested. The type of queries that are supported are defined by VerifiablePresentationQueryType, for reference see VpRequestQueryType.
The DIDAuth
query type is used for exchange needed for authorisation, while PresentationDefinition
could be used to request certain data from the Holder.
Exchange Callbacks
When defining an exchange, callbacks can be configured to allow parties to receive notice of a VP submitted in response to an exchange. Notifications consist of POST requests to the configured URLs. A callback is configured by adding an entry to the callback array in the Exchange Definition.
Exchange Interact Services
The exchange interaction types used by this VC-API implementation are directly related to Verifiable Presentation Request Interaction Types. The interaction types indicate to the receiver of the presentation request how they can expect to interact further with the issuer/verifier.
Mediated Exchange Interactions
Mediated exchange interactions signal to the receiver of the presentation request that the exchange is mediated by an additional component and may not be automatically processed. Mediated exchanges therefore allow for a review of presentation submission by a human or automated process as well as the issuance of credentials based on this review.
Due to the duration of the mediation process being unknown, the submitter of the verifiable presentation may have to query repeatedly in order to check if the result of the mediation is available.
Unmediated Exchange Interactions
Mediated exchange interactions signal to the receiver of the presentation request that the exchange is not mediated by an additional component and can be automatically processed.
serviceEndpoint
serviceEndpoint
is used to continue exchanges
Presentation Definitions.
These presentation exchange take place on the basis of presentation-definition. Verifiers articulate these definitions of what they require for proofs. The issuer then wraps their Verifiable Credentials on the basis of presentation-definition in a VP and provide a response to the Verifier.
The presentation_definition
are constructed of inputs, that describe the format and details for proofs required. They may also contain selection or filter rules for the presented Verifiable Credentials.
A presentation_definition
has input_descriptors
property which has an array of objects with properties describing what type of input data (credential) or sub-fields are required for submission.
See input_descriptors to know more.
Presentation exchange between Holder and Issuer
Presentation exchange between Holder and Verifier
Example for a VC issuance and presentation using VC-API can be seen in Resident Card Tutorial.