{"id":13706064,"url":"https://github.com/apollozkp/zkp-subnet","last_synced_at":"2025-05-05T19:34:21.061Z","repository":{"id":225647605,"uuid":"766500941","full_name":"apollozkp/zkp-subnet","owner":"apollozkp","description":"A subnet on Bittensor which is capable of computing zero-knowledge proofs in a collaborative way, providing linear scaling of prover speed with network size, creating an open and permissionless prover market.","archived":false,"fork":false,"pushed_at":"2024-06-13T14:37:04.000Z","size":340,"stargazers_count":5,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-13T14:38:55.811Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apollozkp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-03T12:51:42.000Z","updated_at":"2024-06-13T14:37:04.000Z","dependencies_parsed_at":"2024-05-04T18:31:21.228Z","dependency_job_id":"c599fae6-f5ae-4f9f-aa41-11d0544bdf50","html_url":"https://github.com/apollozkp/zkp-subnet","commit_stats":null,"previous_names":["centuriazkp/zkp-subnet","apollozkp/zkp-subnet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apollozkp%2Fzkp-subnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apollozkp%2Fzkp-subnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apollozkp%2Fzkp-subnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apollozkp%2Fzkp-subnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apollozkp","download_url":"https://codeload.github.com/apollozkp/zkp-subnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252563153,"owners_count":21768413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T22:00:51.787Z","updated_at":"2025-05-05T19:34:16.053Z","avatar_url":"https://github.com/apollozkp.png","language":"Python","funding_links":[],"categories":["Registered Subnets"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# **Apollo Collaborative Zero-knowledge Proof Generation Subnet**\n[![Discord Chat](https://img.shields.io/discord/308323056592486420.svg)](https://discord.com/channels/799672011265015819/1222672871092912262)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) \n![example workflow](https://github.com/apollozkp/zkp-subnet/actions/workflows/ci.yml/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/apollozkp/zkp-subnet/badge.svg?branch=main)](https://coveralls.io/github/apollozkp/zkp-subnet?branch=main)\n\n[Website](https://apollozkp.com)\n\n\u003c/div\u003e\n\n## Introduction\n\nBittensor subnets are a great way to provide open APIs aimed at outsourcing certain computational workloads, whether it be model inference, distributed learning or other highly specific compute. However, a key ingredient to create extra valuable APIs is simply the leveraging of collaborative computation, rather than competitive computation. We believe that Bittensor will only be fully leveraged if subnets begin thinking more deeply about collaborative mining in tandem with the current approach. This is why we are building Apollo, and our first subnet will be a great example of the potential impact we can make; which is aimed at fruitfully combining compute power to achieve competitive results on the open market.\n\nOur first objective - to create a publicly available, massively scalable, concretely competitive and extremely cost-effective zero-knowledge proof generation cluster, by leveraging the work of [Pianist](https://eprint.iacr.org/2023/1271.pdf).\n\nOur aim with this subnet is to provide a public API which can easily undercut costs of bespoke GPU cluster solutions, and to become the go-to solution for many blockchain protocols and applications that are live today which leverage the magic of zero-knowledge proofs.\n\n## Features\n\n- Out of the box working implementation for good-enough proving speed (CPU only for now)\n- One-command setup, with easy process management through `pm2`\n- Context-dependent validation scoring (always at least one winner)\n- Fully randomized validation inputs, keeping mining fair\n\n### To be added\n\n- Out of the box CUDA implementation for simpler competition\n- Tutorials and tooling to create your own proving clusters, or using your own specialized hardware\n- An open, permissionless, market-driven API which opens up a powerful proving cluster to the public, allowing for ZK usecases before considered infeasible, such as provable inference\n\n## Roadmap\n\n- [x] Deploy v0 on Bittensor testnet\n- [x] Deploy v0 on Bittensor mainnet\n- [ ] Implement and deploy vanilla-PLONK style constraint aggregation | In progress...\n- [ ] Build payment infrastructure to fully open a public API for proof generation with payouts to miners and validators\n- [ ] Extend constraint aggregation support to any type of circuit (KZG only)\n- [ ] Explore segmented lookup tables in constraint aggregation work\n- [ ] Perform further research into distributing work for other commitment schemes\n- [ ] Explore other fruitful opportunities for miner collaboration outside of ZKP generation\n\n## Hardware requirements\n\n### Validator requirements\n\n- Ubuntu 22.04\n- At least 8 physical cores @ 3.0 GHz\n- At least 64 GB RAM (DDR4 or higher)\n- 200 GB storage\n\n### Miner requirements\n\n- Ubuntu 22.04\n- At least 8 physical cores @ 3.0 GHz\n- At least 64 GB RAM (DDR4 or higher)\n- 200 GB storage\n\n## Getting started\n\nVery minimally, you will want to at least have:\n\n- Python 3.8 or higher\n- [Bittensor CLI](https://github.com/opentensor/bittensor/blob/master/README.md#install) installed\n\nNext, you will want to set up a coldkey and hotkey, if you are planning on mining or validating on the Apollo subnet.\n\n```bash\nbtcli wallet new_coldkey --wallet.name \u003cyour_wallet_name\u003e\nbtcli wallet new_hotkey --wallet.name \u003cyour_wallet_name\u003e --wallet.hotkey \u003cyour_hotkey_name\u003e\n```\n\nBe sure to replace `\u003cyour_wallet_name\u003e` and `\u003cyour_hotkey_name\u003e` with names of your choosing.\n\nThen, ensure you have the subnet code on your machine.\n\n```bash\ngit clone https://github.com/apollozkp/zkp-subnet.git\ncd zkp-subnet\n```\n\nFinally, to start a miner, run:\n\n```bash\nmake miner WALLET_NAME=\u003cyour_wallet_name\u003e HOTKEY_NAME=\u003cyour_hotkey_name\u003e\n```\n\nwhere `\u003cyour_wallet_name\u003e` is the name of your wallet, and `\u003cyour_hotkey_name\u003e` is the name of your hotkey.\n\nTo start a validator, run:\n\n```bash\nmake validator WALLET_NAME=\u003cyour_wallet_name\u003e HOTKEY_NAME=\u003cyour_hotkey_name\u003e\n```\n\nwhere `\u003cyour_wallet_name\u003e` is the name of your wallet, and `\u003cyour_hotkey_name\u003e` is the name of your hotkey.\n\nThe command starts a `pm2` process which ensures that the miner or validator will continue running, even if you log out of your server session. To check the logs, simply type:\n\n```bash\npm2 logs\n```\n\nto get a look at what's happening.\n\n### Updating the miner/validator\n\nIf a new update has been released, you may update your miner or validator by running\n\n```bash\npm2 stop \u003cminer/validator\u003e\n```\n\nchoosing `miner` or `validator` depending on what you're running. Then, you can use\n\n```bash\ngit pull\n```\n\nto update the codebase. Finally, you can run the same `make` command as you did before to restart your miner or validator, and use `pm2 logs` to observe the output.\n\n### Validators only\n\nWhen registered and running, you can increase your stake to the subnet by running:\n\n```bash\nbtcli stake add --wallet.name validator --wallet.hotkey default\n```\n\n### Troubleshooting\n\nAny issues you may run into can be discussed in the [Discord](https://discord.com/channels/799672011265015819/1222672871092912262).\nSome common issues are:\n\n**I'm running into python errors while running the make command**\n\nMake sure you have permissions to run the make command. If you don't, you can run the command with `sudo`.\nIf you're still running into issues, please let us know in the [Discord](https://discord.com/channels/799672011265015819/1222672871092912262).\n\n**I'm not receiving requests**\n\nSyncing the metagraph can take up to 20 minutes. Please allow for some time before you start receiving requests.\nIf you are still not receiving requests, make sure that the necessary ports are open on your server.\nThe default ports for receiving requests is `8091`.\nTo see which port the metagraph has you on, you can run:\n```bash\n    btcli subnet metagraph --netuid NETUID --subtensor.network test/mainnet\n```\nAnd look for the `AXON` field for your miner/validator.\nIt should look like `\u003cyour_ip\u003e:\u003cyour_port\u003e`.\n\n## Contributing\n\nPlease see the [contribution guidelines](./contrib/CONTRIBUTING.md) for details.\n\n## License\nThis repository is licensed under the MIT License.\n```text\nThe MIT License (MIT)\nCopyright © 2024 Apollo\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the “Software”), to deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,\nand to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of\nthe Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\nTHE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n```\n\nThe repository also contains code licensed by Yuma Rao under the MIT License.\n\n```text\nThe MIT License (MIT)\nCopyright © 2023 Yuma Rao\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the “Software”), to deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,\nand to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of\nthe Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\nTHE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapollozkp%2Fzkp-subnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapollozkp%2Fzkp-subnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapollozkp%2Fzkp-subnet/lists"}