Overview
This guide covers Solana-specific implementation details for delegating wallets. Solana uses a different delegation model than EVM chains, leveraging SPL Token’s built-in delegation functionality.Use the
/v1/delegation/solana/post-approval endpoint for Solana delegations.Solana Network
Network Name: Solana Mainnet Beta Currencies: USDC, USDT Block Explorer: https://explorer.solana.com RPC URL: https://api.mainnet-beta.solana.com Advantages:- Extremely low transaction fees (~$0.00025 per transaction)
- Fast block times (~400ms)
- High throughput (65,000+ TPS capability)
- No gas price fluctuations
SPL Token Delegation Model
Unlike EVM’s ERC20 approval pattern, Solana uses SPL Token’s native delegation system.How It Works
1
User Has Token Account
User has an Associated Token Account (ATA) for their USDC/USDT
2
Approve Delegate
User calls SPL Token’s
Approve instruction, setting a delegate with spending limit3
Delegate Can Transfer
Platform’s delegate address can call
Transfer on behalf of the user, up to approved amount4
Allowance Decreases
Each transfer decreases the delegated amount automatically
Key Differences from EVM
| Aspect | EVM (ERC20) | Solana (SPL Token) |
|---|---|---|
| Approval Target | Smart contract address | Delegate public key |
| Account Model | Single wallet address | Token accounts per token |
| Delegation Storage | Token contract state | Token account data |
| Fee Model | Variable gas | Fixed ~0.000005 SOL |
| Confirmation Time | 12-15 seconds (Ethereum), 2-3 seconds (Linea) | ~400ms |
Implementation
Prerequisites
Install required packages:Token Mint Addresses
Complete Solana Delegation Flow
Wallet Adapter Setup
Set up Solana wallet adapter to support multiple wallets:Message Signing
Solana uses Ed25519 signatures instead of ECDSA (used by EVM chains).Sign Message
Check Token Account
Before delegation, verify user has the required token account:Submit to API
After collecting all data, submit to the Solana-specific endpoint:API Request
POST /v1/delegation/solana/post-approval
Validation Rules
The API performs strict Solana-specific validation:Address Format
Address Format
- Base58-encoded string
- Typically 32-44 characters
- Must be a valid Solana public key
- Case-sensitive
DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK
Invalid: 0xDYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK (has 0x prefix)Transaction Signature
Transaction Signature
- Base58-encoded string
- Typically 87-88 characters
- Must be a confirmed transaction on Solana mainnet
- Case-sensitive
5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUWMessage Signature
Message Signature
- Base64-encoded Ed25519 signature
- Must verify against the provided address and message
- Generated from
signMessage()wallet adapter method
Message
Message
- Any string that was signed by the wallet
- Commonly:
"Prove wallet ownership for delegation" - Must match exactly what was signed
Error Handling
Common Solana Errors
API Error Responses
| Status | Error | Cause | Solution |
|---|---|---|---|
| 400 | Invalid address format | Address not valid base58 | Ensure valid Solana public key |
| 400 | Invalid transaction signature | Transaction not found or invalid format | Wait for confirmation, check signature |
| 400 | Invalid message signature | Signature doesn’t verify | Re-sign message with correct wallet |
| 400 | Expired token | Delegation token expired | Generate new token from Step 1 |
| 429 | Rate limited | Too many requests | Wait and retry with exponential backoff |
Testing
Test on Devnet
Before going to production, test on Solana devnet:- Solana Devnet Faucet: https://faucet.solana.com
- Use SPL Token Faucet on devnet
- Or airdrop test tokens
Performance Optimization
Transaction Confirmation Strategies
Priority Fees
For faster processing during network congestion:Wallet Support
Supported Solana Wallets
Phantom
Most popular Solana wallet with excellent mobile and browser support
Solflare
Full-featured wallet with hardware wallet support
Backpack
Modern wallet with built-in xNFT app store
