-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[examples] Create an example of using small fields #13
Comments
Is there anything to be done outside of the Air circuit and some helper functions? I made a very basic example (by just copying the fib repo in example/ and changing the field, nothing to be considered serious!). The code is here: Nashtare@5615d8d While investigating, I realized that function |
Thank you for looking into this! Yes, the issue is exactly where you've identified. Basically, when we serialize field elements, they are serialized according to their internal representation, which for f62 field is in the range The proper way to handle this is to serialize elements according to canonical representation (to make sure they are in In terms of performance impact, I'd expect switching to f62 field to speed up proving time by a factor of 4x - 5x. |
Ah thanks for the explanation! I thought I was doing something wrong 😅 |
Yes - that's right! In general, only the first 5 steps of the protocol are executed in the base field (from trace generation to constraint evaluation). The rest is executed in the extension field. And the complexity of the first 5 steps is much more dependent on the complexity of AIR than that of all the remaining steps. For example, for something like simple Fibonacci example, the first 5 steps take up about 50% of proving time. While for something like like Lamport signature aggregation (one of the more complicated examples), the first 5 steps take up 85% - 90% of proving time. So, I'd expect that as AIR gets more complex, the benefit of using smaller fields increases - but I think it would be interesting to see if it actually gets closer to 4x - 5x I quoted or it would be more in the 3x - 4x range.
I'd expect something in the similar ballpark but hard to say without running actual experiments. Btw, for a larger prime, it is probably beneficial to go with a 252-bit prime which is actively being used in various projects (primarily by StarkWare). The prime is 2251 + 17 * 2192 + 1. |
Refactor verifier to use channel abstraction
Closing this as we already have FibSmall example which uses |
Currently, all our examples are done in a 128-bit field. It would be good to create an example in a 62-bit field. There are a few options here - but I think signature aggregation would be one of the more interesting ones.
The text was updated successfully, but these errors were encountered: