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

Add Base64 Encoding/Decoding and Enhanced String Handling for Bytes #1659

Merged
merged 11 commits into from
May 22, 2024

Conversation

Shigoto-dev19
Copy link
Contributor

@Shigoto-dev19 Shigoto-dev19 commented May 18, 2024

Description

All changes revolve around the provable Bytes class.

Changes

  • Added base64Encode and base64Decode methods.
  • Added unit tests for the new Base64 methods.

Notes

  • For detailed instructions on using Base64 encode/decode in o1js and an overview of provable Base64 constraints, refer to the o1js-base64 repo README.
  • For an example of zkPrograms using Base64, see this file.

Copy link
Collaborator

@mitschabaude mitschabaude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Shigoto-dev19! This is an incredible addition to o1js.

I'll review in detail later but have some quick feedback: You can't remove methods like toHex() and fromHex() because this is a breaking change and would move o1js to version 2.0 according to semver, which we don't want.

Copy link
Collaborator

@mitschabaude mitschabaude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed it, have a few more comments, looks great overall

src/mina Outdated Show resolved Hide resolved
src/lib/provable/bytes.ts Outdated Show resolved Hide resolved
src/lib/provable/bytes.ts Outdated Show resolved Hide resolved
src/lib/provable/bytes.ts Outdated Show resolved Hide resolved
src/lib/provable/bytes.ts Outdated Show resolved Hide resolved
src/lib/provable/bytes.ts Outdated Show resolved Hide resolved
src/lib/provable/bytes.ts Outdated Show resolved Hide resolved
src/bindings Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@mitschabaude
Copy link
Collaborator

note that the tests are just failing because you changed the bindings and mina submodules

@Shigoto-dev19
Copy link
Contributor Author

I reviewed it, have a few more comments, looks great overall

Thank you for the review! I'll address the comments and update the branch :)

@mitschabaude mitschabaude merged commit f0860e8 into o1-labs:main May 22, 2024
12 of 14 checks passed
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

Successfully merging this pull request may close these issues.

2 participants