Skip to main content

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

1

Download and install Solana CLI

Install version 2.1.18 or later:
2

Add Solana to your PATH

Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):
Then reload your shell:
3

Verify installation

You should see output like:
Privacy Cash requires Solana CLI 2.1.18 or later for compatibility with the latest program features.

Install Rust

1

Install Rust using rustup

Follow the prompts to complete installation.
2

Install Rust 1.79.0

Privacy Cash requires Rust 1.79.0 or a compatible version:
3

Verify Rust installation

You should see:

Install Anchor

1

Install Anchor version manager (avm)

2

Install Anchor 0.31.1

3

Verify Anchor installation

You should see:
Privacy Cash is built with Anchor 0.31.1. Using a different version may cause compilation errors.

Install Node.js and npm

1

Install Node.js 16 or later

Using nvm (recommended):
Or download directly from nodejs.org.
2

Verify Node.js and npm

You should see:

Install Circom

Circom is required to work with zero-knowledge circuits.
1

Install dependencies

2

Download and install Circom v2.2.2

3

Verify Circom installation

You should see:
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:
1

Clone the repository

2

Install npm dependencies

The project uses yarn as the package manager (configured in Anchor.toml):
Or if using npm:
This installs all required packages including:
  • @coral-xyz/anchor - Anchor framework client
  • @solana/spl-token - SPL token utilities
  • snarkjs - Zero-knowledge proof library
  • @lightprotocol/hasher.rs - Poseidon hash implementation
  • circomlib - Circuit library
3

Build the program

This compiles the Rust program and generates TypeScript types.

Verify installation

Run the test suite to ensure everything is working:
You should see output indicating tests are passing:
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:

Troubleshooting

Ensure you’re using Rust 1.79.0:
Clean and rebuild:
This package requires Rust to build native modules. Ensure you have:
  1. Rust installed and in your PATH
  2. Build tools installed (gcc, make, etc.)
On Ubuntu/Debian:
On macOS:
Tests generate zero-knowledge proofs which are CPU-intensive:
  1. Ensure you have at least 8GB RAM available
  2. Close other applications to free up CPU
  3. Increase the Mocha timeout in package.json if needed
The test script already sets a high timeout:
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