> ## Documentation Index
> Fetch the complete documentation index at: https://rain-sandbox-trial.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Gas Sponsorship

> How Rain pays network fees for supported wallet transactions, which chains are covered, and how sponsored sends behave.


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](/sdks/embedded-wallets/features#blockchain-support).

| | Sponsored | Notes |
| - | :-: | - |
| EVM network fees on Base, Arbitrum, Optimism, Polygon, BNB, Monad, Ethereum, and supported testnets | ✅ | Users do not need to hold the native gas token to send supported assets |
| Solana network fees on mainnet and devnet | ✅ | Users do not need to hold the native gas token to send supported assets |
| Solana rent for a recipient’s first token account | ❌ | The sender must have enough SOL to cover account creation when required |
| Fees on Avalanche, Celo, ZKsync, and Plasma | — | Outbound transactions are not supported on these chains |
| Fees for wallets provided through Portal or Privy | ❌ | Gas handling is determined by the third party wallet provider |

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.

<CodeGroup>
  ```swift iOS theme={null}
  let wallet = RainProvider()                                        // sponsored (default)
  let selfPaid = RainProvider(RainWalletConfig(sponsorGas: false))   // user pays gas
  ```

  ```kotlin Android theme={null}
  val wallet = RainProvider(application)                                             // sponsored (default)
  val selfPaid = RainProvider(application, RainWalletConfig(sponsorGas = false))     // user pays gas
  ```
</CodeGroup>

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

<Columns cols={2}>
  <Card title="Sending funds" icon="paper-plane" href="/docs/embedded-wallets/sending-funds">
    The full send flow, fee estimates, and error handling.
  </Card>

  <Card title="Chain support" icon="link" href="/sdks/embedded-wallets/features#blockchain-support">
    Where the wallet can send and sponsor.
  </Card>
</Columns>
