Skip to content
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

Epic: Add Noir function solvers into TS #3079

Closed
3 tasks done
TomAFrench opened this issue Oct 10, 2023 · 2 comments
Closed
3 tasks done

Epic: Add Noir function solvers into TS #3079

TomAFrench opened this issue Oct 10, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request js Noir's JavaScript packages

Comments

@TomAFrench
Copy link
Member

TomAFrench commented Oct 10, 2023

In Expose black box function solvers into TS#2811 we exposed black box functions to typescript so that users can easily calculate values in the same way as which it will be calculated inside their circuits.

A number of useful functions are only implemented in Noir however, e.g. Poseidon, Sha256, etc. so we should expose methods to easily execute custom Noir programs and use their return values in user business logic.

Tasks

Preview Give feedback
  1. enhancement js
  2. 8 of 8
    enhancement js

With #3080 we can already achieve the funcitonality with const { returnValue } = await new Noir(program_json).execute(inputs).

Outstanding tasks being:

  • Replace the above JS snippet with a const returnValue = executeCircuit(program_json, inputs) syntax to be more functional
    • This requires the executeSync function to be added to acvm_js so we can execute ACIR without foreign calls in a sync fashion.
  • Simplify generating a TS package from a Noir library
    • As the execute function can hardly match native TS packages in computation speeds given its ACVM overheads
    • Possible approaches could be
      • add a #[codegen-ts] attribute to mark a function as one to be compiled into a function for users to call.
      • codegen typesafe wrappers around executeCircuit which enforce type safety on the inputs.
@Savio-Sou Savio-Sou added this to Noir Oct 2, 2023
@TomAFrench TomAFrench converted this from a draft issue Oct 10, 2023
@TomAFrench TomAFrench self-assigned this Oct 10, 2023
@Savio-Sou
Copy link
Collaborator

Savio-Sou commented Oct 10, 2023

Assigning P-HIGH P-MEDIUM to this Epic, as this helps the Private Kernel Circuit rewrite project plus very useful for Noir app devs in general, but not necessarily blocking any project.

@Savio-Sou Savio-Sou added enhancement New feature or request js Noir's JavaScript packages labels Oct 10, 2023
@Savio-Sou Savio-Sou added this to the Pre-Istanbul milestone Oct 25, 2023
@Savio-Sou Savio-Sou modified the milestones: NoirJS Helpers, 1.0 Nov 22, 2023
@Savio-Sou Savio-Sou added P-MEDIUM and removed P-HIGH labels Dec 4, 2023
@TomAFrench TomAFrench closed this as not planned Won't fix, can't repro, duplicate, stale Apr 20, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Apr 20, 2024
@TomAFrench TomAFrench removed this from the 1.0 milestone Apr 20, 2024
@Savio-Sou
Copy link
Collaborator

Savio-Sou commented Apr 22, 2024

Closing as completed instead as we do have noir_codegen now that largely if not fully fulfill this Issue's original purpose: https://noir-lang.org/docs/getting_started/tooling/noir_codegen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request js Noir's JavaScript packages
Projects
Archived in project
Development

No branches or pull requests

2 participants