Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for serialization support #8

Open
Nashtare opened this issue Oct 7, 2023 · 0 comments
Open

Proposal for serialization support #8

Nashtare opened this issue Oct 7, 2023 · 0 comments
Assignees

Comments

@Nashtare
Copy link
Member

Nashtare commented Oct 7, 2023

We currently support two types of encoding:

  • CanonicalSerialize / CanonicalDeserialize -> those are easily derived as all our wrapper types rely on arkworks traits that do implement those;
  • custom to_bytes / from_bytes inherited from the old codebase, which are simply calling CanonicalSerialize / CanonicalDeserialize methods internally.

This issue concerns two points related to serialization:

  • addressing the code duplication induced by all the custom to_bytes / from_bytes methods through new traits, like Encode/ToBytes and Decode/FromBytes (names are arbitrary and not carved in marble), which would be supertraits of CanonicalSerialize and CanonicalDeserialize respectively.

  • We may want to additionally support serde behind some feature flag for all our public types. This could actually remove the need for a custom serialization mechanism, or be complementary to it (for users who would like to rely on as few extra dependencies as possible and stick to the custom Encode/Decode).

Any thoughts?

@Nashtare Nashtare self-assigned this Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant