Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Proposal for serialization support #8

@Nashtare

Description

@Nashtare

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions