Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Potential upgrade via plookups #42

Open
jon-chuang opened this issue May 2, 2021 · 5 comments
Open

Potential upgrade via plookups #42

jon-chuang opened this issue May 2, 2021 · 5 comments

Comments

@jon-chuang
Copy link

Plookups provide efficient bit decomposition. For instance, one can use lookup tables of size 2^13.

Furthermore, one can use RNS decomposition (using the modulus F and a power of 2 e.g. 2^256/2^384) to efficiently check the arithmetic as per https://hackmd.io/LoEG5nRHQe-PvstVaD51Yw?both

@burdges
Copy link

burdges commented May 2, 2021

I've wondered about the RNS/CRT approach before, but never really pushed the mathematics. I'd always assumed you'd need at least four primes to do the reduction step in https://cr.yp.to/antiforgery/meecrt-20060914-ams.pdf likely meaning instantiating your SNARK separately over each prime. It's a cute idea to use a power of two there. :)

@jon-chuang
Copy link
Author

jon-chuang commented May 3, 2021

Yes, it's a bit of a stroke of genius, fairly typical of Zac (from Aztec). (who used to do work on particle physics)

@weikengchen
Copy link
Member

weikengchen commented May 10, 2021

Lookup tables would be useful for bit decomposition of a few bits.

The challenge seems to be here: the current nonnative library targets at general R1CS and does not assume the upstream proving system to enable defining other constraints (here, beyond the R1CS, lookup constraints). Therefore, this technique would require the upstream proving system to be very flexible in being able to compose different languages of constraints (here, lookup arguments).

@jon-chuang
Copy link
Author

jon-chuang commented May 10, 2021

Yes, @Pratyush and I discussed this and we think it may be possible to have gadgets target a more generalised constraint system, based on its capabilities. For instance, in this case, only the bit decomposition "gadget IR opcodes" requires being resolved. The rest of the circuit could possibly remain as R1CS. In the future, we could even make this more agnostic.

@weikengchen
Copy link
Member

weikengchen commented May 10, 2021

And also in this reign, it would be great if there is a more generalized constraint system + a more efficient bit testing protocol (which I don't know, but there could be), such that bit testing is done in another protocol.

Since much overhead in nonnative is bit testing, reducing the cost of bit testing is useful. And thinking about that bit testing is such a fundamental operation, and also R1CS is an overkill of it, there might be some potentials.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants