privacy-scaling-explorations/zkevm-specs

Split address type in tables

ed255 opened this issue · 0 comments

ed255 commented

In the word lo/hi refactor we encountered several tables that must mix values of different types (Word, Address, U64, bool). These values are now encoded into 2 columns. The design approach we followed was to encode values smaller than a field in the lo part, and values higher than a field into lo and hi. Leading to the following encoding:

  • value: word -> (value_lo, value_hi)
  • value: address -> (value, 0)
  • value: u64 -> (value, 0)
  • value: bool -> (value, 0)

During the implementation we have observed that this design may be confusing and more complex to implement privacy-scaling-explorations/zkevm-circuits#1414 (comment)
So the new rules are that lo and hi are always at most 128 bits, meaning that the Address type will be split. The new proposal is:

  • value: word -> (value_lo, value_hi)
  • value: address -> (value_lo, value_hi)
  • value: u64 -> (value, 0)
  • value: bool -> (value, 0)