Skip to content
Launch App >

Before integrating with Turbine.cash private transfers, ensure you have the following:

Terminal window
npm install @solana/web3.js @coral-xyz/anchor
npm install [PLACEHOLDER: POSEIDON_NPM_PACKAGE]
PackagePurpose
@solana/web3.jsSolana blockchain interaction
@coral-xyz/anchorAnchor program client
[PLACEHOLDER: POSEIDON_NPM_PACKAGE]Poseidon hash function for commitments

For browser-based applications:

  • Wallet adapter: Use @solana/wallet-adapter-react or similar
  • Crypto: Browser-native crypto.getRandomValues() for secure randomness

You should be familiar with:

  • Solana transactions and instructions
  • PDAs (Program Derived Addresses)
  • Token accounts (SPL Token program)
  • Anchor IDL and client generation

The Turbine.cash API requires authentication:

  1. Wallet signature: Sign a message with your wallet
  2. Auth token: Receive a JWT-like token for subsequent requests
  3. Headers: Include the token in x-api-auth header

See Authentication for the full flow.

Your application MUST securely store:

DataPurposeConsequences if Lost
nullifier32-byte random valueCannot withdraw funds
secret32-byte random valueCannot withdraw funds
leafIndexPosition in Merkle treeCannot generate proof

You’ll interact with:

ServicePurpose
Solana RPCSending deposit transactions
Turbine.cash APIRelayer, indexer, authentication

The Turbine.cash API supports CORS for browser applications. No proxy required.

For local development:

Terminal window
# Clone your project
git clone your-project
# Install dependencies
npm install
# Set environment variables
export SOLANA_NETWORK=devnet
export TURBINE_API_URL=https://worker.turbine.cash

We recommend TypeScript for type safety:

interface DepositSecrets {
nullifier: Uint8Array; // 32 bytes
secret: Uint8Array; // 32 bytes
commitment: Uint8Array; // 32 bytes
leafIndex: number;
}
interface WithdrawParams {
nullifierHash: Uint8Array;
proof: Uint8Array;
root: Uint8Array;
recipient: string;
}
  1. Configure Network Settings
  2. Implement Authentication
  3. Build Your First Deposit