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

Adding a constructor for ParamsKZG #163

Closed
Ethan-000 opened this issue Mar 31, 2023 · 8 comments · Fixed by #164
Closed

Adding a constructor for ParamsKZG #163

Ethan-000 opened this issue Mar 31, 2023 · 8 comments · Fixed by #164

Comments

@Ethan-000
Copy link

Ethan-000 commented Mar 31, 2023

Hey

I'm wondering if a ParamsKZG constructor can be added so that it can be initialized through k, n, g, g_lagrange, g2, s_g2 🙂. Currently these fields are only accessible through the crate and there's no function that can do this

    pub(crate) k: u32,
    pub(crate) n: u64,
    pub(crate) g: Vec<E::G1Affine>,
    pub(crate) g_lagrange: Vec<E::G1Affine>,
    pub(crate) g2: E::G2Affine,
    pub(crate) s_g2: E::G2Affine,
@CPerezz
Copy link
Member

CPerezz commented Mar 31, 2023

Sure! I don't see any reason why this could not be done. But I'm not sure why the current usage options don't fit you.
You can currently do to things:

  • You can generate parameters and serialize them into a file. And read them when you need to.
  • Generate the params on the fly (this works for small sizes only, but should help depending on the setup).

Why any of these two things doesn't work for you? What are you trying to do?

@Ethan-000
Copy link
Author

Yeah I was trying to initialize the parameters from an existing setup ceremony

@Ethan-000
Copy link
Author

I can try to open a pr that add this functionality if thats okay :)

@CPerezz
Copy link
Member

CPerezz commented Mar 31, 2023

Yeah I was trying to initialize the parameters from an existing setup ceremony

Ohh I see.
Basically you have the powers of Tau but not in the format we need them for you to serialize the object. Is that the case?

If so, if you want to make a PR, we definitely appreciate it! Otherwise, we'll try to implement this as soon as we have time for it! 😄

@Ethan-000
Copy link
Author

Ohh I see. Basically you have the powers of Tau but not in the format we need them for you to serialize the object. Is that the case?

Yep

If so, if you want to make a PR, we definitely appreciate it! Otherwise, we'll try to implement this as soon as we have time for it! 😄

Will do later today 🫡

@kilic
Copy link

kilic commented Apr 4, 2023

Why any of these two things doesn't work for you? What are you trying to do?

Other option is that to make a file that halo2 can deserialize so that we can ensure that parameters can pass assertions while reading

@han0110
Copy link

han0110 commented Apr 12, 2023

Yeah I was trying to initialize the parameters from an existing setup ceremony

btw for reading from existing ceremony, we also have some format converted already in this repo https://github.com/han0110/halo2-kzg-srs (currently we have converted https://github.com/weijiekoh/perpetualpowersoftau and https://github.com/iden3/snarkjs).

@Ethan-000
Copy link
Author

Yeah I was trying to initialize the parameters from an existing setup ceremony

btw for reading from existing ceremony, we also have some format converted already in this repo https://github.com/han0110/halo2-kzg-srs (currently we have converted https://github.com/weijiekoh/perpetualpowersoftau and https://github.com/iden3/snarkjs).

Great will have a look 🙂

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 a pull request may close this issue.

4 participants