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

Serializable and hashable program spec #18

Closed
mitschabaude opened this issue Sep 26, 2024 · 0 comments
Closed

Serializable and hashable program spec #18

mitschabaude opened this issue Sep 26, 2024 · 0 comments
Assignees

Comments

@mitschabaude
Copy link
Member

A program Spec currently relies on o1js datatypes. However, we will need to transfer the program spec to a different web page.
Furthermore, it would be desirable to specify a credential from plain text or from a browser interaction.

For both use cases, we need a way to serialize & deserialize the spec to/from a simple data representation like JSON or a string.

To achieve this, we might have to predefine a list of supported o1js base type and define a serialization for each of them.

Finally, once we have a serialization, add a way to hash that serialization to get a unique short string of bytes that represents a spec.
Careful: equivalent specs must be serialized to exactly the same output (i.e. order of keys in a record should be deterministic), otherwise hashes for them will be different.

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

2 participants