A primitive credentialing system w/ selective disclosure. Written in noir, a DSL for zk circuits.
The government makes a claim that Alice was born on a given day. This claim, as well as the government's signature covering the claim, is stored off chain.
Bob wants to gate some action on his users being over 21 (i.e. born before a given day, 21 years ago).
With this circuit, Alice can prove the government claims she was born on some day before the cutoff, without revealing what day that is.
To setup the noir toolchain, use noirup.
Specifically nightly. There were some breaking changes in 0.6.0
noirup --nightly
To test the circuit, use nargo:
cd circuits
nargo test
- Fix
nargo prove p
andnargo verify p
, currently broken here 🤷♀️ - Integrate foundry into the test framework, building off of nplate
This code is being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the user interface or the smart contracts. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk.
tl;dr shits barely tested let alone audited -- not for prod