| Crates.io | privacy-cash-sdk |
| lib.rs | privacy-cash-sdk |
| version | 0.1.0 |
| created_at | 2026-01-16 05:43:05.587368+00 |
| updated_at | 2026-01-16 05:43:05.587368+00 |
| description | Rust SDK for Privacy Cash - Privacy-preserving transactions on Solana using Zero-Knowledge Proofs. Created by Nova Shield. |
| homepage | https://nshield.org |
| repository | https://github.com/NovaShieldWallet/privacy-cash-rust-sdk |
| max_upload_size | |
| id | 2047961 |
| size | 509,238 |
Rust SDK for Privacy Cash - Privacy-preserving transactions on Solana using Zero-Knowledge Proofs.
Created by Nova Shield
send_privately() for privacy transfersAdd to your Cargo.toml:
[dependencies]
privacy-cash-sdk = "0.1"
Node.js is required for ZK proof generation:
# Install Node.js (if not installed)
# macOS: brew install node
# Ubuntu: apt install nodejs npm
# Install TypeScript bridge dependencies
cd path/to/privacy-cash-rust-sdk/ts-bridge
npm install
The main function for privacy transfers:
use privacy_cash::bridge::send_privately;
fn main() {
// Send 0.01 SOL privately
let result = send_privately(
"https://api.mainnet-beta.solana.com",
"your_private_key_base58",
10_000_000, // 0.01 SOL in lamports
"recipient_pubkey_base58",
).unwrap();
println!("Deposit TX: {}", result.deposit_signature);
println!("Withdraw TX: {}", result.withdraw_signature);
}
This single function:
use privacy_cash::bridge::{send_privately, send_privately_spl};
// Send SOL privately
let result = send_privately(rpc_url, private_key, lamports, recipient)?;
// Send SPL tokens privately (e.g., USDC)
let usdc_mint = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
let result = send_privately_spl(rpc_url, private_key, base_units, usdc_mint, recipient)?;
use privacy_cash::bridge::{ts_get_balance, ts_get_balance_spl};
// Get private SOL balance
let balance = ts_get_balance(rpc_url, private_key)?;
println!("Private SOL: {} lamports", balance.lamports);
// Get private USDC balance
let usdc_mint = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
let balance = ts_get_balance_spl(rpc_url, private_key, usdc_mint)?;
println!("Private USDC: {} base units", balance.base_units);
use privacy_cash::bridge::{
ts_deposit, ts_withdraw, ts_withdraw_all,
ts_deposit_spl, ts_withdraw_spl, ts_withdraw_all_spl,
};
// Deposit SOL
let result = ts_deposit(rpc_url, private_key, lamports)?;
// Withdraw SOL
let result = ts_withdraw(rpc_url, private_key, lamports, Some(recipient))?;
// Withdraw ALL private SOL
let result = ts_withdraw_all(rpc_url, private_key, None)?;
// SPL tokens
let result = ts_deposit_spl(rpc_url, private_key, base_units, mint)?;
let result = ts_withdraw_spl(rpc_url, private_key, base_units, mint, recipient)?;
let result = ts_withdraw_all_spl(rpc_url, private_key, mint, recipient)?;
SOLANA_PRIVATE_KEY="your-key" cargo run --example send_privately
SOLANA_PRIVATE_KEY="your-key" cargo run --example send_privately -- 0.01 RecipientPubkey
SOLANA_PRIVATE_KEY="your-key" cargo run --example withdraw_all_bridge
Tokens are fetched dynamically from the Privacy Cash API:
| Token | Minimum Withdrawal | Rent Fee |
|---|---|---|
| SOL | 0.01 SOL | ~0.006 SOL |
| USDC | 2 USDC | ~0.85 USDC |
| USDT | 2 USDT | ~0.85 USDT |
| ZEC | 0.01 ZEC | ~0.002 ZEC |
| ORE | 0.02 ORE | ~0.007 ORE |
| STORE | 0.02 STORE | ~0.007 STORE |
New tokens are automatically supported when Privacy Cash adds them.
⚠️ IMPORTANT:
┌─────────────────────────────────────────────────────────────┐
│ Your Rust Application │
├─────────────────────────────────────────────────────────────┤
│ privacy-cash (Rust crate) │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ bridge module │ │
│ │ send_privately() → ts_deposit() → ts_withdraw() │ │
│ └──────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ ts-bridge/ (TypeScript CLI) │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ privacy-cash-sdk (npm) + ZK proof generation │ │
│ └──────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Privacy Cash Protocol │
│ (Solana on-chain) │
└─────────────────────────────────────────────────────────────┘
MIT License - Copyright © 2026 Nova Shield
See LICENSE for details.