enricobottazzi/zk-fhe

Halo2base over PSE-Halo2

CPerezz opened this issue · 3 comments

Hey!

Would be nice to know why you prefer to use halo2base over pse/halo2 since we would like to improve it such that it can fit your needs.

I assume is basically all the ecc-gadgets it provides? Are there any other things that make you prefer using it?

Cheers!

Hi Carlos! @CPerezz

Thanks for your interest.

The answer is pretty simple. The repo was built within the Axiom open source program, and the purpose of the program was to build using halo2base.

But since you ask I can provide you a feedback since I used both of them:

  • We don't perform any elliptic curve operation inside the circuit. Most of the cost is given by large polynomial multiplications
  • A limitation (as far as I understood) of halo2base is that it doesn't allow you to do custom lookups. For example, this is a very complex logic that we had to implement to perform check that coeff is in the range [0, Z] OR [Q-Z, Q-1] https://github.com/enricobottazzi/zk-fhe/blob/master/src/chips/poly_distribution.rs#L24. I think that this would have been simpler in pse/halo2 by just loading a lookup table with these values and check that coeff ∈ table
  • On the flipside, we relied heavily on the challenge API to speed up polynomial multiplication and the way it is served by halo2base is pretty straight forward. Also, according to this document (https://hackmd.io/@axiom/SJw3p-qX3) it seems to be faster than halo2/pse given that, in halo2/pse the synthesize function is called twice when using 2 witness generating phases.

I'm curious to know if you see other ways the circuit can benefit by using pse/halo2.

Thanks again,
Enrico

Something that be interesting in the near future is support for wrong field arithmetic. Do you know if pse/halo2 provide any gadget for that ?

The answer is pretty simple. The repo was built within the Axiom open source program, and the purpose of the program was to build using halo2base.

That makes a lot of sense! I thought this was a PSE project lol!
Thanks also for listing the reasonings behind! It's useful for us!

Something that be interesting in the near future is support for wrong field arithmetic. Do you know if pse/halo2 provide any gadget for that ?

https://github.com/privacy-scaling-explorations/halo2wrong

There you go!