Network Configuration
Program addresses and API endpoints for mainnet and devnet
Network Configuration
Section titled “Network Configuration”This page lists all the addresses and endpoints you need to integrate with Turbine.cash.
Program ID
Section titled “Program ID”The zklsol program is deployed at the same address on all networks:
FGKoWNsvTTDCGW9JyR2DJWNzSXpejWk7yXcKsFFj9GQpAPI Endpoints
Section titled “API Endpoints”| Network | Base URL |
|---|---|
| Mainnet | https://worker.turbine.cash |
| Devnet | https://api-devnet.turbine.cash |
Merkle Tree Addresses
Section titled “Merkle Tree Addresses”Merkle trees are PDAs derived from:
seeds = ["Merkle", mint, depth]Mainnet
Section titled “Mainnet”| Token | Mint | Merkle Tree Address |
|---|---|---|
| [PLACEHOLDER: MAINNET_MERKLE_ADDRESS] |
Devnet
Section titled “Devnet”| Token | Mint | Merkle Tree Address |
|---|---|---|
| [PLACEHOLDER: DEVNET_MERKLE_ADDRESS] |
PDA Seeds Reference
Section titled “PDA Seeds Reference”| PDA | Seeds |
|---|---|
| Settings | ["Settings"] |
| Merkle | ["Merkle", mint, depth] |
| MerkleZeros | ["MerkleZeros", mint, depth] |
| MerkleToken | ["MerkleToken", mint, depth] |
| MerkleNode | ["MerkleNode", mint, depth, index] |
| NullifierHash | ["NullifierHash", mint, depth, nullifier_hash] |
| FeeCollector | ["FeeCollector"] |
| Affiliate | ["Affiliate", affiliate_code] |
TypeScript Configuration
Section titled “TypeScript Configuration”import { PublicKey } from '@solana/web3.js';
const PROGRAM_ID = new PublicKey('FGKoWNsvTTDCGW9JyR2DJWNzSXpejWk7yXcKsFFj9GQp');
const CONFIG = { mainnet: { apiUrl: 'https://worker.turbine.cash', rpcUrl: 'https://api.mainnet-beta.solana.com', programId: PROGRAM_ID, }, devnet: { apiUrl: 'https://api-devnet.turbine.cash', rpcUrl: 'https://api.devnet.solana.com', programId: PROGRAM_ID, },};
// Derive Merkle tree PDAfunction getMerkleAddress(mint: PublicKey, depth: number): PublicKey { const [address] = PublicKey.findProgramAddressSync( [ Buffer.from('Merkle'), mint.toBuffer(), Buffer.from([depth]), ], PROGRAM_ID ); return address;}
// Derive nullifier hash PDAfunction getNullifierHashAddress( mint: PublicKey, depth: number, nullifierHash: Uint8Array): PublicKey { const [address] = PublicKey.findProgramAddressSync( [ Buffer.from('NullifierHash'), mint.toBuffer(), Buffer.from([depth]), nullifierHash, ], PROGRAM_ID ); return address;}Depth Configuration
Section titled “Depth Configuration”The protocol uses depth 32 Merkle trees exclusively:
const MERKLE_DEPTH = 32;
// Maximum deposits per treeconst MAX_DEPOSITS = 2 ** 32; // ~4.3 billionRPC Recommendations
Section titled “RPC Recommendations”For production applications:
| Provider | Notes |
|---|---|
| Helius | Recommended for mainnet |
| QuickNode | Good alternative |
| Triton | Budget-friendly option |
| Public RPC | Only for testing (rate limited) |
// Example with Heliusconst connection = new Connection( 'https://mainnet.helius-rpc.com/?api-key=YOUR_KEY', 'confirmed');