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

Update docs with adding a new halo2 circuit in 'mopro-wam' #292

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sifnoc
Copy link
Collaborator

@sifnoc sifnoc commented Jan 9, 2025

  • Added more item in prerequisite page
  • Describe how to add a new halo2 circuit implementation on mopro-wasm

Comment on lines 15 to +17
- [Android Studio](https://developer.android.com/studio)
- Also see [configuration](#android-configuration) below
- [JDK(Java Development Kit)](https://www.oracle.com/java/technologies/downloads)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can switch the order to

  • Android Studio
  • JDK
  • Also see configuration

because when a user see below, he will miss the JDK


Follow these steps to update and build the user-defined circuit implementation for Wasm:

1. **Update `Cargo.toml` in 'mopro-wasm'**
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the users should use mopro-wasm-lib (in mopro-example-app) instead of mopro-wasm in zkmopro.

Because in the future, the users don't need to clone the repo zkmopro/mopro and they can use CLI
(I think we should support mopro binary for users to use mopro CLI
like circom, they support binaries
so they don't need to clone the repo and use the binary)

Copy link
Collaborator

Choose a reason for hiding this comment

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

we should let users know how to generate bindings with rust setup
like in Flutter setup or React Native setup
(Just redirect them to rust setup and choose web as target)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the users should use mopro-wasm-lib (in mopro-example-app) instead of mopro-wasm in zkmopro.

For align consistancy with other setup doc, we should add create mopro-wasm-lib like "setup the rust project" in Rust setup and remove the "Proving from web browser" section :https://zkmopro.org/docs/setup/web-wasm-setup#proving-from-web-browser.
What do you think?

Because in the future, the users don't need to clone the repo zkmopro/mopro and they can use CLI (I think we should support mopro binary for users to use mopro CLI like circom, they support binaries so they don't need to clone the repo and use the binary)

I totally agree. but currently only simple doc "Getting Started" for about how to setup with the mopro cli.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For align consistancy with other setup doc, we should add create mopro-wasm-lib like "setup the rust project" in Rust setup and remove the "Proving from web browser" section :https://zkmopro.org/docs/setup/web-wasm-setup#proving-from-web-browser.
What do you think?

We should let user simply uses mopro init, mopro build for web
and he will find mopro-wasm-lib within the folder
(I realized that we should update react native setup and flutter setup, and guide them to look Getting Started section instead of Rust Setup section)
and yes we can remove the "Proving from web browser" section

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks good! I will update other setup docs that to rely on using mopro cli instead of starting with Rust Setup page.


2. **Create Wrapper Functions for Generate/Verify proof method**:

To compile Wasm code with the circuit, wrapper functions for generating and verifying proof methods in the user-defined circuit implementation must be created in `mopro-wasm/src/lib.rs`, using the example structure provided below:
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be mopro-wasm-lib/src/lib.rs too

The following command builds the wasm package in "mopro-wasm":

```shell
mopro-wasm $ wasm-pack build --target web --out-name my-halo2-circuit
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should also let users use mopro build 🙏🏻

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