Coder Social home page Coder Social logo

loris-epfl / poc-zklogin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from teohaik/poc-zklogin

0.0 0.0 0.0 498 KB

App for demonstrating the zkLogin capabilities

Home Page: https://poc-zklogin.vercel.app

Shell 5.88% JavaScript 0.83% TypeScript 92.71% CSS 0.57%

poc-zklogin's Introduction

ZK Login Flow Tester

This is a simple React App that demonstrates the Sui ZK Login flow.

Runs on Sui Testnet

Logic is included in two main React files:

  • src/app/page.tsx which contains the initial page with the login button.
  • src/app/auth/page.tsx which contains the page that users get redirected after successful login. It also handles:
    • The decoding of the jwt token
    • The verification of the token
    • The generation of the ZK Proof
    • Execution of a simple Transaction to verify the validity of the proof.

Invocation of Mysten Labs APIs happens in the backend part:

  • src/api/userinfo/get/salt/route.tsx - Retrieves salt from DB if stored previously or invokes Mysten Labs api to get a new one
  • src/api/userinfo/store/route.tsx - Saves user data, critical for transaction signing (Salt), to DB. Key = subject Id
  • src/api/zkp/get/route.tsx - Invokes Mysten Labs api to get the ZK Proof

Development

Just navigate to the /src/app folder and run

  • npm install
  • npm run dev

This will fire up a local development server at your machine.

Dependencies

  • An active SUI account loaded with SUI should exist on testnet to be used as faucet. To use it, set the NEXT_PUBLIC_ADMIN_SECRET_KEY= environment variable in your .env file. You can use .env.development.local.example as a template.
  • Vercel KV storage is used as a database. To use it, create your own KV instance and set details in .env. You can use .env.development.local.example as a template.

poc-zklogin's People

Contributors

teohaik avatar vlegakis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.