Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There are three alternate flows. We will be focusing on the "holder begins with a requestproposal" flow here because it's the most interesting use case. The other two flows are essentially just subsets of this flow. Below is a technical flow diagram for the "holder begins with a request" flow, made with the following assumptions:

  1. We're taking the "happy path" - no errors.
  2. An ack for the receipt of the credential was not requested.

Image Removed

High Level Design 

  1. CreateOffer : creates offer creates the ICoffer 
    1. Input: Credential Defination ID (from ledger), Connection ID (from didComm Protocol), comment/label
    2. Output: Issue Creditial Offer with credential View embedded inside
  2. HandleOffer: Sends the IC offers from one agent to another who have established a didComm connection 
    1. Output: Creates the Credential Exchange Record
    2. Update state to offer_sent
  3. CreateCredentialRequest : creates the CR in response to  credential_exchange_id
    1. Input: credential_exchange_id
  4. HandleCredentialRequest : 
    1. Creates the credential. 
    2. Update state to received 
  5. HandleIssueCredential : 
    1. Stores the credential
    2. Update the state credential_issued

      5. CreateCredentialRequestWithoutOffer : creates the CR without any prelimary offer. How ? TBD 

Note: This interface is based on the python implementation.

...

Before implementing the full flow, we could instead start with a simpler version first, and then expand upon it later. Here's what a simplified version might look like. It eliminates the propose-offer cycle and instead merges the proposal message into the request message, effectively turning the exchange into a two-step process:

Image Added

High Level Design - Methods, Inputs/Actions - Simplified Flow

SendCredentialRequest

Sends a request-credential message to another agent.

Input:

  1. Connection ID: Used to identify the agent to send this proposal to.
  2. Desired credential data (optional)
  3. Requested formats for credential.
  4. Comment (optional)
  5. Schema ID - a filter to request credentials based on a particular schema (optional).
  6. Credential definition ID - a filter to request a credential based on a particular credential definition (optional).

Actions:

  1. Send request-credential message to other agent, along with a unique Credential_exchange_id.
  2. Create a credential_exchange_record with the unique Credential_exchange_id.
  3. Update state to credential-requested for given credential_exchange_record.

HandleCredentialRequest

Receives a request-credential message from another agent.

Input:

  1. A credential_exchange_id.
  2. A request-credential message.

Actions:

  1. Validate incoming message.
  2. Update state to credential_requested for given credential_exchange_record.
  3. Notify business logic via client.

SendIssueCredential

Sends an issue-credential message to another agent.

Input:

  1. A credential_exchange_id.
  2. The issued credentials.
  3. Comment (optional)

Actions:

  1. Send issue-credential message to other agent.
  2. Update state to credential-issued for given credential_exchange_record.

HandleIssueCredential

Receives an issue-credential message from another agent.

Input:

  1. A credential_exchange_id.
  2. An issue-credential message.

Actions:

  1. Validate incoming message.
  2. Store the credential.
  3. Update state to credential_received for given credential_exchange_record.
  4. Notify business logic via client.




Below shows the full flow.

Image Added


High Level Design - Methods, Inputs/Actions - Full Flow

SendProposal

Sends a propose-credential message to another agent.

Input:

  1. Connection ID: Used to identify the agent to send this proposal to.
  2. Desired credential data (optional)
  3. Comment (optional)
  4. Schema ID - a filter to request credentials based on a particular schema (optional)
  5. Credential definition ID - a filter to request a credential based on a particular credential definition (optional)

Actions:

  1. Send proposal message to other agent, along with a unique Credential_exchange_id.
  2. Create a credential_exchange_record with the unique Credential_exchange_id.
  3. Update state to proposal_sent for given credential_exchange_record.

HandleProposal

Receives a propose-credential message from another agent.

Input: A propose-credential message and a credential_exchange_id.

Actions:

  1. Validate incoming message.
  2. Create a credential_exchange_record with the provided unique credential_exchange_id.
  3. Update state to proposal_received for given credential_exchange_record.
  4. Notify business logic.

SendOffer

Sends offer-credential message to another agent.

Input:

  1. A credential_exchange_id.
  2. Connection ID: Used to identify the agent to send this offer to.
  3. Credential preview: Represents the credential data that the issuer wants to issue.
  4. "Offers" attachment: An array of attachments that further define the credential being offered. Could be used to clarify the format of the credentials.
  5. Comment (optional)

Actions:

  1. Validate incoming message.
  2. Send offer-credential message to other agent.
  3. Update state to offer_sent for given credential_exchange_record.

HandleOffer

Receives an offer-credential message from another agent.

Input: An offer-credential message and a credential_exchange_id.

Actions:

  1. Update state to offer_sent for given credential_exchange_record.
  2. Notify business logic via client.

SendCredentialRequest

Sends a request-credential message to another agent.

Input:

  1. A credential_exchange_id.
  2. Requested formats for credential.

Actions:

  1. Send request-credential message to other agent.
  2. Update state to credential-requested for given credential_exchange_record.

HandleCredentialRequest

Receives a request-credential message from another agent.

Input:

  1. A credential_exchange_id.
  2. A request-credential message.

Actions:

  1. Validate incoming message.
  2. Update state to credential_requested for given credential_exchange_record.
  3. Notify business logic via client.

SendIssueCredential

Sends an issue-credential message to another agent.

Input:

  1. A credential_exchange_id.
  2. The issued credentials.
  3. Comment (optional)

Actions:

  1. Send issue-credential message to other agent.
  2. Update state to credential-issued for given credential_exchange_record.

HandleIssueCredential

Receives an issue-credential message from another agent.

Input:

  1. A credential_exchange_id.
  2. An issue-credential message.

Actions:

  1. Validate incoming message.
  2. Store the credential.
  3. Update state to credential_received for given credential_exchange_record.
  4. Notify business logic via client.

Additional details

Layer responsibilities

...

The request-credential message has a "requests~attach" field. Similar to the "offers~attach" field from offer-credential, it is supposed to define the requested formats for the credential. In the absence of Indy, what does this look like?

One of the supported flows is to send a request-credential message without going through the propose-offer cycle. How does this work?


Design Questions TBD : 

  1. How to register schema on the ledger? 
  2. Go through VC and refactor if required ?
  3. At what point we need to store the schema to the ledger and retrieve from ledger ? 
  4. If schema ID is related to verifiable credential ?