Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emilianobonassi/zkFHE
Verifiable and confidential computation based on ZKP and FHE, powered by risc0 zkVM.
https://github.com/emilianobonassi/zkFHE
Last synced: about 1 month ago
JSON representation
Verifiable and confidential computation based on ZKP and FHE, powered by risc0 zkVM.
- Host: GitHub
- URL: https://github.com/emilianobonassi/zkFHE
- Owner: emilianobonassi
- License: apache-2.0
- Created: 2023-04-19T15:17:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-20T16:34:46.000Z (over 1 year ago)
- Last Synced: 2024-08-01T22:53:08.072Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 70
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-risc0 - zkFHE
- awesome-risc0 - zkFHE
README
# zkFHE
Verifiable and confidential computation based on ZKP and FHE, powered by [risc0 zkVM](https://www.risczero.com/).
A PoC to demonstrate an approach for private computation on a public environment w/o give up data availability (since data can stay encrypted).
FHE provides confidentiality, ZKP provides the proof that the algorithm run following the rules.
## How it works
It's based on a tweaked version of [Cupcake](https://github.com/emilianobonassi/Cupcake), a library for the (additive version of) Fan-Vercauteren homomorphic encryption scheme. Tweaked so it can run in the risc0 zkVM (i.e. single thread, custom getrandom).
It runs the following protocol
1. (Host) Create public and secret key
1. (Host) Encrypt two numbers with the secret key
1. (Host) Pass the public key and the two encrypted numbers to the guest vm
1. (Guest) Fetch the encrypted data and init the FHE framework
1. (Guest) Perform the (encrypted) sum on the encrypted data using the public key
1. (Guest) Send back the encrypted sum to the host
1. (Host) Decrypt the sum with secret keyTL;DR host has the guarantee the guest run the algorithm (ZKP) and that the guest did not access to the unecrypted data (FHE).
## How to runFirst, [install Rust](https://doc.rust-lang.org/cargo/getting-started/installation.html) if you don't already have it, then
```
cargo run --release
```If you see 107 (19+88) at the end of the run, it worked.
PS: proof generation takes a lot (2hrs)