Devnet is the ideal environment for testing Privacy Cash before deploying to mainnet. This guide covers building, deploying, and initializing the program on devnet.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Privacy-Cash/privacy-cash/llms.txt
Use this file to discover all available pages before exploring further.
Program Information
- Network: Solana Devnet
- Program ID:
ATZj4jZ4FFzkvAcvk27DW9GRkgSbFnHo49fKKPQXU7VS - RPC Endpoint: Custom Helius endpoint (configured in scripts)
Build the Program
Build with Devnet Features
Build the program with devnet-specific features:Or build with verifiable flag:
Deploy to Devnet
You have multiple deployment options:Option 1: Using Anchor Deploy
Option 2: Verifiable Deployment
For transparency and auditability:Option 3: Using Solana CLI
Direct deployment with Solana CLI:Ensure your
deploy-keypair.json has sufficient SOL for deployment. You can request devnet SOL from the faucet:Initialize the Program
After deployment, initialize the program state.Initialize SOL Tree
Run the initialization script to set up the main SOL privacy pool:- Derives required PDAs (Program Derived Addresses)
- Creates the Merkle tree account for SOL deposits
- Initializes the global configuration
- Sets up the tree token account
- Tree Height: 26 (supports ~67M leaves)
- Root History Size: 100
- Fee Recipient:
DTqtRSGtGf414yvMPypCv2o1P8trwb9SJXibxLgAWYhw - Deposit Fee: 0% (free deposits)
- Withdrawal Fee: 0.25% (25 basis points)
Initialize SPL Token Tree
To enable privacy for SPL tokens (e.g., USDC), initialize a separate tree:- Creates a tree account specific to the SPL token mint
- Sets maximum deposit limits
- Configures token-specific parameters
- USDC Mint (Devnet):
4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU - Max Deposit: 100,000 USDC
Verify Initialization
After initialization, verify the accounts on Solana Explorer:Check SOL Tree Account
Verify PDAs
The initialization scripts output the derived PDA addresses:- Tree Account: Stores the Merkle tree state
- Tree Token Account: Holds deposited SOL/tokens
- Global Config: Stores program-wide configuration
Common Issues
Program Already Initialized
If you see:- Close existing accounts (if you have authority)
- Use a different program ID
- Continue with existing deployment
Insufficient Balance
RPC Errors
The scripts use Helius RPC endpoints. If you encounter rate limits, you can:- Use your own RPC endpoint
- Modify the connection URL in the scripts
- Add delays between transactions
Testing Your Deployment
Next Steps
Mainnet Deployment
Ready for production? Deploy to mainnet
Verification
Verify your build matches the deployment