Deposit SOL
Deposit SOL into Privacy Cash
Deposit SOL
Deposit SOL into the Privacy Cash privacy pool.
Example
import { PrivacyCash } from 'privacycash';
const client = new PrivacyCash({
RPC_url: 'YOUR_SOLANA_MAINNET_RPC_URL',
owner: 'YOUR_PRIVATE_KEY'
});
async function depositSol() {
// Deposit 0.01 SOL
const depositRes = await client.deposit({
lamports: 0.01 * 1_000_000_000
});
console.log(depositRes);
// Check balance after deposit
const privateBalance = await client.getPrivateBalance();
console.log('Balance after deposit:', privateBalance.lamports / 1_000_000_000, 'SOL');
}
depositSol();
How it Works
- You deposit SOL into a shielded pool
- A cryptographic commitment is generated
- The commitment is added to a Merkle tree on-chain
- You can later withdraw to any address without linking transactions
Important
- Deposits are irreversible once confirmed
- Historical UTXOs are cached locally for faster performance