Skip to content

Conversation

cypriansakwa
Copy link
Contributor

@cypriansakwa cypriansakwa commented May 31, 2025

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*

  • Implements a Noir circuit (main.nr) that asserts the age is within a minimum and maximum boundary.
  • Includes automation scripts (build.sh, test.sh, etc.) for building, proving, verifying, and exporting the Solidity verifier contract.
  • Provides a Solidity verifier contract to verify proofs on-chain.
  • Includes detailed README documentation explaining setup and usage.
  • Adds GitHub workflow configuration for automated testing.

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*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@critesjosh
Copy link
Collaborator

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.

@cypriansakwa
Copy link
Contributor Author

cypriansakwa commented Jun 3, 2025 via email

@critesjosh critesjosh closed this Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants