Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zkp-gravity/0g
https://github.com/zkp-gravity/0g
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zkp-gravity/0g
- Owner: zkp-gravity
- Created: 2023-03-31T20:09:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-25T11:09:02.000Z (over 1 year ago)
- Last Synced: 2024-08-03T01:13:44.380Z (4 months ago)
- Language: Python
- Size: 21.8 MB
- Stars: 39
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-zkml - zkp-gravity/0g - ZeroGravity - Zero Gravity is a system for proving an inference run (i.e. a classification) for a pre-trained, public Weightless NN and a private input. (2023) (Codebases / Articles and podcasts)
- awesome-aleo - Zero Gravity - Proving an inference pass for a public Weightless Neural Network run on a private input. (Applications / Machine Learning)
- awesome-aleo - Zero Gravity - Proving an inference pass for a public Weightless Neural Network run on a private input. (Applications / Machine Learning)
README
![](zero-gravity-banner.png)
Zero Gravity is a system for proving an inference pass (i.e. a classification) for a pre-trained, public Weightless Neural Network run on a private input. Zero Gravity builds upon the recent BTHOWeN model by [Susskind et al (2022)](https://arxiv.org/abs/2203.01479), in which the authors improve upon earlier WNN models in a number of interesting ways. Most importantly for this hackathon project, they helpfully provide an [implementation](https://github.com/ZSusskind/BTHOWeN) complete with pre-trained models and reproducible benchmarks.
See our [blog post](https://hackmd.io/@77sjNbqjST6HRnGPQyY9Dw/BkNGwbUW3) for an extensive description!
Built as part of the ZKHack hackathon, Lisbon, 2023.
## Setup
Clone and install the [custom aleo compiler]([email protected]:zkp-gravity/aleo-setup.git) supporting lookup arguments
## Usage
Values in the example below were generated using our fork of [BTHOWeN](https://github.com/zkp-gravity/BTHOWeN).
```
python3 scripts/generate_aleo_code.py 56
../aleo-setup/aleo/target/debug/aleo run main "$(cat input_file.txt)" "$(cat hash_values.txt)" "$(cat bloom_filters.txt)" $(cat winning_discriminator_value.txt) "$(cat winning_discriminator_index.txt)"
```## Implementation notes and limitations
- All inputs are private, except for which discriminator (category) succeeded, as well as the model itself.
- Proving time of e.g. a full MNIST example is not practical yet. PRs and suggestions for improvement are welcome.
- ❌ Print statements during the build phase are expected - and will be removed in future iterations of Aleo.
- The number of lookup constraints are not included in the final print statement but will show up when compiling in debug mode.
- Note that even when changing certain inputs, the proof might succeed, as it essentially checks which discriminator won.