Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NeuroZK - Cyborg parachain's ZK verification layer #2393

Merged
merged 63 commits into from
Oct 29, 2024

Conversation

beekay2706
Copy link
Contributor

Project Abstract

This application is a follow up from our successful grant delivery

Cyborg Network is an AI-centric blockchain designed specifically to handle AI workloads, utilizing crowdsourced off-chain compute infrastructure verified with Zero-Knowledge (ZK) Proofs to enhance data privacy and security in AI models.

We are developing a platform for managing AI compute resources (both training and inference) with strategic partnerships across web2 and web3 domains. Continuing on our previous delivery, we are motivated to create a ZK verification layer to improvise the compute verification process with better privacy.

Grant level

  • Level 1: Up to $10,000, 2 approvals
  • Level 2: Up to $30,000, 3 approvals
  • Level 3: Unlimited, 5 approvals (for >$100k: Web3 Foundation Council approval)

Application Checklist

  • The application template has been copied and aptly renamed (project_name.md).
  • I have read the application guidelines.
  • Payment details have been provided (Polkadot AssetHub (DOT, USDC & USDT) address in the application and bank details via email, if applicable).
  • I understand that an agreed upon percentage of each milestone will be paid in vested DOT, to the Polkadot address listed in the application.
  • I am aware that, in order to receive a grant, I (and the entity I represent) have to successfully complete a KYC/KYB check.
  • The software delivered for this grant will be released under an open-source license specified in the application.
  • The initial PR contains only one commit (squash and force-push if needed).
  • The grant will only be announced once the first milestone has been accepted (see the announcement guidelines).
  • I prefer the discussion of this application to take place in a private Element/Matrix channel. My username is: @_______:matrix.org (change the homeserver if you use a different one)

Copy link
Contributor

@keeganquigley keeganquigley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @beekay2706 thanks for the follow up application. Quick question, is there a reason you are trying to modify the original application? Usually we don't modify applications after they have been merged. Can you add this info to the new one instead?

@keeganquigley keeganquigley added changes requested The team needs to clarify a few things first. and removed admin-review This application requires a review from an admin. labels Sep 20, 2024
@github-actions github-actions bot added the admin-review This application requires a review from an admin. label Sep 20, 2024
@beekay2706
Copy link
Contributor Author

Hi @keeganquigley ,

Thank you for your response, and I apologize for the oversight. A new line was unintentionally added when I merged some changes from w3f's main into our local branch.

This has been corrected in the latest commit.


As part of our previous application, we delivered CyberDock, a product line focused on helping users deploy dockerized containers into our edge server network. We are now focusing on expanding this approach to a new product line called NeuroZK, which will enable AI apps to run Inference Engines backed by ZK proofs.

Users can easily run GPU based inference engines in our crowdsoruced GPU network, with compute integrity verified using a ZK SNARK proof that proves that the inference algorithm was executed with 100% accuracy without revealing the actual inference algorithm nor the query or result data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • What is the process for generating ZK proofs to verify the correctness of AI inference computations?
  • How are ZK proofs verified on-chain, and what are the computational costs involved?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the delayed response, I have updated the document to include the actual verification logic.

Here is a detailed explainer that also covers your specific questions.

Proof Generation:

Once a task is assigned to a particular worker node and it starts executing the task, at fixed intervals of time (currently arbitrarily set to 60 minutes), the ZK worker component in the worker node will generate a SNARK proof using the PLONK algorithm. We will use an oracle to convey this proof to the verifier pallet, which will evaluate the received proof using the verification key and public data inputs that the user submitted before execution.

Verification:

the worker node submits a ZK proof to the blockchain. This proof is a compact set of cryptographic commitments that represent the correctness of a computation.
The verifier pallet uses public data (submitted earlier or as part of the transaction) as inputs for the verification.
The verifier pallet uses a verification key, generated during the trusted setup phase, to check the proof. This key is static and is uploaded during task deployment. The pallet performs a series of elliptic curve operations and field arithmetic (over finite fields) to check the polynomial commitments and evaluations provided in the proof. The commitments must match the expected public inputs and satisfy the polynomial equations set by the PLONK circuit.Permutation arguments and other constraints encoded into the circuit are also validated at this stage. The Pallet checks whether all evaluations and commitments hold for the circuit, using the verification key. If they match, the proof is accepted as valid; otherwise, it is rejected. Once the verification succeeds, the transaction is processed as valid (e.g., approving the computation result). If the verification fails, the transaction is reverted or flagged as invalid.

Computational costs related to ZKP on Cyborg:

