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

feat: create bn254 scalar field chip #1902

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

S1nus
Copy link

@S1nus S1nus commented Dec 29, 2024

Motivation

We want to compute this function in SP1, poseidon hash over bn254 scalar, as it would be computed in a Halo2 circuit. This is for a DA integration with a zkrollup built with Halo2 KZG.

Solution

It appears the bn254 precompiles in SP1 are for the base field, which makes sense to help verify proofs and compute pairings. However, iiuc this is not sufficient to perform computations as a halo2 circuit would, since the circuit inputs are elements of the scalar field.

Here I am developing a bn254 scalar field precompile, I expect it to be the same as Fp precompile but with a different modulus.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@S1nus S1nus changed the title create bn254 scalar field chip feat: create bn254 scalar field chip Dec 29, 2024
@lispc
Copy link
Contributor

lispc commented Dec 29, 2024

bn254 fr is grumpkin fp. this pr is useful for you https://github.com/scroll-tech/sp1/pull/17/files

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