Skip to main content

Deposit SOL (Shield)

Deposit SOL into the privacy pool by creating a commitment and inserting it into the Merkle tree.

Complete Deposit Example

Based on ~/workspace/source/anchor/tests/sol_tests.ts:677-916:
Store the output UTXOs and their encrypted data securely. You’ll need them to withdraw funds later.

Withdraw SOL (Unshield)

Withdraw SOL from the privacy pool to any recipient address.

Complete Withdrawal Example

Based on ~/workspace/source/anchor/tests/sol_tests.ts:918-1103:

Deposit SPL Tokens

Deposit SPL tokens (like USDC) into the privacy pool.

SPL Token Deposit Example

Based on ~/workspace/source/anchor/tests/spl_tests.ts:896-1131:
SPL tokens require separate Merkle trees per mint. You cannot withdraw USDC using a SOL deposit UTXO.

Complete Transaction Cycle

Full cycle: deposit, wait, then withdraw to break the link.

Error Handling

Next Steps

API Reference

Explore detailed API documentation

Advanced Usage

Learn advanced integration patterns