lurk-lab/lurk-rs

A more stable tag -> field elt map

arthurpaulino opened this issue · 0 comments

Our current mapping from tags to field elements is based on the position of the tag variants in the enum they're defined.

This approach is subject to volatile changes in the tag enums orderings, which changes the resulting hashes for commitments and proof claims that we have. Not only that, but it also breaks old proofs because their witnesses were created with constants that have become invalid.

So I'm proposing that we define an explicit mapping from tag to field elements. Well, more precisely, it's an explicit map from tag to u16 , IIRC, which then gets converted to fields elements.