zkFold / zkfold-base

ZkFold's Base library
https://zkfold.io
MIT License
15 stars 6 forks source link

ZK KYC: data types and a KYC check example in Symbolic #239

Closed vlasin closed 2 weeks ago

vlasin commented 2 months ago

Add types related to the ZK KYC application to zkFold Symbolic. See this document for details.

Checklist for this issue:

TurtlePU commented 2 weeks ago

All data types have JSON instances

How are ToJSON instances of Symbolic datatypes going to be used, btw?

vlasin commented 2 weeks ago

All data types have JSON instances

How are ToJSON instances of Symbolic datatypes going to be used, btw?

Do you mean for circuits? We only need them for the interpreter version.

TurtlePU commented 2 weeks ago

We only need them for the interpreter version.

Oh, okay, nice!

vlasin commented 2 weeks ago

However, we might want a circuit serialization feature at some point. Also, conversions to/from other popular formats.

TurtlePU commented 2 weeks ago

Then I think we can model this more accurately with the help of #308, like this:

fromValueJSON :: (SymbolicValue d, FromJSON (Value d)) => ... 
toValueJSON :: (SymbolicValue d, ToJSON (Value d), Context d ~ c, BaseField c ~ WitnessField c) => ...

And derive FromJSON/ToJSON for Symbolic data which would give us circuit serialization behavior