zkPass
Website↗Github↗Twitter↗Discord↗
  • 🤝Get Started
  • User Guidelines
  • Overview
    • Introduction
    • Technical Overview V2.0
    • Use Cases
      • zkKYC
      • On-chain Achievements
      • Finance(DeFi&CeFi)
      • Governance and Voting
      • Gaming
      • Medical and Healthcare
      • Social Networking
      • Education and Research
      • Experience Checks
      • Eligible Access
      • Insurance Claim
  • developer guides
    • JS-SDK
      • How It Works
      • Quick Start
      • Generate proof and verify the result
        • EVM
        • Solana
        • Ton
      • Schema
        • Custom Schema
        • Quick Start for Creating Custom Schema
      • API References
      • Error Handling
      • References
    • Integration on Intract Quest
  • supports
    • FAQ
    • Roadmap
    • Terms & Conditions
    • Privacy Policy
Powered by GitBook

Feel free to contact us if you have any ideas

On this page
  1. developer guides
  2. JS-SDK

Schema

A schema comprises two primary components:

  • API requests required based on verification conditions

  • Grammar paths from the API responses for extracting the fields needed for verification

  • Assertion for the verification

Here is a example regarding the TikTok:

The request looks like:

curl 'https://www.tiktok.com/passport/web/account/info/' \
  ......
  -H 'cookie: _tt...faf' \
  ......
  --compressed

The response looks like:

{
  "data": {
    "user_id": 7*****************7,
    "user_id_str": "7*****************7",
    "odin_user_type": 12,
    ...
    "create_time": 1690168843,
    ...
    "app_id": 1459,
    "is_employee": false,
    "external_employee_platform": ""
  },
  "message": "success"
}

The verification involves checking whether the account creation date is prior to August 2023(timestamp is 1690848000000).

So the schema looks like:

{
  "category": "Social",
  "issuer": "Tiktok",
  "desc": "TikTok is a video-sharing app that allows users to create and share short-form videos on any topic.",
  "website": "https://www.tiktok.com",
  "APIs": [
    {
      "host": "www.tiktok.com",
      "intercept": {
        "url": "passport/web/account/info/",
        "method": "GET"
      },
      "assert": [
        {
          "key": "data|create_time",
          "value": "1690848000",
          "operation": "<"
        }
      ],
      "nullifier": "data|user_id_str"
    }
  ],
  "tips": {
    "message": "When you successfully log in, please click the 'Start' button to initiate the verification process."
  }
}

The nullifier is a required element in the schema, serving to indicate a unique identifier for the user in the data source. It is the witness and will be hashed with a random number generated by MPC in zk circuit to ensure the nullifier's value remains undisclosed to the validator. Developers can use the hash of nullifier to prevent Sybil attacks.

PreviousTonNextCustom Schema

Last updated 11 months ago

In , we have preset schemas for user to choose and config. Developers have the flexibility to design their own personalized schemas and seamlessly integrate them into their projects. Further details can be found in the section, providing comprehensive information on how to create and implement customized schemas for your specific needs.

zkPass dev center
Custom Schema