-
Notifications
You must be signed in to change notification settings - Fork 34
Age range #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Age range #45
Conversation
This age range check is not a reliable way to verify someone's age, as a user can enter whatever value they'd like into the circuit, so I am reluctant to include this as an example. It may be useful to have an example just does a simple check like this, provided the rest of the project structure is useful for Noir devs. What is included in this example that isnt included in the other examples? If you want to do an age check example, you might want to look into something like zkpassport, although that can be done without writing your own noir circuit. |
Hi @critesjosh ,
Thank you for the feedback!
You're absolutely right — this circuit alone doesn't securely verify
someone's age since the user can supply any value as input. My intent with
this example was not to demonstrate secure identity or credential-based age
verification, but rather to provide a simple, self-contained educational
example of how Noir can be used to enforce basic input constraints (e.g.,
age range checks).
**What's different in this example:**
- It shows a minimal and intuitive pattern for validating input values
using `assert`.
- It includes boundary test cases (commented out for now) to demonstrate
how Noir handles failing inputs.
- It aims to help new Noir users understand how to work with simple
conditionals, testing structure, and parameterization within circuits.
That said, I fully understand this isn’t suitable as a *secure* age
verification demo. To address this, I’ve added a clear disclaimer in the
README noting that this example is for educational purposes only and
**not** a reliable form of verification. Let me know if the changes make
it suitable to keep this as a minimal example in the repo — or if you’d
prefer it live outside the official set.
Alternatively, I’m happy to rework this into a more advanced example
involving attested age proofs or commitments, possibly integrating with
projects like [zkPassport](https://docs.zkpassport.id/intro) or a simulated
credential system such as [Privado ID](https://www.privado.id/).
Please let me know your thoughts — and thanks again for reviewing!
…On Mon, Jun 2, 2025 at 6:39 PM josh crites ***@***.***> wrote:
*critesjosh* left a comment (noir-lang/noir-examples#45)
<#45 (comment)>
This age range check is not a reliable way to verify someone's age, as a
user can enter whatever value they'd like into the circuit, so I am
reluctant to include this as an example. It may be useful to have an
example just does a simple check like this, provided the rest of the
project structure is useful for Noir devs. What is included in this example
that isnt included in the other examples?
If you want to do an age check example, you might want to look into
something like zkpassport <https://docs.zkpassport.id/intro>, although
that can be done without writing your own noir circuit.
—
Reply to this email directly, view it on GitHub
<#45 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJ3FDG2TBTW4D52JHOQEXID3BRVZZAVCNFSM6AAAAAB6KCQC6KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMZRGI4TQNRWHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi @critesjosh and @signorecello
Would you kindly take a moment to review this PR when you have a chance? I’d really appreciate your feedback to ensure everything aligns well with the project standards.
Thank you both in advance! 🙏
Description
This PR adds a new example to the noir-examples repository demonstrating an age range zero-knowledge proof circuit in noir. The example shows how to prove that a user's age lies within a specified range (e.g., between 18 and 60) without revealing the actual age.The example covers building, proving, verifying, and exporting Solidity verifiers for ages between 18 and 60.
Problem*
Adds a new example demonstrating an age range zero-knowledge proof circuit built with Noir, including full build, proof generation, verification, and Solidity verifier export.
Resolves
Summary*
main.nr
) that asserts the age is within a minimum and maximum boundary.build.sh
,test.sh
, etc.) for building, proving, verifying, and exporting the Solidity verifier contract.Additional Context
This example complements the existing Noir examples by demonstrating practical age verification logic with Solidity verifier integration, useful for decentralized identity or access control applications.
PR Checklist*
cargo fmt
on default settings.