Skip to content

Latest commit

 

History

History
62 lines (38 loc) · 1.86 KB

File metadata and controls

62 lines (38 loc) · 1.86 KB

Halo2

Prerequisites

WASM pack

Ensure you have wasm-pack installed:

curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

Build the prover

Clone the W3bstream repository

Start by cloning the W3bstream repository, where you can start from a template example:

git clone https://github.com/iotexproject/w3bstream.git
cd examples/halo2-circuit/

Open the folder in a code editor and make the required modifications based on your actual data message.

Build the circuit

wasm-pack build --target nodejs --out-dir pkg

{% hint style="info" %} -> Go to the official Halo2 documentation to learn how to build Halo2 circuits {% endhint %}

The circuit bytecode is saved in the file halo2_wasm_bg.wasm located under the pkg folder.

{% hint style="success" %} -> Go to the Create a W3bstream Project section to create a W3bstream configuration file based on this circuit {% endhint %}

Build the circuit executable

The command below will create thasdfwefe circuit executable that can be used to generate and verify proofs locally, as well as generate the Solidity contract for on-chain verification of a proof:

cargo build --release
-> Go to the Create a W3bstream Project section to create a W3bstream configuration file based on this prover
→ See the On-chain Verification section to learn how to verify Risc Zero proofs

{% hint style="success" %}

{% endhint %}

{% hint style="success" %}

{% endhint %}