Withdraw ETH
Withdraw ETH from your private balance to any recipient address on Base.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
withdrawAmountInput | number | Yes | Total amount in ETH to withdraw (fees are deducted from this) |
recipient | string | Yes | EVM address to receive the funds |
keyBasePath | string | Yes | Base path to the circuit zkey file (without extension) |
signature | string | Yes | Wallet signature of the Privacy Cash sign-in message |
address | string | Yes | The withdrawer’s EVM wallet address |
Returns
The transaction hash (string).
Example
Withdrawal Fees
Fees are deducted from thewithdrawAmountInput, so the recipient receives less than the requested amount.
| Component | Amount |
|---|---|
| Flat fee | 0.00025 ETH per withdrawal |
| Protocol fee | 0.35% of withdrawal amount |
Fee Calculation Example
How Withdrawals Work
UTXO Selection
The SDK scans on-chain events to find your unspent UTXOs (up to 2) to cover the withdrawal amount.
ZK Proof Generation
A zero-knowledge proof is generated proving you own the funds and authorizing the exact recipient and amount.
On-Chain Submission
The transaction is submitted directly to the Base smart contract. No relayer is needed for Base withdrawals.
Privacy Guarantee
The withdrawal transaction on-chain contains no information about the original depositor. The zero-knowledge proof ensures:- The recipient address cannot be modified
- The amount cannot be modified
- Any tampering causes the transaction to revert
Insufficient Balance
If your private balance is less thanwithdrawAmountInput, the SDK throws:
getBalance().