The general idea of the Vibe Check app is to give people a SmileToken to reward them for smiling.
https://github.com/user-attachments/assets/b775d6b1-6ce0-4234-b74d-70979444b0a3
The step-by-step process:
This repo contains all you need to undertand how to bootstrap your first zkApp with Hylé. More docs about VibeCheck here
This zkApp is composed of 6 parts: 1) noir-webauthn
This part is in charge of the webauthn-ecdsa signature verification.
The aim of this is to compile noir code in a noir json that is then used to prove noir code from browser
This part is in charge of running the machine learning model that detect the smile.
The aim of this is to compile cairo code in a cairo json that is then used to run cairo code from browser.
This part is in charge of locally updating the state of the smile token.
The aim of this is to compile cairo code in a cairo json that is then used to run cairo code from browser.
4) cairo-runner
This part is in charge of running the Cairo programs. Its is heavily inspired from Lambdaclass's CairoVM with small changes that fit our needs. It is made to be potentially compiled in WASM for in-browser execution.
This part is in charge of proving the Cairo programs. Its is heavily inspired from Lambdaclass's Cairo prover with small changes that fit our needs. It is made to be potentially compiled in WASM for in-browser execution.
As proving is heavy in memory usage, we decided to wrap the prover in a http-server that runs the native binary instead of in-browser WASM. If you want to run it in WASM anyway, you'll need to update the frontend code a bit.
This part is in charge of the frontend that orchestrate the flow, through a userfriendly-ish UI.
You will need a local Hylé node, we recommand you go through the installation guide
cd cairo-proving-server
cargo build --release
./target/release/cairo-proving-server
We recommand you to use bun for running the frontend part.
cd vibe-check-frontend
bun install
bun run dev
The Vibe Check demo consists of three components: the app, the proof generators, and the Hylé node.
The app helps the user craft a transaction through 2 interactions:
The app sends these inputs to the proof generators.
The proof generators execute programs and generate proofs.
They can be run locally in the browser or remotely to maximize performance. Local proof generation is possible by compiling the Cairo VM/Cairo Prover/Noir Prover into WASM, but it is inefficient. Proving is a memory-consuming activity, and browsers usually have a low limit.
The proof generators generate three proofs:
The app sends the three proofs through one single transaction to the Hylé node.
The Hylé node:
A proving scheme is a protocol or framework for generating proofs and verifying them.
In Vibe Check, we use Noir and Cairo.
We use Noir to generate ECDSA proofs. Its Typescript SDK makes it easy to integrate into an app.
We use Cairo for two proofs:
We used the LambdaClass CairoVM. Because of the current dependency mismatches between the prover and the runner, the Cairo prover and the Cairo runner had to be compiled separately.
ZkML is one of ZK's many use cases. It helps you assert that a prediction's result was obtained with the right model, trained on the right dataset, and fed with the right input.
Giza focuses on helping developers create a provable machine-learning model.
Here is the flow we followed:
scarb
Deep learning models, especially CNNs, would typically be more appropriate for image recognition, but some primitives used by those are not yet supported. Larger models are also extremely hard to run in a Cairo VM because of their high memory requirements.
S/O to Lambdaclass team for their CairoVM and Cairo prover.
S/O to Aztec for Noir and tooling around it.
S/O to Giza for help and support around zmML and Cairo.