Skip to main content
Gas sponsorship lets users transact without holding a chain’s native gas token. For example, a user holding only USDC can send funds, withdraw collateral, or approve a spender without first acquiring ETH or another native token. Gas sponsorship is enabled by default for Rain embedded wallets on supported chains. Rain’s wallet infrastructure pays the network fee on the user’s behalf.

What’s sponsored

Gas sponsorship applies to transactions broadcast by Rain embedded wallets on supported chains, including:
  • Native asset transfers
  • Token transfers
  • Collateral withdrawals
  • Token approvals
Sponsorship is configured by chain. If a chain supports outbound transactions, Rain sponsors the network fee for transactions initiated by the embedded wallet. See Blockchain support. Mainnet gas fees are real network costs that Rain pays on behalf of your program. How those costs are billed depends on your program agreement. Testnet gas sponsorship does not incur a charge to your program.

Configure gas sponsorship

Gas sponsorship is configured when you initialize the wallet provider.
When sponsorGas is disabled, transactions behave like a standard self paid wallet. The SDK checks the user’s native token balance against the transaction amount and network fee. If the balance is insufficient, it returns RAIN_402 with insufficientFunds. The user’s native token balance is reduced by the network fee for each successful transaction.

How sponsored transactions behave

Sponsored transactions differ from self paid transactions in two ways that can affect your UI. Failures surface after signing, not before. Self paid transactions are simulated on the device before signing. Sponsored transactions skip this simulation because a wallet with no native token balance would otherwise fail before sponsorship is applied. As a result, some failures surface only after the signed transaction reaches Rain’s wallet infrastructure. The SDK returns: RAIN_403 with transactionSimulationFailed when the transaction is expected to revert. RAIN_501 with providerError for other provider failures. Keep a loading or progress state visible until the send request completes. Fee estimates are informational. Estimates keep quoting the network cost even when the user won’t pay it, so you can show “Network fee: $0.02, paid by us” if you like.

Solana considerations

Sponsorship covers the transaction fee, not rent. When the recipient has never held the token being sent, the transfer creates their associated token account, and the rent for it (about 0.002 SOL) comes from the sender. A sender with zero SOL can therefore send USDC to an existing USDC holder but not to a fresh address. The SDK checks this before sending and throws RAIN_402 with the shortfall; show it as “You need a small amount of SOL (about 0.002) to send USDC to someone who hasn’t held it before.”

Check sponsorship at runtime

Do not assume gas sponsorship is enabled. Check the provider’s capabilities for gasSponsorship and use that value to determine how you present network fee messaging in your UI.

What’s next

Sending funds

The full send flow, fee estimates, and error handling.

Chain support

Where the wallet can send and sponsor.