From 1e1bf38790fdd581d5b009f2f5c327f4e576891a Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Fri, 12 Sep 2025 09:39:20 +0100 Subject: [PATCH] docs: update hosted docs on CRISP --- docs/pages/CRISP/introduction.mdx | 11 ----------- docs/pages/CRISP/running-e3.mdx | 13 +++++++++++-- docs/pages/CRISP/setup.mdx | 8 +++++--- examples/CRISP/Readme.md | 3 ++- examples/CRISP/contracts/README.md | 3 ++- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/docs/pages/CRISP/introduction.mdx b/docs/pages/CRISP/introduction.mdx index b44d335e3e..769c4ad7fb 100644 --- a/docs/pages/CRISP/introduction.mdx +++ b/docs/pages/CRISP/introduction.mdx @@ -27,7 +27,6 @@ CRISP/ |── client/ # React frontend application |── server/ # Rust coordination server |── program/ # RISC Zero computation program -|── wasm-crypto/ # WebAssembly crypto utilities ├── contracts/ # Smart contracts (Solidity) ├── circuits/ # Noir circuits for ZK proofs ├── scripts/ # Development and utility scripts @@ -69,16 +68,6 @@ The core computation logic written in Rust for zkVM: --- -### **WebAssembly Crypto** (`/wasm-crypto`) - -High-performance cryptographic operations compiled to WebAssembly: - -- Client-side fully homomorphic encryption -- ZK Circuit input generation for Noir proofs -- Optimized for browser execution - ---- - ### **Smart Contracts** (`/contracts`) Solidity contracts implementing the E3 program interface: diff --git a/docs/pages/CRISP/running-e3.mdx b/docs/pages/CRISP/running-e3.mdx index 03d7c06b20..aa593a6fc5 100644 --- a/docs/pages/CRISP/running-e3.mdx +++ b/docs/pages/CRISP/running-e3.mdx @@ -69,12 +69,21 @@ The server will start and begin listening for blockchain events. Navigate to the program directory and start the program server: ```sh -cd examples/CRISP/program -cargo run +cd examples/CRISP/ +enclave program start ``` This runs the RISC Zero program server that handles secure computations. +If you would like to run the program server in dev mode, you can run the following command: + +```sh +cd examples/CRISP/ +enclave program start --dev true +``` + +In this case, Risc0 will not be used to generate proofs, and instead these will be mocked. + ### Initialize a New Voting Round **Terminal 6: CLI** diff --git a/docs/pages/CRISP/setup.mdx b/docs/pages/CRISP/setup.mdx index 00724d4a3d..453a0ab0a3 100644 --- a/docs/pages/CRISP/setup.mdx +++ b/docs/pages/CRISP/setup.mdx @@ -18,7 +18,7 @@ The setup includes the following: ## Quick Start with Docker (Recommended) -The fastest way to get CRISP running is using the Docker development environment: +The fastest way to get CRISP running is using the scripts provided in the `scripts/` directory: ```sh cd examples/CRISP @@ -60,7 +60,7 @@ Before getting started, ensure you have the following tools installed: - **Rust** (programming language and package manager) - **Foundry** (Ethereum development framework) -- **RISC Zero toolchain** (for RISC Zero program development) +- **RISC Zero toolchain** (for RISC Zero program development) - Note that you can also run the program server in dev mode which does not use Risc0. - **Node.js** (JavaScript runtime for client-side dependencies) - **Anvil** (local Ethereum node) - **Enclave CLI** (for managing ciphernodes) @@ -105,6 +105,8 @@ curl -L https://foundry.paradigm.xyz | bash ### Install RISC Zero Toolchain +> Optional: you can run CRISP in dev mode which does not use Risc0. + Next, install `rzup`, which provides the `cargo-risczero` toolchain. ```sh @@ -185,7 +187,7 @@ Keep this terminal open and running. Open a new terminal for the next steps. 4. Deploy the Enclave contracts on the local testnet: ```sh - rm -rf deployments/localhost + pnpm clean:deployments pnpm deploy:mocks --network localhost ``` diff --git a/examples/CRISP/Readme.md b/examples/CRISP/Readme.md index 8d096fd420..feb492f557 100644 --- a/examples/CRISP/Readme.md +++ b/examples/CRISP/Readme.md @@ -17,9 +17,10 @@ CRISP ## Development -To start the development environment, run the following commands: +To start the development environment, run the following commands from inside the CRISP directory: ```sh +pnpm install # install dependencies pnpm dev:setup # build the project pnpm dev:up # run the services ``` diff --git a/examples/CRISP/contracts/README.md b/examples/CRISP/contracts/README.md index df0d0838ee..dd099e3ada 100644 --- a/examples/CRISP/contracts/README.md +++ b/examples/CRISP/contracts/README.md @@ -18,5 +18,6 @@ It exposes two main functions: The input validator contract is used to validate the input data that is submitted to the E3 instance. It is called by the Enclave contract when a new input is published (`Enclave.publishInput`). In CRISP, the data providers (the ones submitting the inputs) are the voters, and the input submitted is the vote itself. -The validator will validate the input data by checking whether the gating conditions are satisifed (this uses Semaphore by default), and that the ciphertext is constructed correctly, using [Greco](https://github.com/gnosisguild/enclave/tree/main/packages/circuits/crates/libs/greco) ([link to paper(https://eprint.iacr.org/2024/594)]). +The validator checks that gating conditions are satisfied (uses [Semaphore](https://semaphore.pse.dev/) by default) and that the ciphertext is constructed correctly using [Greco](https://github.com/gnosisguild/enclave/tree/main/packages/circuits/crates/libs/greco). See the Greco [paper](https://eprint.iacr.org/2024/594). +