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

chore: add examples and readme updates from hc #7

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jzaki
Copy link
Contributor

@jzaki jzaki commented Sep 6, 2024

Description

Problem*

Related AztecProtocol/dev-rel#365

Summary*

Additional Context

PR Checklist*

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

@jzaki jzaki changed the title Jz/add examples hc chore: add examples and readme updates from hc Sep 6, 2024
@jzaki jzaki mentioned this pull request Sep 6, 2024
2 tasks
* main:
  fix: update to support noir 0.34.0 (#6)
  decoder now works for byte values that are 8 bits, not just 7 bits
Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

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

This is kind of unfortunate as moving the library out of the root of the repository and down into a subdir would be a breaking change.Is there a reason why these examples need to be binary packages and not just tests?

README.md Outdated Show resolved Hide resolved
Comment on lines +8 to +24
Prove it, for example with default backend Barretenberg:
```
bb prove -b ./target/example2.json -w ./target/base64.gz -o ./target/proof
```

To verify, we need to export the verification key:

```bash
bb write_vk -b ./target/example2.json -o ./target/vk
```

And verify:

```bash
bb verify -k ./target/vk -p ./target/proof
```
If verification passed, you see nothing. Otherwise there is an error.
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't include documentation on how to generate proofs on Noir libraries. We can centralize that into one place and then any library documentation should only teach how to interact with the library through Noir code.

Copy link
Member

Choose a reason for hiding this comment

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

These tests can be moved into the main library package (and we'll then get them tested in CI)

# Costs
See more examples in `lib.nr` and the `examples` folder.

## Conversion explainer
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

### `fn base64_encode`
Takees an input byte array of ASCII characters and produces an output byte array of base64-encoded characters. The 6-bit base64 characters are packed into a concatenated byte array (e.g. 4 bytes of ASCII produce 3 bytes of encoded Base64)
- Noir ≥v0.34.0
- Compatible version of a proving backend, eg Barretenberg
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove references to the backend here. If we push people towards the Nargo docs then that can teach them about the need for a proving backend.

We're going to get a lot of duplicated documentation which will fall out of sync otherwise.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not clear on what this example is showing over example1

@jzaki jzaki marked this pull request as draft September 19, 2024 12:25
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.

3 participants