> ## 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.

# Gas sponsorship

> Who pays for gas in the Startale ecosystem, and how the App SDK and AA SDK plug into the same paymaster infrastructure.

Smart accounts on Soneium do not need users to hold native ETH to transact. Gas is paid by a **paymaster** that co-signs each UserOperation. Whether *your* users see a gasless flow depends on **where the transaction is signed** and **which paymaster you wire into the SDK**.

## The two-tier sponsorship model

```mermaid theme={null}
flowchart LR
  subgraph Host["Inside the Startale App (host)"]
    MA[Mini App]
    HostUO[UserOperation]
    HostPM[Startale host paymaster]
    MA --> HostUO
    HostUO --> HostPM
  end
  subgraph External["Standalone dApp"]
    Dapp[Standalone web app<br/>using @startale/app-sdk]
    DappUO[UserOperation]
    OwnPM[Your paymaster<br/>(SCS managed/self-funded<br/>or your ERC-7677 service)]
    UserPays[User pays gas<br/>from smart account]
    Dapp --> DappUO
    DappUO -->|paymasterOptions configured| OwnPM
    DappUO -->|no paymaster configured| UserPays
  end
```

**Tier 1, inside the Startale App.** Transactions that originate from a Mini App running inside the Startale App host are sponsored by Startale's host paymaster. Mini App developers do not configure anything; gas is invisible to the user and to your code.

**Tier 2, standalone dApps.** When your app integrates `@startale/app-sdk` outside of the Startale App (a normal website, a desktop app, a mobile webview), Startale does **not** sponsor gas for your transactions. You either:

1. Configure your own paymaster through `paymasterOptions` (recommended), or
2. Let the user pay gas out of their smart account's ETH balance.

<Note>
  This is the **intended** model. If you are seeing legacy behavior where a standalone dApp's gas is silently sponsored, treat it as transitional. Build against the model documented here so you do not have to migrate later.
</Note>

## Who pays in each context

| Context                                                                       | Sponsored by Startale | Bring your own paymaster | User pays |
| ----------------------------------------------------------------------------- | --------------------- | ------------------------ | --------- |
| Mini App inside the Startale App                                              | yes                   | no                       | no        |
| In-app actions (swaps, transfers in the Startale App itself)                  | yes                   | no                       | no        |
| Standalone dApp using `@startale/app-sdk`, with `paymasterOptions` configured | no                    | yes                      | no        |
| Standalone dApp using `@startale/app-sdk`, with no paymaster                  | no                    | no                       | yes       |
| Backend service using `@startale-scs/aa-sdk` directly                         | no                    | yes                      | yes       |

## How the paymasters fit together

The App SDK and the AA SDK target the same infrastructure. The App SDK is a higher-level wrapper that ultimately produces ERC-4337 UserOperations and forwards them to a paymaster. The AA SDK is the lower-level toolkit you would use to build a paymaster service or to integrate AA without the host popup.

```mermaid theme={null}
flowchart TB
  subgraph User["User-facing layer"]
    AppSDK["@startale/app-sdk<br/>(EIP-1193 + wagmi)"]
    Mini[Mini App in host]
  end
  subgraph Paymaster["Paymaster layer (ERC-7677 RPC)"]
    Host[Startale host paymaster]
    SCS[SCS Managed / Self-funded paymaster<br/>(provisioned in SCS Portal)]
    Custom[Your own ERC-7677 service]
  end
  subgraph Account["Account layer"]
    AA["@startale-scs/aa-sdk"]
    Bundler[SCS Bundler]
    EP[EntryPoint v0.7]
  end

  Mini --> Host
  AppSDK -->|paymasterOptions[chainId]| SCS
  AppSDK -->|paymasterOptions[chainId]| Custom
  Host --> Bundler
  SCS --> Bundler
  Custom --> Bundler
  AA --> SCS
  AA --> Bundler
  Bundler --> EP
```

The takeaway: the App SDK lets you point at any ERC-7677 paymaster service. The simplest production path is to provision an [SCS paymaster](/aa-sdk/tutorials/portal) (managed or self-funded) and pass its URL and `paymasterId` through `paymasterOptions`. You can also self-host an ERC-7677 service if you need custom rules.

## Deciding what to do

<CardGroup cols={2}>
  <Card title="I am building a Mini App" icon="puzzle-piece" href="/miniapps/overview">
    Do nothing. Gas is sponsored by the host.
  </Card>

  <Card title="I am building a standalone dApp" icon="desktop" href="/app-sdk/gasless">
    Configure `paymasterOptions` with an SCS paymaster, or accept that users pay gas.
  </Card>

  <Card title="I want fine-grained sponsorship rules" icon="sliders" href="/app-sdk/custom-paymaster">
    Run an ERC-7677 service that sponsors selectively (per user, per call, per policy).
  </Card>

  <Card title="I am working at the AA layer" icon="cpu" href="/aa-sdk/tutorials/portal">
    Use the AA SDK directly with the SCS paymaster. The App SDK is built on this.
  </Card>
</CardGroup>

## Networks

Both Soneium Mainnet and Soneium Minato run [EntryPoint v0.7](/aa-sdk/resources/supported-networks#what-entrypoint-v0-7-means-for-you). The same paymaster RPC handles both networks; you select the network with the chain id passed to the SDK.

| Network         | Chain ID | Default sponsorship in Mini App |
| --------------- | -------- | ------------------------------- |
| Soneium Mainnet | 1868     | yes                             |
| Soneium Minato  | 1946     | yes                             |

## Related

<CardGroup cols={2}>
  <Card title="App SDK gasless reference" icon="bolt" href="/app-sdk/gasless">
    The exact code paths for sponsored, custom-paymaster, and user-pays flows.
  </Card>

  <Card title="Custom paymaster" icon="gas-pump" href="/app-sdk/custom-paymaster">
    Wire an SCS paymaster or your own ERC-7677 service into the App SDK.
  </Card>

  <Card title="AA SDK paymaster modes" icon="folder" href="/aa-sdk/tutorials/portal">
    Provision a managed or self-funded paymaster in the SCS Portal.
  </Card>

  <Card title="ERC-20 paymaster" icon="coins" href="/aa-sdk/tutorials/erc20-payment">
    Charge gas in a token instead of native ETH.
  </Card>
</CardGroup>
