| Crates.io | privacy-cash |
| lib.rs | privacy-cash |
| version | 0.2.1 |
| created_at | 2026-01-16 04:39:36.560846+00 |
| updated_at | 2026-01-16 08:55:22.383053+00 |
| description | Pure Rust SDK for Privacy Cash - Privacy-preserving transactions on Solana using Zero-Knowledge Proofs. iOS compatible, no Node.js required. |
| homepage | https://nshield.org |
| repository | https://github.com/Nova-Shield/privacy-cash-rust-sdk |
| max_upload_size | |
| id | 2047905 |
| size | 2,019,190 |
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
send_privately() does everythingAdd to your Cargo.toml:
[dependencies]
privacy-cash = { git = "https://github.com/Nova-Shield/privacy-cash-rust-sdk" }
tokio = { version = "1", features = ["full"] }
Download the circuit files (~60MB total):
mkdir -p circuit
curl -L -o circuit/transaction2.wasm "https://privacy.cash/circuits/transaction2.wasm"
curl -L -o circuit/transaction2.zkey "https://privacy.cash/circuits/transaction2.zkey"
use privacy_cash::send_privately;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Send 0.1 SOL privately - ONE function does everything!
let result = send_privately(
"your_base58_private_key", // Private key
"recipient_pubkey", // Recipient address
0.1, // Amount to send
"sol", // Token: "sol", "usdc", "usdt"
None, // Optional RPC URL
).await?;
println!("Sent privately!");
println!("Deposit TX: {}", result.deposit_signature);
println!("Withdraw TX: {}", result.withdraw_signature);
println!("Recipient received: {} lamports", result.amount_received);
Ok(())
}
The send_privately() function automatically:
pub struct SendPrivatelyResult {
pub deposit_signature: String, // Deposit transaction
pub withdraw_signature: String, // Withdraw transaction
pub amount_deposited: u64, // Amount deposited
pub amount_received: u64, // Amount recipient received
pub total_fees: u64, // Total fees paid
pub recipient: String, // Recipient address
pub token: String, // Token type
}
| Token | Minimum | Fee |
|---|---|---|
| SOL | 0.02 SOL | ~0.006 SOL |
| USDC | 2 USDC | ~0.85 USDC |
| USDT | 2 USDT | ~0.85 USDT |
# Check balances
SOLANA_PRIVATE_KEY="your-key" cargo run --release --example check_balance
# Send 0.02 SOL privately
SOLANA_PRIVATE_KEY="your-key" cargo run --release --example send_privately -- 0.02 sol
# Send 10 USDC privately to a recipient
SOLANA_PRIVATE_KEY="your-key" cargo run --release --example send_privately -- 10 usdc RecipientPubkey
MIT License - Copyright 2026 Nova Shield