Skip to content

Conversation

cypriansakwa
Copy link
Contributor

Description

Problem

Resolves #89

Summary

This PR adds a new example to the repository: a zero-knowledge discrete logarithm proof circuit over the secp256k1 elliptic curve, using the noir_bigcurve library. The circuit demonstrates how to prove knowledge of a secret scalar ( k ) such that ( Q = k \cdot G ), where ( G ) and ( Q ) are public points on secp256k1, without revealing ( k ). This is a foundational primitive for privacy-preserving authentication and cryptographic protocols.

The example includes:

  • A Noir circuit that:
    • Accepts ( G ), ( Q ) as public inputs and ( k ) as a private (witness) input.
    • Verifies that ( Q = k \cdot G ) on secp256k1, leveraging noir_bigcurve.
  • Unit tests covering:
    • Correct proof for valid ( k, G, Q ) tuples
    • Rejection of incorrect proofs (wrong ( Q ), not-on-curve points)
  • A README.md explaining:
    • The cryptographic context and purpose
    • How to run the example and tests

Additional Context

  • This example serves as an educational resource for developers interested in building zero-knowledge proofs over real-world elliptic curves (such as those used in Bitcoin/Ethereum).
  • It demonstrates Noir's capabilities for high-level, safe, and expressive zk-circuit development.
  • Feedback and suggestions are welcome for further improvement or additional tests.

PR Checklist

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

@cypriansakwa cypriansakwa marked this pull request as draft August 14, 2025 17:06
@cypriansakwa cypriansakwa changed the title First commit Add zk-discrete-log-Proof example over secp256k1 using noir_bigcurve Aug 14, 2025
@cypriansakwa cypriansakwa marked this pull request as ready for review September 8, 2025 03:35
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.

Add zk-discrete-log-Proof example over secp256k1 using noir_bigcurve
1 participant