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 example for gate counts #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

jzaki
Copy link
Contributor

@jzaki jzaki commented Nov 1, 2024

Description

Problem*

For libs to remain backend agnostic, proving backend gate counts should exist outside of the lib. And generally for examples to use libs in some context.
Resolves #29

Summary*

A place to show bb gate counts of libs, first the base64 lib.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

- Note there's an optional param that you can use to specify the name of the witness file generated
- Optional: `nargo execute -p Prover_SHORT.toml base64_example_SHORT.gz`
- If using barretenberg, check the gate count referring to the newly created program:
- `bb gates -b ../target/base64_example.json`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we suggest running this, do you think we should provide some context as to what the output of bb gates means? Or link to a place that explains it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a point for some context.

Copy link
Collaborator

@critesjosh critesjosh left a comment

Choose a reason for hiding this comment

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

What do you think about making the example more practical, in the sense that it would be something that someone would want to do in real life?

@jzaki jzaki marked this pull request as draft December 2, 2024 14:44
@jzaki jzaki force-pushed the jz/base64_example branch from 8e7b198 to 7b21267 Compare January 15, 2025 15:29
@jzaki jzaki marked this pull request as ready for review January 30, 2025 18:50
@jzaki
Copy link
Contributor Author

jzaki commented Jan 30, 2025

What do you think about making the example more practical, in the sense that it would be something that someone would want to do in real life?

Added a point with some application context/idea.

@jzaki jzaki requested a review from critesjosh January 30, 2025 18:51

The lib covers several encode/decode tests, whereas this program has some extra code to facilitate benchmarking the gate counts of a proving backend. Comparisons can be made against other proving backends if desired.

Ordinarily base64 is used encode/decode binary data sent across the web (in html/css files), rather than the text strings shown here. So could be used to verify that a website sent a particular image by comparing to a local binary, with applications that could equate to digital watermarks.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting idea. just curious if you have ideas about when someone might want to do this in practice?

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.

Add base64 example using lib
2 participants