NEWTON

NEWTON


Popular tags

    Cairo: Where/how is it defined and why is it much smaller than the field prime?

    Asked

    4 months ago

    8

    views


    0

    Bumped into rc_bound today and was wondering: where/how is it defined and why is it much smaller than the field prime?

      cairocairo-lang

    Newton

    asked

    4 months ago


    2 answers

    0

    the eternal question almost no one at starknet has been able to answer for months!

    I have had eventually quite recently a definitive answer from Dan Carmon, copied here below:

    it could have been possible to have the basic range_check call be for 250 bits, but that would have made it more expensive per call. If I'm not mistaken (which I may be), the actual basic range check is 16-bit, and a 128-bit range check is actually made of 8 16-bit range checks, already wrapped together by the builtin. To have a 250-bit range check you would need to use 16 16-bit range checks, which would mean that you could only fit half as many in the same number of steps. As Shahar said, you can simulate 250-bit range check with 3 128-bit ones, and 128-bit with 2 250-bit ones, so the decision of which is better depends mostly on what is more common. I believe our opinion was that in many use cases, 128 bits would be more than enough, and the cases where 250 bits are both necessary and sufficient would be relatively rarer, so using the slightly smaller range check would be better optimized for the common use case.

    answered

    4 months ago

    0

    answered

    4 months ago

    Your answer

    NEWTON

    NEWTON