Since proof generation occurs within Cyborg worker nodes—custom spec edge servers designed for executing LLMs and sold by our organization—the costs related to proof generation can be neglected, as the compute providers are compensated for executing inference tasks rather than for proof generation. Regarding verification costs, PLONK proof sizes are typically around 100 bytes; however, the actual gas fees will depend on the number of constraints involved in the elliptic curve operations. As this is still experimental, we cannot currently estimate the gas costs for verification theoretically. However, after successful implementation of the system, we can optimize verification gas by performing batch verification of proofs aggregated off-chain.


Through this process, we identified the need for having a much simpler provider onboarding experience, so we are developing a custom node implementation called Cyborg worker nodes using which providers can connect their resources to the Cyborg parachain just by downloading and installing an executable file on their VMs. This also aligns with our focus to launch a plug and play hardware series called 'Cyborg miners' that directly connects to the parachain like an ASIC miner.

Consequently, we will be delivering a ZK based offchain compute verification system, that validates the integrity of executing pre-trained AI models for decentralized AI inferencing on crowdsourced GPUs. For this grant we will use ZK and TEE to uphold data privacy in the system.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • What security guarantees does the ZK SNARK system provide against attacks such as proof forgery or false verification?
  • How resilient is the ZK SNARK system to changes in the AI model or inference environment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SNARK system that we propose provides the following security guarantees,

- Confidentiality: Verifying computations without revealing the underlying inference data preserves data privacy in the system.
- Forgery Prevention: The ZK worker cannot generate a valid proof for an incorrect computation, ensuring only truthful claims are accepted.
- Proof Validation: Game-theoretic concepts can be employed to penalize bad executors and incentivize correct behavior.
- Security Against Replay Attacks: This prevents workers from resubmitting valid proofs for previously completed computations.
- Integrity of the Computation: Ensures that the computation is performed correctly based on known and agreed-upon parameters.

Resilience of SNARK proofs:

ZK SNARK systems by design are not resilient to changes in the model and inference environment, as it requires a trusted setup during the initial setup phase and key generation. Currently, we will focus on proofs that maintain backward compatibility, ensuring that updates to the hyperparameters in the AI model have a negligible impact on the proofs and that older proofs remain valid. However, we will need to implement a pipeline to update the verification keys whenever the user wishes to make changes to the model, thereby ensuring the stability of the verification system in a CI/CD environment

applications/NeuroZK.md Outdated Show resolved Hide resolved
@keeganquigley keeganquigley removed the admin-review This application requires a review from an admin. label Sep 20, 2024
@keeganquigley keeganquigley self-assigned this Sep 23, 2024
Comment on lines +184 to +186
- **Total Estimated Duration:** 6 months
- **Full-Time Equivalent (FTE):** 2 ( 1 Full time Developer at 1 FTE/month and 2 part time developers each at 0.5 FTE/month)
- **Total Costs:** 30,000 USD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing the DOT % line, indicating the amount of vested DOT you are willing to receive. See https://github.com/w3f/Grants-Program/blob/master/applications/application-template.md?plain=1#L127

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @semuelle , I have updated the info as per the latest guidelines

@github-actions github-actions bot added the admin-review This application requires a review from an admin. label Sep 26, 2024
@keeganquigley keeganquigley added ready for review The project is ready to be reviewed by the committee members. and removed changes requested The team needs to clarify a few things first. admin-review This application requires a review from an admin. labels Sep 30, 2024
Copy link
Contributor

@keeganquigley keeganquigley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your detailed answers @beekay2706 looks interesting and based on your previous work I'm willing to give it a shot.

@beekay2706
Copy link
Contributor Author

Thanks for your detailed answers @beekay2706 looks interesting and based on your previous work I'm willing to give it a shot.

Thanks @keeganquigley , I really appreciate the trust and support

Copy link
Member

@semuelle semuelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the application, @beekay2706 and the updates. To be honest, I had some concerns about the feasibility and market fit for your first grant application. Now you are adding even more highly specialized and complex tech to the stack without proof for the need for such a solution and the potential market size. I would like to see a more concrete market analysis and plans for long-term funding before approving it.

@beekay2706
Copy link
Contributor Author

Thank you for the application, @beekay2706 and the updates. To be honest, I had some concerns about the feasibility and market fit for your first grant application. Now you are adding even more highly specialized and complex tech to the stack without proof for the need for such a solution and the potential market size. I would like to see a more concrete market analysis and plans for long-term funding before approving it.

Thanks for the question, @semuelle. I really appreciate your honest opinion.

