Privacy Cash Rust SDK
Pure Rust SDK for Privacy Cash - Privacy-preserving transactions on Solana using Zero-Knowledge Proofs.
iOS Compatible - No Node.js required!
Created by Nova Shield
Features
- Private Transactions - Send SOL and SPL tokens with complete privacy
- Pure Rust ZK Proofs - Native Groth16 proof generation
- iOS Compatible - Use as a Rust crate in mobile apps
- Multi-Token Support - SOL, USDC, USDT
- One Function API -
send_privately()does everything
Installation
Add to your Cargo.toml:
[]
= { = "https://github.com/Nova-Shield/privacy-cash-rust-sdk" }
= { = "1", = ["full"] }
Circuit Files (Required)
Download the circuit files (~60MB total):
Quick Start - ONE Function!
use send_privately;
async
The send_privately() function automatically:
- Deposits your tokens into Privacy Cash
- Waits for blockchain confirmation
- Withdraws the maximum amount to the recipient
API
SendPrivatelyResult
Supported Tokens
| Token | Minimum | Fee |
|---|---|---|
| SOL | 0.02 SOL | ~0.006 SOL |
| USDC | 2 USDC | ~0.85 USDC |
| USDT | 2 USDT | ~0.85 USDT |
Examples
# Check balances
SOLANA_PRIVATE_KEY="your-key"
# Send 0.02 SOL privately
SOLANA_PRIVATE_KEY="your-key"
# Send 10 USDC privately to a recipient
SOLANA_PRIVATE_KEY="your-key"
Security
- Never hardcode private keys in your code
- Use environment variables or secure key management
- Private keys are used locally and never sent to any server
- All ZK proofs are generated client-side
License
MIT License - Copyright 2024 Nova Shield