JS-SDK

Overview

Welcome to the zkPass Software Development Kit (SDK) documentation. This SDK is designed to help third-party Decentralized Applications (DApps) integrate seamlessly with the zkPass TransGate browser extension or app. With the SDK, developers can easily connect their DApps to zkPass, enabling users to privately and selectively validate data on any HTTPS website within the web3 ecosystem.

The SDK provides support for standard functionalities, including trust verifications for legal identity, financial records, healthcare information, social interactions, work experience, education, and skill certifications. Furthermore, it continually expands its capabilities, with additional features anticipated in future updates.

The following instructions are applicable to web DApps based on JavaScript.

Why zkPass JS-SDK?

The zkPass JS-SDK provides a convenient and efficient way for developers to integrate zkPass into their applications.

  • Privacy-Preserving Verification: the SDK facilitates the integration of zkPass into web applications, allowing users to selectively and privately validate their data.

  • Verifiability through 3P-TLS: the SDK helps developers seamlessly implement this 3P-TLS for secure data verification.

  • Compatibility with HTTPS Websites: the SDK is designed to be compatible with any HTTPS website, making integration straightforward for developers and no additional APIs or licenses are required, simplifying the adoption process.

  • Anti-Cheating Mechanisms: the SDK assists in implementing these anti-cheating mechanisms, ensuring the authenticity, integrity, and validity of the data.

  • Memory-Efficient Zero-Knowledge Proofs: the SDK leverages VOLE-based IZK to achieve millisecond-level ZKP generation locally in the browser environment that contributes to the memory efficiency of the verification process.

  • Versatile Application Scenarios: the SDK can be applied in various scenarios, including decentralized identity passes, DeFi lending protocols, healthcare data marketplaces, and other use cases where trust and privacy are crucial.

Core Concepts

Schema

A Schema is a JSON-formatted file that defines the mapping of specific HTTP responses for the zkPass verification system. Additional details can be found in the schema section.

TransGate

TransGate, consisting of a Chrome extension, Android app/Instant app, and iOS app/Clip, enables the secure and seamless transfer of private data between web2 and web3 environments. It operates on the client side, using the zkPass protocol to ensure a smooth and secure user experience when transferring data to various destinations.

Allocator Node

The allocator node generates verification task metadata, randomly selecting a validator for subsequent verification with the user. Once the task is generated, it uses its private key to sign the metadata and returns the metadata along with the signature.

Validator Node

The validator node plays a crucial role in the verification process. It participates in 3P-TLS and receives the zk-proof generated by the TransGate, verifies its authenticity, and then returns the final verification result along with its signature. Essentially, the validator node acts as an independent authority, ensuring the integrity and validity of the verification process before providing the outcome to the DApp.

Role of JS-SDK

The SDK serves as a bridge connecting the DApp and TransGate. It dispatches events to the event listener of TransGate, which then processes the event in its handler and returns the result to the SDK. Once the DApp receives the verification result from the SDK, it has the option to transform the result into an on-chain Identity, such as zkSBT, or store it off-chain for future use.

Last updated