Why Relayers?
Understanding how relayers preserve privacy during withdrawals
Why Relayers?
Section titled “Why Relayers?”The relayer is a critical component for maintaining privacy. Without it, withdrawals would leak information about the recipient.
The Problem: Gas Payment
Section titled “The Problem: Gas Payment”On Solana, every transaction requires the fee payer to:
- Sign the transaction
- Pay SOL for transaction fees
If you withdraw directly, your recipient address:
- Appears as the transaction signer
- Must have SOL to pay fees
- Creates an on-chain link between the withdrawal and your address
This defeats the purpose of private transfers - anyone can see that the withdrawal recipient signed the transaction.
The Solution: Relayer
Section titled “The Solution: Relayer”A relayer is a service that:
- Receives your signed withdrawal proof
- Submits the transaction on your behalf
- Pays the transaction fees
- Receives a small fee from the withdrawn amount
Now the transaction shows:
- Signer: Relayer’s address (not yours)
- Fee Payer: Relayer (not you)
- Recipient: Your address (just receives tokens, no signature required)
Privacy Guarantees
Section titled “Privacy Guarantees”| With Relayer | Without Relayer |
|---|---|
| Recipient appears as just a token receiver | Recipient appears as transaction signer |
| No SOL needed in recipient wallet | SOL required to pay fees |
| No on-chain link to your signing key | Direct link to your key |
How the Relayer Works
Section titled “How the Relayer Works”- You generate a ZK proof proving you can withdraw
- You specify the recipient address in the proof
- Relayer verifies the proof is valid
- Relayer submits the transaction, paying gas
- Program verifies the proof on-chain
- Tokens transfer to your specified recipient
- Relayer fee is deducted from withdrawn amount
Trust Model
Section titled “Trust Model”Relayer Fees
Section titled “Relayer Fees”The relayer deducts a fee from the withdrawn amount to cover:
- Solana transaction fees
- Service operation costs
- Profit margin
See the Fee Structure page for current fee rates.
Using the Relayer API
Section titled “Using the Relayer API”The Turbine.cash relayer exposes two endpoints:
| Endpoint | Purpose |
|---|---|
POST /relay | Withdraw tokens to any address |
POST /relay_swap | Withdraw and swap via Jupiter |
See the API Reference for detailed documentation.
Next Steps
Section titled “Next Steps”- Learn about OFAC Compliance
- Implement a Withdrawal
- Implement Withdraw with Swap