SOL vs USDC Payments
Use SOL when:- You want to accept Solana’s native currency
- You’re building applications that work with SOL directly
- You want to simplify payment flows (no token accounts needed)
- Your use case doesn’t require stablecoin payments
- You need stable value (not affected by SOL price volatility)
- You’re building payment systems that require price stability
- You’re integrating with traditional payment systems
Full Example
Step-by-Step Breakdown
1. Load Keypair
2. Create Wallet
3. Create Payment Handler (No Mint)
createPaymentHandler is called without a mint parameter. When no mint is provided, the handler uses native SOL for payments.
4. Make Payment
SOL vs Token Payments
- SOL: No token accounts needed, simpler setup, but price volatility
- USDC: Requires token accounts, stable value, but more complex setup
SOL Payment Details
When paying with SOL:- Transactions transfer lamports (1 SOL = 1,000,000,000 lamports)
- No associated token accounts needed
- Uses
SystemProgram.transferinstruction - Payment amounts are specified in lamports
Environment Variables
PAYER_KEYPAIR_PATH: Path to your Solana keypair JSON file
Funding Your Wallet
Make sure your wallet has sufficient SOL for:- Payment amount (specified by the merchant)
- Transaction fees (~0.000005 SOL per transaction)
Related Resources
- Solana Exact Payment - USDC token payment example
- Token Payment - Custom SPL token payment
- Solana Documentation - SOL and lamports information