CRISP (Collusion-Resistant Impartial Selection Protocol) is a secure protocol for digital decision-making, leveraging fully homomorphic encryption (FHE) and threshold cryptography to enable verifiable secret ballots; a critical component for democracies and many other decision-making applications.
Open ballots are known to produce suboptimal outcomes due to bribery and various forms of collusion. CRISP mitigates collusion and other vulnerabilities by ensuring ballots are secret and receipt-free, enabling a secure and impartial decision-making environment.
This application is a Proof of Concept (PoC), demonstrating the viability of Enclave as a network and CRISP as an application for secret ballots. For the sake of getting a demonstration of CRISP into the wild, this PoC application is not yet leveraging Enclave and omits several key components of CRISP. Future iterations of this and other applications will be progressively more complete
CRISP/packages
├── /client/
│ ├── /libs/wasm/pkg/ - WebAssembly library package
│ ├── /public/ - Static files
│ ├── /src/ - React components and source code
│ └── [configuration files and README]
├── /evm/ - Ethereum Virtual Machine related code
├── /rust/ - Rust server-side logic
└── /web-rust/ - Rust to WebAssembly logic
To set up the CRISP dApp in your local environment, follow these steps:
- Clone the repository:
git clone https://github.com/gnosisguild/CRISP.git
- Navigate to the
client
directory:cd CRISP/packages/client
- Install dependencies:
yarn install
- Start the development server:
yarn dev
Before running the Enclave server, you must have Rust installed on your machine along with the necessary environment variables set. Follow these steps to set up your environment:
-
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
This will install
rustup
, Rust's toolchain installer. Follow the on-screen instructions to complete the installation. -
Add the Rust toolchain to your system's PATH:
source $HOME/.cargo/env
Navigate to the enclave_server
directory and run the server with:
cargo run --bin enclave_server
Open 4 separate terminal windows for the various components.
-
In two terminals, start the cipher nodes by running:
cargo run --bin start_cipher_node
Wait for the
enclave_server
to be up and running before executing this command in each terminal. -
In the last terminal, run the CLI client:
cargo run --bin cli
Once the CLI client is running, you can interact with the CRISP voting protocol as follows:
-
Select the option
CRISP: Voting Protocol (ETH)
. -
To start a new CRISP round, select the option
Initialize new CRISP round
.
Ensure all components are running and communicating with each other properly before initializing a new round.
Remember to provide exact paths if the enclave_server
, start_cipher_node
, and cli
binaries are located in specific directories. If any specific configuration is needed in the environment files, make sure to outline what changes need to be made and where the files are located. It's also crucial to include any ports that need to be open or additional services that are required for the application to run correctly.
We welcome and encourage community contributions to this repo. Please make sure to read the CLA before contributing.
This repo is provided WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This repo created under the LGPL-3.0+ license.