Skip to main content

Introduction

This tutorial guides you through the process of issuing and verifying credentials using Galxe Identity Protocol on Ethereum. You will learn how to create and sign a credential, generate a zero-knowledge proof, and perform both on-chain and off-chain verifications.

Prerequisites

  • Basic understanding of Ethereum and smart contracts.
  • Node.js installed on your machine.
  • An IDE or text editor for writing JavaScript code.

Step 1: Setup and initialize Nodejs repo

In your Node.js repo, run:

Step 2: Import necessary dependencies and setup issuer

Do not use the dummy issuer in production.
Note that the dummy issuer has been registered on Ethereum mainnet. Check out the registration transaction here. This issuer is registered with the following parameters:
  • verificationStackId = 1 means that this issuer is registered for babyzk stack

Step 3: Issue a new credential

Note that this context has been registered on Ethereum mainnet. Check out the registration transaction here.

Step 4: Proof generation

Step 5: Proof verification

Proof verification can be made both on-chain and off-chain. Here we demonstrates both options:

On-chain verification

Off-chain verification

Step 6: Put it all together

Example output

Conclusion

Congratulations! You’ve successfully issued a credential, generated a zero-knowledge proof, and verified it both on-chain and off-chain. This tutorial demonstrates the powerful capabilities of the Galxe Identity Protocol in maintaining privacy and security through zero-knowledge proofs.