Skip to content

Latest commit

 

History

History
140 lines (115 loc) · 5.36 KB

README.md

File metadata and controls

140 lines (115 loc) · 5.36 KB

Tobi

An AI-Enhanced KYC Platform (PoC)

License BuildPass Frontend deploy

Demo Page

Abstract

The surge in popularity of major language models underscores the significance of nuanced language adjustments. Thus, we've established a public marketplace for fine-tuning models, enabling verification and payment on-chain. Simultaneously, we employ zero-knowledge proofs to safeguard user data while achieving this. Deploying large models on-chain is challenging, so we employ IPFS for model weight storage and WASM for proof generation. The validation of proof on-chain is executed via Zero Knowledge methods. We've incorporated Wormhole for seamless cross-chain data transfer and opted for Tezos to house vote results.

Problem Statement

  • Large Model Deployment: Successfully mitigated the difficulty of deploying large models on-chain.
  • Model Verification: Developed a solution to ensure accurate model verification.
  • Cross-Chain Data Transfer: Resolved the issue of transferring data seamlessly between different chains.
  • Vote Result Storage: Implemented a method to securely store and manage vote results.

Solution

  • Use IPFS to store model weight
  • Use WASM to generate proof
  • Use Zero Knowledge to verify the proof on chain
  • Use Wormhole to transfer data between chains
  • Use Tezos to store vote result

Technical Architechure

sequenceDiagram
    actor User
    participant Web
    participant I as Arweave and Filecoin
    participant Z as Zero Knowledge Model
    participant S as Sepolia
    participant T as Tezos
    participant W as Wormhole
    %% Webcam
    User ->> Web: Open WebCam to Capture Face
    
    Web ->> I: Choose Model Standard from IPFS
    activate I
    I -->> Web: Return Model Weight To Web 
    deactivate I

    %% generate proof
    User ->> Web: Send Photo to model
    Web ->> Z: Accept Send Photo and Model Weight to WASM
    activate Z
    Z -->> Web: WASM generate proof
    deactivate Z

    %% Use Proof to Verify
    Web ->> S: Use Proof to KYC on chain
    S ->> S: Verify ZK Proof on chain
    S ->> W: Send Access to Target Chain
    W ->> T: Invoke Access to Destination Chain 
    S -->> Web: Get Vote Access to User
    %% Vote
    User ->> Web: Choose Proposal to Vote
    Web ->> S: Vote yes or no
    S ->> W: Add Vote to Dst Chain
    S -->> Web: return vote result to user
Loading

Build & Installation

Tobi is a monorepo managed using turbo. You can find the source code for each package in the apps and packages directory.

  • apps/web is the web frontend for Tobi. It is built using Next.js.
  • packages/zk-circuits is the zero knowledge circuits and evm contracts for Tobi.
  • packages/tezos-contract is the tezos contract for Tobi.
  • packages/tezos-interact is the tezos interact SDK Tobi.
  • packages/helper contain lighthouse ipfs helper.
  1. Install all peer dependencies
pnpm install
  1. Deploy the zk circuits verify contract
cd packages/zk-circuits
cp .env.example .env
# fill in the .env file

after fill in private key and infura key, run the following command

pnpm run deploy:zk
  1. Deploy the wormhole crosschain voting contract
# same directory as step 2
# cd packages/zk-circuits
pnpm run deploy:wormsrc
pnpm run deploy:wormdst
  1. Deploy the tezos contract (use ligo online ide to deploy is better in this step)

ligolang ide

  1. Start the Frontend
# cd ../../apps/web
cd apps/web
cp .env.example .env
# fill in the .env file
pnpm run dev
  1. (Optional) Deploy and Copy Static Files to gh-pages or S3
pnpm build
  1. Arweave Upload Model Service
# copy private key to packages
touch packages/arweave-service/wallet.json
docker-compose -f packages/arweave-service/docker-compose.yaml up -d --build ar_backend 

Contributors