Loan Screening DVR
Following the zkPass SDK guideline, BCA Finance which takes the client role of the Proof Verifier, defines the “Loan Screening” DVR for users who are applying for the car loan. The requirements for the car loan are encapsulated in a query, which is detailed in the Data Verification Request (DVR). This query is formulated using the zkPass Query language, which is JSON-based.
Query
The DVR Query for Ramana Maharshi looks like the following.
All these conditions must be met for the overall criteria to be satisfied:
- The Document ID ( - bcaDocID) should exactly match "DOC897923CP", which is the document id for BCA Customer Profile.
- The first name under - personalInfoshould match "Ramana" (case insensitive).
- The last name under - personalInfoshould match "Maharshi" (case insensitive).
- The driver's license number under - personalInfoshould match "DL77108108" (case insensitive).
- The credit rating from Pefindo, found under - financialInfo, should be equal to or greater than 650.
- The balance in the savings account, under - financialInfo, should be equal to or greater than 55,000,000.
[
  {
    "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": {
      "title": "Loan Query Results"
    }
  },
  {
    "output": {
      "result": {
        "lvar": "loan_application"
      }
    }
  },
  {
    "if": {
      "condition": {
        "lvar": "loan_application"
      },
      "then": [
        {
          "output": {
            "name": {
              "dvar": "personalInfo.firstName"
            }
          }
        }
      ],
      "else": [
        {
          "output": {
            "rejected": "Your loan application has been rejected."
          }
        }
      ]
    }
  }
]Last updated
