Overview
This guide covers installing all dependencies needed to build and run Privacy Cash from source. If you’re integrating Privacy Cash into an existing project, see the Privacy Cash SDK instead.System requirements
Operating system
RAM
Disk space
Internet
Install Solana CLI
Download and install Solana CLI
Add Solana to your PATH
~/.bashrc, ~/.zshrc, etc.):Verify installation
Install Rust
Install Rust using rustup
Install Rust 1.79.0
Verify Rust installation
Install Anchor
Install Anchor version manager (avm)
Install Anchor 0.31.1
Verify Anchor installation
Install Node.js and npm
Install Node.js 16 or later
Verify Node.js and npm
Install Circom
Circom is required to work with zero-knowledge circuits.Install dependencies
- Ubuntu/Debian
- macOS
Download and install Circom v2.2.2
Verify Circom installation
circuits/ directory. The compiled artifacts are already included in artifacts/circuits/, so you only need Circom if you’re modifying circuits.Install project dependencies
Once all system tools are installed, set up the Privacy Cash project:Clone the repository
Install npm dependencies
Anchor.toml):@coral-xyz/anchor- Anchor framework client@solana/spl-token- SPL token utilitiessnarkjs- Zero-knowledge proof library@lightprotocol/hasher.rs- Poseidon hash implementationcircomlib- Circuit library
Build the program
Verify installation
Run the test suite to ensure everything is working:Package versions
For reference, here are the exact package versions used by Privacy Cash:View package.json dependencies
View package.json dependencies
Troubleshooting
Anchor build fails with 'rustc version mismatch'
Anchor build fails with 'rustc version mismatch'
npm install fails on @lightprotocol/hasher.rs
npm install fails on @lightprotocol/hasher.rs
- Rust installed and in your PATH
- Build tools installed (gcc, make, etc.)
Tests timeout or fail
Tests timeout or fail
- Ensure you have at least 8GB RAM available
- Close other applications to free up CPU
- Increase the Mocha timeout in
package.jsonif needed
Solana CLI commands fail
Solana CLI commands fail