o1-labs / snarky

OCaml DSL for verifiable computation
MIT License
495 stars 74 forks source link

Typ instance for non-field based types #285

Closed imeckler closed 5 years ago

imeckler commented 5 years ago

I saw on the zk-workshop branch there are "typs" for non-field-element-based types like float, char, etc. I want to push back on this because it sort of breaks the semantics of the language.

For compiling to SNARKs, it's important that the constraint system is fixed irrespective of the values chosen by a prover/request-handler.

However, if non-field-element-based types are allowed to be returned by requests, we can no longer guarantee that this is the case.

mrmr1993 commented 5 years ago

Agreed. This was a hack to get some edge cases that people were hitting working (e.g. field * int tuples accessed inside a prover block) for the conference. I have a plan to make this work without the hack.

mrmr1993 commented 5 years ago

317 should cover all our use-cases now, closing.