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
Linux, macOS, or Windows with WSL2
RAM
8GB minimum, 16GB recommended
Disk space
At least 10GB free space
Internet
Required for downloading dependencies
Install Solana CLI
Add Solana to your PATH
Add this to your shell profile (Then reload your shell:
~/.bashrc, ~/.zshrc, etc.):Privacy Cash requires Solana CLI 2.1.18 or later for compatibility with the latest program features.
Install Rust
Install Anchor
Install Node.js and npm
Install Node.js 16 or later
Install Circom
Circom is required to work with zero-knowledge circuits.Circom is used to compile the zero-knowledge circuits in the
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:Install npm dependencies
The project uses yarn as the package manager (configured in Or if using npm:This installs all required packages including:
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
Verify installation
Run the test suite to ensure everything is working:The first test run may take longer as it compiles the circuits and generates proving keys.
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'
Ensure you’re using Rust 1.79.0:Clean and rebuild:
npm install fails on @lightprotocol/hasher.rs
npm install fails on @lightprotocol/hasher.rs
This package requires Rust to build native modules. Ensure you have:On macOS:
- Rust installed and in your PATH
- Build tools installed (gcc, make, etc.)
Tests timeout or fail
Tests timeout or fail
Tests generate zero-knowledge proofs which are CPU-intensive:
- 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
Ensure Solana is in your PATH:If not found, add to your shell profile:
Next steps
Quick start guide
Build and test Privacy Cash
Introduction
Learn how Privacy Cash works
Privacy Cash SDK
Integrate into your project
GitHub Issues
Get help or report problems