swanchain / devgrants

17 stars 10 forks source link

Swan DevGrant<PrivyML> #12

Open HappyTomatoo opened 6 months ago

HappyTomatoo commented 6 months ago

Open Grant Proposal: PrivyML as a ZKML solution on the Swan network, aims to facilitate the implementation and execution of the ZKML concept on the Swan network.

Project Name:PrivyML

Proposal Category:Integrations Individual or Entity Name: cala labs

Proposer: HappyTomatoo

Do you agree to open source all work you do on behalf of this RFP under the MIT/Apache-2 dual-license?: yes

Project Summary

PrivyML as a ZKML solution on the Swan network, aims to facilitate the implementation and execution of the ZKML concept on the Swan network. It integrates Crux to bridge the gap between machine learning developers and the Swan network, zero-knowledge proof systems, and zkDSL. The PrivyML arketplace Protocol helps zkDSL ZKML contract developers get their due from the demand side. It also enables hardware providers to receive rewards from zkDSL Dapp projects for computing proofs.

Impact

In a world where AI-generated content is becoming increasingly similar to human-created content, the potential application of zero-knowledge cryptography can help us determine if a specific piece of content was generated by applying a specific model to a given input. If zero-knowledge circuit representations are created for large language models like GPT-4, text-to-image models like DALL-E 2, or any other model, it provides a way to verify the outputs of these models. The zero-knowledge properties of these proofs also allow us to hide parts of the input or the model if needed. A good example is when applying machine learning models on sensitive data, users can know the inference results of the model on their data without revealing their input to any third party (e.g., in the healthcare industry). Note: When we talk about ZKML, we refer to creating zero-knowledge proofs for the inference steps of ML models, not the training of ML models (which is already computationally intensive in itself). The current state of zero-knowledge systems, coupled with high-performance hardware, still has several orders of magnitude gap in proving large-scale models like Large Language Models (LLMs) that are currently available. However, progress has been made in creating proofs for smaller models. While ZKML is rapidly improving and optimizing, it still faces some core challenges. These challenges include both technical and practical aspects, such as:

  1. Quantization with minimal precision loss.
  2. Huge Circuit size, especially when the network consists of many layers.
  3. Efficient proofs for matrix multiplications.
  4. Adversarial attacks.
  5. Lack of realization of completed user stories
  6. User Friendly Experience
  7. Lack of developers with both zero-knowledge proofs and machine learning technology stacks PrivyML is committed to solving the above problems.

Outcomes

Crux zkDSL Library

The ONNX runtime built in zkDSL by Crux establishes a transparent, verifiable, and fully open-source inference framework, providing runtime capabilities for verifiable ML model inference using Swan. Crux leverages Ethereum to ensure the reliability of inference and offers developers a user-friendly framework for building complex verifiable machine learning models. Crux provides three APIs: Operators, Numeric Types, and High-Performance Circuit Optimization Implementation.

  1. Operators: It offers a comprehensive set of standard mathematical functions and operations specifically designed for computing neural network models, compatible with the ONNX standard. It introduces tensor types, including basic linear algebra operations like matrix multiplication (matmul), as well as neural network functions like softmax and linear layers. With this API, developers can efficiently perform neural network computations using various functions.
  2. Numeric Types: It extends ZkDSL's built-in numeric capabilities by introducing signed integers and fixed-point implementations. By integrating these functionalities, developers can handle a broader range of numeric data types, enabling more precise calculations in their applications.
  3. High-Performance Circuit Optimization Implementation: This includes a set of functions aimed at improving model performance. Memory efficiency and computational speed are well-known for their significance in machine learning applications. Therefore, our initial version supports 8-bit quantization. This feature reduces memory footprint, accelerates model computation, and allows you to build more efficient and faster ML applications without sacrificing accuracy.

    Proof Marketplace

  4. User registration, login and personal information management.
  5. Task release and management.
  6. Task acceptance and completion.
  7. Payment and settlement.

Adoption, Reach, and Growth Strategies

Development Roadmap

Milestone 1: Carecompass

Completion Date: 6 weeks

Milestone 2: PythonSDK and Crux implementation

Completion Date: 8 weeks

Milestone 3: Proof marketplace

Completion Date: 12 weeks

Milestone 4: Delegate Proof Computing Network (Option)

Completion Date: 16 weeks

Total Budget Requested

Overall Timeline

42weeks

Funding Requested

$285,000 USD

Milestones

MILESTONE DESCRIPTION DUE DATES FUNDING
1 1. Carecompass
(1) zkML contracts for different disease
(2) Carecompass user interface
(3) Carecompass backend with indexing states from Swan chain
6 weeks $50,000 USD
2 1. PythonSDK
(1) PythonConvert
2. Implement ONNX Runtime in Crux
(1) Basic Numeric Types
(2) Basic Operators
(3) 8-bit quantization to reduce memory and computation time
3. ZKML algorithms Library
(1) Decision Tree
(2) K-means
(3) XG-boost
(4) CNN
8 weeks $115,000 USD
3 1. Proof marketplace
(1) Marketplace contracts
(2) Proof marketplace user interface
12 weeks $120,000 USD
4(Options) Delegate Proof Computing Network
(1) MPC protocol for proving
(2) Proof computing Service
(3) Accelerating Device Access Service
(4) P2P network
16 weeks $140,000 USD

Maintenance and Upgrade Plans

Our maintenance and upgrade plans are designed to ensure the ongoing reliability, performance, and improvement of the PrivyML system.

Team

Team Members

CC Chao: PM/ Algorithm Engineer

Will Pan: Software Engineer

Cosmos Zhou: Software Engineer

Yuki Xu: Test Engineer

Kennes Liu: Marketing Manager

Team Member Github Profiles

CC Chao: https://github.com/HappyTomatoo

Will Pan: https://github.com/willpan1102

Cosmos Qin: https://github.com/yuqinzhou123

Yuki Xu: https://github.com/xiuqin-xu

Kennes Liu: https://github.com/liuzeming1

JL289 commented 3 months ago

Hello there @HappyTomatoo,

We'd like to know more about the project, could you please provide more information pertaining to:

Sorry for the wait, let us know if you have any questions!

Cheers,

JL289 commented 2 months ago

@HappyTomatoo, could you please provide the required information?

Thanks,