To be transparent, we started this project as a research initiative to explore applying blockchain to real-world use cases, and edge computing seemed like a good way to begin. However, as we progressed, we realized that this is an emerging, future-oriented market. The current scale of mainstream apps doesn't yet demand the low latency or performance we aim to offer. We also recognized that it will take time to build this product effectively. Therefore, the launch of the enterprise-ready product will align with the expected demand phase, roughly two years from now. Cyborg, as a whole, will offer multiple products related to edge computing. I’ve attached our market scope slide for your reference.

The focus of this grant development (NeuroZK) is on building a blockchain-governed AI inference engine that can support inferencing pre-trained AI models. Our solution is cost-effective, assured to be cheaper than current market offerings due to our two-stage incentive system for worker node operators. Operators are rewarded with tokens for maintaining uptime guarantees and building a strong on-chain reputation. Additionally, they are paid in fiat for AI inferencing tasks on an 85/15 split.

We have had discussions with several AI chatbot developers, and their feedback indicated that they would only decide to use this product after actually testing it, rather than relying on theoretical claims, especially for cost and privacy-related aspects. This approach was also recommended by a leading Web3 accelerator (happy to share more details privately) when they heard about our similar efforts. They emphasized the need for a ZK (Zero Knowledge) compute network that processes off-chain and settles on-chain.

Regarding long-term funding, some VCs have shown interest in our idea and approach, but they expressed concerns about whether a young team can deliver a product of such high standards. This is one of the main reasons we've pursued the grants program—to validate our ability to execute.

Additionally, we have a revenue stream through selling plug-and-play edge computing hardware (Cyborg worker nodes), with a minimum 10% sales margin from the manufacturer, providing additional pre-sales funding.

Our previous grant delivery helped us as a young team to sharpen our focus and identify key areas to concentrate on when developing and deploying solutions to external testers. We believe that successfully completing this grant will significantly boost the morale of our team, beyond just the financial aspect.

Web3 Pitch deck 2024

Copy link
Member

@semuelle semuelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the honest and detailed answer, @beekay2706. I'm sorry if I sound hesitant, but we receive a lot of applications with the term AI slapped on it because it's a hot topic, and ZK because it's fancy, often with little knowledge of either one. But given that the onus to deliver is on you, I'm willing to give it a try.

@beekay2706
Copy link
Contributor Author

Thanks for the honest and detailed answer, @beekay2706. I'm sorry if I sound hesitant, but we receive a lot of applications with the term AI slapped on it because it's a hot topic, and ZK because it's fancy, often with little knowledge of either one. But given that the onus to deliver is on you, I'm willing to give it a try.

Thanks @semuelle

I truly appreciate your honesty. I completely agree that AI and ZK have become buzzwords, but I believe the structure of this program is designed to effectively filter out those who make big claims without delivering results. It’s not just about responsibility; our reputation is also on the line. We’re confident that successfully delivering on a complex tech stack, with the approval of the W3F, will significantly boost our young team's morale and prepare us for even more technically challenging solutions ahead.

@github-actions github-actions bot added the stale label Oct 25, 2024
@beekay2706
Copy link
Contributor Author

Hi Team,
This application has been on hold for 3 weeks now despite the two approvals, Could you please have a look

@keeganquigley
Copy link
Contributor

Thanks @beekay2706 I will ping the committee internally one more time.

@takahser takahser self-requested a review October 28, 2024 21:20
Copy link
Collaborator

@Noc2 Noc2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to go ahead with it. But once this grant is completed, we should try to get you independent of grants via VC funding, etc., and deployed on Kusama/Polkadot.

@Noc2 Noc2 merged commit e619f03 into w3f:master Oct 29, 2024
13 of 14 checks passed
Copy link
Contributor

Congratulations and welcome to the Web3 Foundation Grants Program! Please refer to our Milestone Delivery repository for instructions on how to submit milestones and invoices, our FAQ for frequently asked questions and the support section of our README for more ways to find answers to your questions.

Before you start, take a moment to read through our announcement guidelines for all communications related to the grant or make them known to the right person in your organisation. In particular, please don't announce the grant publicly before at least the first milestone of your project has been approved. At that point or shortly before, you can get in touch with us at [email protected] and we'll be happy to collaborate on an announcement about the work you’re doing.

Also, if you haven't yet, consider signing up for the Polkadot Alpha Program. The program offers plenty of resources for people building on Polkadot. Lastly, please remember to let us know in case you run into any delays or deviate from the deliverables in your application. You can either leave a comment here or directly request to amend your application via PR. We wish you luck with your project! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review The project is ready to be reviewed by the committee members.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants