Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.27 KB

README.md

File metadata and controls

33 lines (25 loc) · 1.27 KB

This repo contains the Halo2 implementation for the Anon-Aadhaar protocol.

The main components of the circuit are :-

  1. Verification of an RSA signature of a SHA-256 hashed message.
  2. Extraction of fields from signed data. If reveal true: age > 18, gender, state, pincode.
  3. Computing the Nullifier from the Poseidon Hash function.
  4. Conversion of IST timestamp to UTC UNIX timestamp.
  5. Apply constraints on the signal hash.

How to build and run the repo:

  1. cargo update -p half@2.4.1 --precise 2.2.0
  2. cargo build
  3. cargo test

Benchmarks:

Part of the Circuit Proving Time Verification Time
RSA-SHA256 14.442124258s 11.461932341s
Nullifier 322.659513ms 96.948µs
Conditional Secrets 17.916018ms 307.496281ms
Timestamp 9.821774ms 1.990614ms
Signal 12.089368ms 78.350583ms

The Solidity Verifier of the entire Halo2 Circuit was obtained by using the PSE Halo2-Solidity-Generator repo: https://github.com/privacy-scaling-explorations/halo2-solidity-verifier.

The Verification Cost of the Solidity Verifier of the entire Aadhaar_QR_Verifier circuit:

Total Gas Cost: 6520332 gas
Transaction Cost: 5669850 gas
Execution Cost: 4955130 gas