Docs/Getting Started

Getting Started

Quick start guide to using ZKMix for private transactions

Getting Started

This guide walks you through making your first private transaction with ZKMix. By the end, you will have deposited funds into a privacy pool and withdrawn them to a separate, unlinkable address.

Prerequisites

Before using ZKMix, make sure you have the following:

A Solana Wallet

You need a Solana-compatible wallet that supports dApp connections. ZKMix supports the following wallets:

  • Phantom (recommended for most users)
  • Solflare
  • Backpack
  • Ledger (via Phantom or Solflare)

If you do not have a Solana wallet, install Phantom from phantom.app and follow the setup instructions. Write down your seed phrase and store it securely.

SOL for Transaction Fees

You need a small amount of SOL to pay Solana network fees. Each deposit transaction costs approximately 0.001 SOL in network fees. If you are using a relayer for withdrawals, you do not need SOL in the recipient wallet.

Funds to Deposit

ZKMix uses fixed-denomination pools. You will need at least the denomination amount in your wallet. Current pools include:

TokenDenominations
SOL1, 10, 100 SOL
USDC100, 1,000, 10,000 USDC
USDT100, 1,000, 10,000 USDT

Choose a denomination that matches your needs. Larger denominations tend to have smaller anonymity sets because fewer people use them. Smaller denominations require multiple deposits to mix larger amounts but benefit from larger anonymity sets.

Connecting Your Wallet

  1. Navigate to the ZKMix application at app.zkmix.io.
  2. Click Connect Wallet in the top right corner.
  3. Select your wallet provider from the list.
  4. Approve the connection request in your wallet popup.

ZKMix never requests permission to sign transactions automatically. Every transaction requires your explicit approval in the wallet.

Choosing a Pool

After connecting your wallet, the main interface displays the available mixing pools. Each pool shows:

  • Token: The asset type (SOL, USDC, etc.).
  • Denomination: The fixed deposit/withdrawal amount.
  • Anonymity Set: The number of deposits in the pool. A larger anonymity set means stronger privacy.
  • 24h Activity: The number of deposits and withdrawals in the last 24 hours. Active pools provide better privacy because your transactions blend in with more activity.

Select a pool by clicking on it. As a general rule, choose the pool with the largest anonymity set for your desired token and denomination.

Making Your First Deposit

Step 1: Generate a Note

After selecting a pool, click Deposit. The application generates a cryptographic note containing your secret and nullifier. This happens entirely in your browser; nothing is sent to any server.

You will see a note that looks like this:

zkmix-sol-1.0-4KjR8mVx2nBqP7FdLzEwYT5hA9uCc3GkW...

Step 2: Save Your Note

This is the most important step. The note is the only way to withdraw your funds. If you lose it, your funds are locked permanently and cannot be recovered by anyone.

Save the note using one or more of these methods:

  • Copy to clipboard and paste it into an encrypted password manager (recommended).
  • Download as a file using the "Download Note" button and store the file in a secure, backed-up location.
  • Write it down on paper and store it physically.

Do not store the note in plain text on your computer, in a cloud document, or in a chat message. Treat it with the same security as a private key.

Step 3: Confirm the Deposit

After saving your note, check the confirmation checkbox to acknowledge that you have stored your note securely. Then click Confirm Deposit.

Your wallet will prompt you to approve the transaction. Review the details:

  • The amount matches the pool denomination.
  • The destination is the ZKMix program address.

Approve the transaction. Once it confirms on-chain (typically within 1-2 seconds), your deposit is complete. The commitment derived from your note has been inserted into the pool's Merkle tree.

Step 4: Verify the Deposit

After confirmation, the interface shows your deposit status with the leaf index and transaction signature. You can verify the deposit on a Solana block explorer if you wish, but note that doing so from the same browser session could create a linkage in browser history.

Waiting for Privacy

After depositing, do not withdraw immediately. Your privacy depends on other deposits occurring after yours. The interface shows the current anonymity set size and provides a recommendation for when privacy is sufficient.

Guidelines for waiting:

  • Minimum: Wait for at least 10-20 additional deposits in the pool.
  • Good privacy: Wait for 100+ additional deposits.
  • Strong privacy: Wait for 500+ additional deposits or at least 24 hours in an active pool.

You do not need to keep the application open while waiting. Your note contains all the information needed to withdraw at any time in the future.

Making Your First Withdrawal

Step 1: Open the Withdraw Tab

Navigate to the Withdraw tab in the ZKMix interface. You do not need to be connected with the same wallet you used for the deposit. In fact, it is better to use a different browser session or device to avoid browser-level linkability.

