Replies: 2 comments
-
From Consensys/gnark#1206:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
From Consensys/gnark#1206. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here is my issue:
I want to generate a groth16 circuit using Arkworks. Let's say I also want to run it using Arkworks. I will get the
VerifyingKey
, theProof
, and an array ofE::ScalarField where E: Pairing
as my public inputs.Now I want to verify this on another service that runs in another language, let's say in the user browser using snark.js.
I have to serialize all the previously mentioned data structures in a format that is understandable by Snark.js.
Currently, the framework offers a
CanonicalSerialize
trait, which is optimized but not compatible with other frameworks. Neither snark.js or gnark implement deserialization this way.So I had to cook my own serialization library, which is not easy because all of the actual types for the numbers we are using are abstracted behind traits. I found that I could convert those to BigUint and then serialize them as HexString.
Now I have to build the same thing in reverse for all the other libs. But I'm not even able to do it for arkworks (probably not without
unsafe
) because I cannot initialize those structs with custom arbitrary values (the methods to do so are not exposed). OnlyCanonicalSerialize
allows you to do this.My request would be for a human-readable serialization to be implemented everywhere
Canonical(De)Serialize
is. And, ideally, for this format to be shared between all the major zk snarks frameworks out there.Is this something you already thought about? Did I miss a way to do it easily? How can I help to push this forward?
Beta Was this translation helpful? Give feedback.
All reactions