A zero-knowledge proof system for verifying insurance discount eligibility based on age and BMI without revealing the actual values. The Rust App generates a server which accepts private inputs and generates proof and public inputs.
The whole app runs inside the Marlin oyster's CVM, which secures the App inside TEE enclaves (Your private inputs are secured and can't be leaked).
- Proves age is between 10-25 years
- Proves BMI is between 18.5-24.9
- Generates zero-knowledge proofs without revealing actual values
- Docker containerized for easy deployment
- TCP server interface accessible via
ncortelnet - Concurrent client support
- Docker and Docker Compose
- Git
- Nargo installed
- bb (version: 0.87.0) installed
- Compile the circuit:
cd noir-circuit
nargo compile- Run the server:
cd server
cargo run- In a new terminal, connect to the server:
nc 127.0.0.1 8080- Follow the prompts to enter your age (10-25) and BMI multiplied by 10 (185-249).
- Build Docker Image and Publish on Docker Hub:
sudo docker build -t ayushranjan123/insurance-verifier:latest .sudo docker push ayushranjan123/insurance-verifier:latest - Start the server locally:
sudo docker pull ayushranjan123/insurance-verifier:latest sudo docker run --rm --init -p 8080:8080 ayushranjan123/insurance-verifier:latest- Connect from another terminal:
nc 127.0.0.1 8080or
telnet 127.0.0.1 8080- Deploy On Oyster TEE:
For AMD64 Architecture-
oyster-cvm deploy --wallet-private-key <key> --duration-in-minutes 20 --docker-compose docker-compose.yml --arch amd64- Start the server:
nc <IP> 8080or
telnet <IP> 8080- Interaction example:
ZK Insurance Verifier Server
============================
Enter age (10-25): 20
Enter BMI multiplied by 10 (185-249): 220
Generating proof...
=== PROOF RESPONSE ===
Success: true
Message: Proof generated successfully! The user is eligible for insurance discount.
...
-
Deploy the
Verifier.solcontract using Remix IDE, follow the steps from Noir Docs: https://noir-lang.org/docs/dev/how_to/how-to-solidity-verifier#step-2---compiling -
Use proof and public inputs generated from the application to verify.
oyster-cvm verify --enclave-ip <ip>