> ## Documentation Index
> Fetch the complete documentation index at: https://docs.startale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Who pays for gas

> Gas payment for Startale smart accounts depends on where your application runs. Mini Apps are sponsored by the Startale App. Standalone applications supply their own paymaster or let the user pay.

Every transaction from a Startale smart account is an ERC-4337 UserOperation. The gas for that operation is paid either by a **paymaster** that co-signs it, or by the smart account itself out of its own ETH balance.

Which of the two applies is decided by one thing: where your application runs.

## The two contexts

```mermaid theme={null}
flowchart LR
  subgraph Host["Inside the Startale App"]
    MA[Your Mini App] --> HostPM[Startale App<br/>sponsors gas]
  end
  subgraph Own["On your own origin"]
    App["Your application<br/>using @startale/app-sdk"]
    App -->|paymasterOptions set| Yours[Your paymaster<br/>pays gas]
    App -->|no paymasterOptions| User[User pays gas from<br/>their smart account]
  end
```

| | Mini App inside the Startale App | Standalone application |
| - | - | - |
| Where it runs | An iframe inside the Startale App | Your own website, webview, or desktop shell |
| Who pays gas | The Startale App | Your paymaster, or the user |
| What you configure | Nothing | `paymasterOptions`, or nothing if the user pays |

## Mini Apps are sponsored by the Startale App

Transactions that originate from a Mini App running inside the Startale App are sponsored by Startale. Gas is invisible to your code and to the user, and there is nothing to configure. Do not set `paymasterOptions` in a Mini App; the host uses its own paymaster and ignores yours.

Sponsorship carries two limits:

* **Ethereum Mainnet is capped per user.** Mini Apps run on Soneium only unless enabled for another chain. For a Mini App enabled for Ethereum Mainnet, the first three Ethereum Mainnet transactions per user are sponsored, counted per user across the Startale App. After that the user pays from their smart account's ETH balance. Soneium transactions are not capped.
* **Sponsorship is an operated service, not a guarantee.** Startale can withdraw sponsorship for a specific app, for example when its transactions generate abnormal gas cost. If that happens the user pays, and your flows should surface the resulting failure rather than retrying silently.

See [Gas in a Mini App](https://docs.startale.com/miniapps/wallet-integration.md#gas) for the Mini App call sites.

## Standalone applications supply their own paymaster

When your application uses `@startale/app-sdk` from your own origin, Startale does not sponsor its gas. You choose between two outcomes:

1. **You pay.** Configure a paymaster through `paymasterOptions`. The Startale App forwards paymaster requests to the service you name and your paymaster settles the gas.
2. **The user pays.** Configure nothing. The UserOperation is still built and submitted, and gas comes out of the user's smart account ETH balance.

There is no third option in which Startale absorbs the cost. Both outcomes are supported, and choosing the second is a legitimate decision for internal tooling or for applications whose users already hold ETH. It is not a legitimate default for a consumer flow, because a user with an empty smart account simply cannot transact.

[Gas in a standalone application](https://docs.startale.com/app-sdk/gasless.md) covers both paths in code.

## Where Startale's responsibility ends

For a standalone application, the Startale App accepts a paymaster URL from your application and forwards ERC-7677 paymaster requests to it. That forwarding is the extent of the platform's involvement. Everything about the paymaster itself is operated by you.

| Startale is responsible for | You are responsible for |
| - | - |
| Accepting `paymasterOptions` and forwarding paymaster requests to your URL | Running or procuring the paymaster service |
| Building, signing, and submitting the UserOperation | Funding it, and keeping it funded |
| Sponsoring Mini App transactions inside the Startale App | Every sponsorship rule it applies |
| | Protecting the credentials it uses |

Your paymaster URL travels in your application's client code, so treat it as public from the first day. A paymaster that accepts any request from any caller will be drained by someone other than your users. [Secure your paymaster](https://docs.startale.com/app-sdk/paymaster-security.md) is not optional reading.

## Which paymaster services work

Any service that implements [ERC-7677](https://eips.ethereum.org/EIPS/eip-7677) works. The integration is provider-neutral: the App SDK attaches your paymaster URL to the request as a `paymasterService` capability, and the Startale App forwards `pm_getPaymasterStubData` and `pm_getPaymasterData` to it, whoever operates it. Common choices are a hosted gas manager from an infrastructure provider, or a service you run yourself when you need sponsorship rules a hosted product cannot express.

## Pick your path

> [card] [I am building a Mini App](https://docs.startale.com/miniapps/wallet-integration.md#gas)
>
> Nothing to configure. Read the caps and the failure modes.

> [card] [I am building a standalone application](https://docs.startale.com/app-sdk/gasless.md)
>
> Configure `paymasterOptions`, or design for the user paying gas.

> [card] [I need the paymaster wire format](https://docs.startale.com/app-sdk/custom-paymaster.md)
>
> The ERC-7677 methods, request shape, and the constraints the host applies.

> [card] [I need to protect my paymaster](https://docs.startale.com/app-sdk/paymaster-security.md)
>
> Proxy your credentials and write a sponsorship policy that holds.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.