Skip to content

Add affine_xy, affine_x, affine_y functions to CurveVar #189

@dongwook1214

Description

@dongwook1214

Summary

Add common methods to the CurveVar trait to retrieve the x and y affine coordinates of a group element.

Problem Definition

Circuit development often requires extracting the x-coordinate of a curve point. Currently, I'm using a sequence of to_bits_le() followed by le_bits_to_fp() to achieve this.

Currently, the CurveVar trait in arkworks lacks a standardized method for accessing the affine coordinates (x, y) of a curve point. Of course, it is possible to develop the same functionality using ToConstraintFieldGadget. However, when developing a circuit, the logic for extracting coordinates differs depending on whether the CurveVar is internally an AffineVar or a ProjectiveVar. This makes it difficult to write logic for a generic CurveVar.

Proposal

affine_x() should simply return a x-coordinate.
affine_y() should simply return a x-coordinate.
affine_xy() function is also required.


For Admin Use

  • [] Not duplicate issue
  • [] Appropriate labels applied
  • [] Appropriate contributors tagged
  • [] Contributor assigned/self-assigned

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions