ronkathon icon indicating copy to clipboard operation
ronkathon copied to clipboard

bounty: Algorithm to find generator points

Open 0xJepsen opened this issue 1 year ago • 10 comments

Bounty Description

Implement a compile-time (const fn) algorithm to find generator points on elliptic curves so that we may have arbitrary generators used as compile-time constants in traits. Generator points are used to generate the cyclic subgroup used in various cryptographic protocols.

Implementation requirements

A clear and comprehensive list of the requirements for the bounty to be considered complete.

  • [ ] Implement a const function to find generator points on a given elliptic curve
    • Should accept curve parameters as input and utilize ronkathon's existing random point generation function / sqrt algorithm
  • [ ] Update traits that utilize generators to use this compile-time function
  • [ ] Implement proper error handling and input validation
  • [ ] Documentation and tests
    • Implement tests to verify the algorithm yields generators for small groups
    • Test for groups over extension fields as well as prime fields
    • Should verify that the point generates the entire group or a subgroup of desired order
    • Create comprehensive unit tests, e.g. with well-known curves (secp256k1, Curve25519)
    • Test edge cases and invalid inputs
    • Provide clear documentation and code commenting on the algorithm's operation and usage

Bonus Features

Any additional features that will enhance the value of the bounty.

  • [ ] Optimize the algorithm for efficiency:
    • Implement early termination conditions
    • Use efficient methods for scalar multiplication
    • Optimizations that may obfuscate understanding must be given as an optional feature

Resources

Elliptic Curve Cryptography: A Gentle Introduction Standards for Efficient Cryptography (SEC) 2: Recommended Elliptic Curve Domain Parameters Elliptic Curves for Security (RFC 7748) Handbook of Elliptic and Hyperelliptic Curve Cryptography, Chapter 9: Generating Elliptic Curves

Criteria

Bounties will be rewarded based on the following criteria:

  1. Correctness and security: A thorough review of the implementation should convince our team that they are correct and secure, with all requirements met.
  2. Code clarity and quality: Succinct, easy-to-follow code with appropriate naming conventions. Utilize Rust’s type system for flexibility and security (e.g., compile-time checks where possible), and avoid external crates. Optimizations should be a lower priority than clarity, but can be included behind a feature flag as a bonus.
  3. Documentation quality: Provide comprehensive README’s, Cargo docs, and inline comments where code itself is not self-explanatory. Prioritize clarity and readability.

0xJepsen avatar May 02 '24 00:05 0xJepsen

I think this could now be implemented since we can draw random points on the curve / have access to sqrt algorithm.

Autoparallel avatar May 17 '24 16:05 Autoparallel

Just to be clear, if a test of the const fn is made, the prime should be small, otherwise compilation time will explode.

Autoparallel avatar Dec 19 '24 14:12 Autoparallel

i would like to take on this

mahmudsudo avatar Feb 22 '25 02:02 mahmudsudo

@mahmudsudo you are already in the midst of many issues. Let's get those closed prior to assigning!

Autoparallel avatar Mar 12 '25 22:03 Autoparallel

can this be assigned to me now ?

mahmudsudo avatar Apr 13 '25 03:04 mahmudsudo

@mahmudsudo You have already put your name into many bounties, so for now I'm going to keep this open for the community. Let's focus on the others

Autoparallel avatar Apr 14 '25 20:04 Autoparallel

Hey @Autoparallel I want to do this. Can you please clearify the bounty on this, I means what kind of bounty and how much?

OpensourceMaverick avatar May 13 '25 10:05 OpensourceMaverick

Hey @OpensourceMaverick! I'm no longer working with Pluto so I can't comment on this. I'd suggest contacting @devloper or @mattes to see what they think.

Nonetheless, thanks for taking interest in the project!

Autoparallel avatar May 14 '25 00:05 Autoparallel

@devloper @mattes

OpensourceMaverick avatar May 15 '25 07:05 OpensourceMaverick

i would really love to continue contributing to ronkathon , i could help in managing the repo and i would love to pick up this issue

mahmudsudo avatar Nov 16 '25 16:11 mahmudsudo