Gas Station - High-Level Guide

Shinami’s Gas Station: abstract away gas fees for a streamlined UX

What's included?

This guide provides a high-level summary of the benefits of sponsoring transactions with Shinami's Gas Station. It shows you an image of the entire sponsorship flow, from when a transaction is initiated through sponsorship and execution. It shows you how to set up a Gas Station fund in your Shinami account and how to get free Testnet Sui for it. Finally, it covers the developer resources we have for getting up and running with Gas Station.

Why sponsor transactions?

If you don't sponsor transactions, users need to have wallet with a SUI balance to pay gas fees. This typically involves KYC to purchase Sui and transfer it to their wallet, which is a lot friction for Web2-native users. If this is a requirement for using your app, you'll miss out on a lot of potential users.

However, apps on Sui can sponsor their end user's transactions to remove this friction, improving onboarding conversion and user experience. You just deposit Sui in a fund in your Shinami account, and then our Gas Station handles the management and optimization of gas credits (Sui) to facilitate sponsored transactions.

Integrating Shinami's Gas Station with your app is very simple, and we have comprehensive API documentation - including a tutorial with all the sample code you need to get started.


End-to-end flow

Diagram

Summary of steps

  1. App creates a Gas Station fund in the Shinami dashboard.
  2. App sends SUI to the fund to pay for upcoming sponsorships.
  3. An end user interaction with the app initiates a transaction. For example the user could ask to mint an NFT or the app could give the user a free NFT for accomplishing some goal.
  4. App constructs the mint NFT transaction without a gas object under the hood (check out our TypeScript tutorial for examples).
  5. App sends it to the Shinami Gas Station for sponsorship via a gas_sponsorTransactionBlock request.
  6. Gas station sponsors the transaction from the app's fund and produces the full transaction data and sponsor signature needed for execution.
  7. A signature is obtained from the user's wallet in one of the following ways
    1. Programmatically on the backend with no user action via an app-controlled Invisible Wallet or a user-controlled zkLogin wallet.
    2. User is presented a pop-up to confirm and sign (connected, self-custody wallet).
  8. App submits the transaction with sponsor and sender signature to the Sui blockchain by making a sui_executeTransactionBlock request to Shinami Node Service, which provides enterprise-grade infrastructure to read and write to the Sui blockchain.

Creating a Gas Station fund and depositing Sui

Creating a fund

You create Gas Station funds within the Shinami dashboard. A fund is tied to one network (Testnet, Mainnet) and you can have multiple funds per network.

Depositing Sui in a fund

Once your fund has been created, you can add gas credits to it by sending Sui to its address. To find your fund's address, either click the "View" button in its row in the Funds table, or click the "+ Add Gas Credits" button above the table:

Here, we clicked "View". In the modal that pops up, you will be able to see fund details and deposit history. Copy your fund wallet address and send SUI to it to add gas credits for sponsoring transactions:

Getting Testnet Sui

You can get free Testnet Sui using one of the following methods and then transfer them to your Gas Station fund address.

Mysten Discord Testnet faucet

Here's an image of requesting Testnet Sui from the #testnet-faucet channel of the Mysten Discord server. - just type !faucet {{SuiAddressOfYourGasStationFund}} for 1 Sui (which might not seem like much, but gas is cheap so a few Sui gets you a lot of test transactions).

Ethos Wallet Testnet faucet

Ethos wallet also has a button to request 1 Sui at a time (make sure you've selected Testnet in your settings for the wallet).

Then, you can send that Sui to your fund address:

Using Sui from a fund for sponsorship

When you set up an API access key with Gas Station rights for a network, you link it to a fund on that network. Then, whenever you make an API request to sponsor a transaction, we pull Sui from the fund linked to the API key you use.


Developer resources

Gas Station only

Gas Station + Invisible Wallets and zkLogin wallets

  • Our Invisible Wallet TypeScript Tutorial provides end-to-end sample code for setting up an app-controlled wallet on behalf of a user and sponsoring a transaction for it with Shinami Gas Station.
  • Our zkLogin wallet Next.js Tutorial helps you quickly set up your first zkLogin app that integrates with Shinami Gas Station for transaction sponsorship.