Step 2: Enter Your Note

Paste or type your note into the note field. The application parses the note, extracts the secret and nullifier, and verifies that the corresponding commitment exists in the pool's Merkle tree.

If the commitment is found, the interface displays:

  • The pool denomination and token.
  • The current anonymity set size.
  • Whether the deposit has already been withdrawn (spent).

Step 3: Enter the Recipient Address

Enter the Solana address where you want to receive the funds. This should be an address that has no prior connection to your deposit address.

Tips for recipient addresses:

  • Use a freshly generated wallet address that has never received funds from your deposit wallet.
  • Do not reuse recipient addresses across multiple withdrawals, as this clusters them.
  • If the recipient wallet has no SOL for fees, use a relayer (see below).

Step 4: Generate the Proof

Click Generate Proof. The application constructs the ZK witness (Merkle path, secret, nullifier) and generates a Groth16 proof entirely in your browser using WebAssembly.

Proof generation typically takes:

  • Modern desktop: 5-10 seconds
  • Laptop: 10-20 seconds
  • Mobile device: 20-45 seconds

During this time, your browser performs intensive computation. Do not close the tab.

Step 5: Submit the Withdrawal

Once the proof is generated, click Withdraw. If you are connected with the recipient wallet, the transaction is submitted directly. If you are using a relayer, the proof is sent to the relayer, which submits it on your behalf.

The on-chain program verifies the proof, checks the nullifier has not been spent, and transfers the denomination amount to your recipient address.

Using Relayers

A relayer is a third-party service that submits your withdrawal transaction and pays the network fee on your behalf. This is essential when your recipient wallet has no SOL to pay fees, which is the common case for fresh wallets.

How Relayers Work

  1. You generate your ZK proof locally as usual.
  2. Instead of submitting the transaction yourself, you send the proof to a relayer.
  3. The relayer submits the transaction on-chain and pays the network fee.
  4. The smart contract sends the denomination amount minus the relayer fee to your recipient, and the relayer fee to the relayer.

The relayer never learns which deposit you are withdrawing. It only sees the proof, the nullifier hash, and the recipient address, which is the same information that becomes public on-chain anyway.

Selecting a Relayer

The ZKMix interface provides a list of available relayers with their:

  • Fee: The percentage or flat fee deducted from your withdrawal. Typical fees range from 0.1% to 0.5%.
  • Reliability: The historical uptime and success rate of the relayer.
  • Speed: The average time between receiving a proof and submitting the transaction.

Select a relayer from the list, or enter a custom relayer URL if you are running your own.

Running Your Own Relayer

For maximum trust minimization, you can run your own relayer. The ZKMix relayer software is open source. Running your own relayer means you do not need to trust a third party to submit your transaction, and you do not pay a relayer fee. See the Relayer documentation for setup instructions.

Security Best Practices

Note Management

  • Store notes in an encrypted password manager.
  • Create backups in a physically separate location.
  • Never share notes with anyone.
  • Delete notes after a successful withdrawal.

Operational Security

  • Use a different browser or browser profile for deposits and withdrawals.
  • Consider using a VPN or Tor to prevent your IP address from being correlated across deposit and withdrawal transactions.
  • Avoid depositing and withdrawing at predictable intervals.
  • Do not deposit and withdraw the same total amount across multiple pools in quick succession.

What Not to Do

  • Do not withdraw immediately after depositing.
  • Do not deposit from address A and withdraw to an address that has transacted with A before.
  • Do not announce on social media that you are using ZKMix with specific amounts or timing.
  • Do not deposit an unusual number of times in quick succession, as the burst pattern is itself identifying.

Troubleshooting

"Commitment not found"

The note you entered does not match any commitment in the selected pool. Verify that you are on the correct network (mainnet vs. devnet) and have selected the right pool denomination and token.

"Note has already been spent"

The nullifier hash from your note has already been submitted to the contract. This means a withdrawal using this note has already been processed. Each note can only be used once.

Proof generation is slow

Proof generation is CPU-intensive. Close other tabs and applications to free up resources. On mobile devices, keep the screen active during proof generation to prevent the browser from throttling the computation.

Transaction failed

If the withdrawal transaction fails on-chain, the most common causes are:

  • The Merkle root has changed since you generated the proof (new deposits occurred). Regenerate the proof and try again.
  • Insufficient SOL in the submitting wallet for the transaction fee. Use a relayer instead.
  • Network congestion. Retry with a higher priority fee.

Next Steps

  • Read How ZKMix Works to understand the cryptography behind the protocol.
  • Check the FAQ for answers to common questions.
  • Review the Glossary for definitions of technical terms.