DVR

Data Verification Request

Data Verification Request (DVR) is like a question that the Proof Verifier asks the Data Holder or the user. This "question" is usually about some specific information a user has stored on the user data. For example, the Proof Verifier might ask, "Is this user over 21 years old?" or "Is this user married?"

The concept of DVR is pivotal in grasping the zkPass workflow. Essentially, the flow of zkPass kicks off with the Proof Verifier creating a DVR.

Structure of a DVR

Each DVR has two main parts:

  1. Metadata (The Envelope of the DVR) Think of the metadata as the envelope that holds the DVR. Some of the core metadata are:

    • DVR ID This is like a tracking number for the request. It helps to know which question you're dealing with. This information is mainly used by the zkPass Service.

    • User Data URL The URL to retrieve the user data referenced by the DVR Query variables. The Proof Verifier uses this information to tell the Data Holder where to download the user data content. A Data Issuer typically hosts the URL site. Note that this information is optional. The absence of this information means that the way to determine where to get the user data is embedded in the application business logic of the Data Holder.

    • Public Key This public key verifies that the user's data hasn't been tampered with.

  2. Query (The Actual Question) The real heart of the DVR is the query. This is the actual question or condition you want to check against the user's data. In zkPass, you write this query using a unique format called zkPass JSON Query Language. The query uses the concept of variables to reference elements that exist in the user data and compare the variable values with specific constant literals.

Example Query
[
  {
    assign: {
      loan_application: {
        and: [
          { "==": [{ dvar: "bcaDocID" }, "DOC897923CP"] },
          { "~==": [{ dvar: "personalInfo.firstName" }, "Ramana"] },
          { "~==": [{ dvar: "personalInfo.lastName" }, "Maharshi"] },
          {
            "~==": [{ dvar: "personalInfo.driverLicenseNumber" }, "DL77108108"],
          },
          {
            ">=": [{ dvar: "financialInfo.creditRatings.pefindo" }, 650],
          },
          {
            ">=": [
              { dvar: "financialInfo.accounts.savings.balance" },
              55000000,
            ],
          },
        ],
      },
    },
  },
  { output: { result: { lvar: "loan_application" } } },
]

In this example query, variable "personalInfo.firstName" references the JSON element "firstName" whose parent element is "personalInfo". This element exists in the user data.

For a more in-depth explanation of the DVR, please refer to the Developer's Guide.

Last updated