Home

Awesome

Anon-Aadhaar Protocol Implementation in Noir

This project implements the Anon-Aadhaar protocol using Noir.

[!WARNING] It is not safe to use in production with real data. Please use the Circom implementation for production use.

Modules

Setup

Prerequisites

Note: Ensure you have Noir version 0.38.0 and barretenberg backend verison 0.61.0

installed and . If not, set it specific version using the following command:

noirup -v 0.36.0
bbup -v 0.61.0

Build circuits:

cd circuits
nargo compile

Testing

To run the tests:

nargo test --show-output

Testing with Real Data

To run the tests with read data:

  1. Setup scripts:
cd scripts
yarn install
  1. Configure environment:

    • Create .env in scripts directory with:
export REAL_DATA=true
export QR_DATA= <aadhar data (bigint)>
  1. Generate test inputs:
yarn gen-test-inputs

This creates test inputs in circuits/testcases/test.toml

  1. Execute tests with real data:
nargo execute -p testcases/test.toml

Benchmarks

Benchmarks via the Barretenberg Backend on M1 Macbook Pro 2020:

To run the benchmarks:

cd scripts
./benchmark.sh

Circuit Size: 237,811 gates

OperationUltra HonkDefault BB
Proving2.672s6.878s
VK Generation1.799s6.551s
Verification0.042s0.044s