How Circle's Gas Station Uses Fee Payers to Enable Gasless Transactions on Solana

USDC Programmable Wallets Stablecoins Gas Station Developer Solana

Blog_gasless-solana-transactions

How to Enable Gasless Transactions on Solana

Gas fees are often a stumbling block for developers building apps on the blockchain. To eliminate this barrier, you can implement fee payer wallets on Solana using Circle’s Programmable Wallets and Gas Station to sponsor gas fees for your users. This enables you to simplify the transaction experience for users making payments in your app.

Introduction

For any blockchain-enabled app, managing transaction fees is a crucial aspect of ensuring a smooth user experience. The need to think about and pay gas fees can deter users from interacting with your app because these fees aren’t present in traditional web and mobile apps today. Circle’s Gas Station feature allows you to sponsor these fees, removing an avoidable hurdle and increasing user acquisition and retention.

What is a fee payer?

A fee payer is an account on Solana that covers the transaction fees on behalf of the user. This avoids the need for users to acquire and manage native tokens like SOL for transaction fees. By sponsoring these fees, developers can simplify the user experience, making it easier for your users to engage with your app.

Advantages of fee payers

  • Simplified onboarding: Users can start interacting with your app without worrying about acquiring native tokens like SOL.
  • Increased user acquisition: Reducing steps to take the first action on your app will mitigate a common pain point—low user acquisition.

Circle’s Implementation of Fee Payers

Let's break down how Circle’s Programmable Wallets and Gas Station work together to create fee payer wallets.

Programmable Wallets

Programmable Wallets makes it easy to create flexible in-app wallets for blockchain use cases. This wallet infrastructure enables your users to send and receive assets, interact with smart contracts, and mint NFTs without requiring them to handle private keys or understand blockchain complexities.

User-controlled wallets give users full autonomy over their digital assets, supported by secure authentication methods like social logins, email, or PIN.

Conversely, developer-controlled wallets allow developers to manage users' wallets, streamlining blockchain interactions on the user’s behalf.

For both key ownership models, Circle employs multi-party computation (MPC) technology to ensure high security and help prevent unauthorized access to user funds.

Gas Station

Circle’s Gas Station simplifies the process of sponsoring gas fees. Developers can create policies to specify the conditions under which transactions are sponsored.

How does Gas Station support fee payers?

Gas Station features a collection of Solana fee payer accounts that are designated to sponsor gas fees for wallets initiating transfers. Here's how it works:

First, the wallet creates a transaction based on the user's request and sends it to Gas Station for further processing. Gas Station then uses the Key Management System (KMS) to sign the transaction with the fee payer's wallet. After signing, the Gas Station returns the signed transaction back to the wallet, which subsequently calls the KMS again to sign the transaction with the end user's wallet address.

Once fully signed, the transaction is broadcast to a full node for inclusion on the blockchain. Gas Station then updates to reflect the transaction history in the Developer Console.

Gas Station facilitates the payment of gas fees for transactions originating from eligible programmable wallets. Circle's fee payer wallets enable the developer to pay fees on your users' behalf. This setup allows you to abstract gas fees completely, providing a seamless user experience without sacrificing the security or integrity of user transactions.

 

Guide to Using Fee Payers

Part 1: Create developer-controlled EOA wallets on Solana

To get started, you need to create a developer-controlled, externally owned account (EOA) wallet on Solana. This wallet will be used to sponsor transaction fees. Follow these steps to create two wallets using Circle's developer-controlled wallet quickstart guide on testnet. Make sure when creating your wallets that you select SOL-DEVNET in the Create your first wallets section, then return here.

image2

Part 2: Source Testnet USDC from Faucet

Next, you need to supply your newly created wallet with testnet USDC so you have something to transfer and create a Gas Station policy that covers transactions for your wallets. On testnet, Circle takes care of both of these steps automatically or you can add from the faucet if needed. On mainnet, you can:

  1. Transfer USDC to a wallet address
  2. Set up and activate a policy by following this tutorial

image3

Part 3: Send a sponsored transaction

As you continue with the tutorial, you will send a transaction transferring USDC from one of your created wallets to the other. Since this transaction falls within the default policy on testnet, the gas fees will be covered.

You can now start sending sponsored transactions. It's as simple as sending any transaction that meets the policy requirements you set up. After setting up and activating a policy, you can initiate a transaction from one developer-controlled wallet, like transferring USDC as you're about to do. If a transaction meets policy criteria that hasn't reached its daily limit and the transaction doesn't exceed the transaction limit, Gas Station will cover the gas fees automatically. This setup allows users to interact with your app without needing to manage SOL themselves.

image1-1

Wrapping Up

You can go to your developer-controlled wallets to see that the sending wallet has all of its funds and view a summary of your gas station policies. If you click into your SOL-DEVNET policy, you can see how much gas has been charged to this policy as a fee payer.

Benefits of Implementing Fee Payers

 

Onboarding new users

Simplifying the onboarding process by covering initial transaction fees makes it easier for new users to start interacting with your app. This can significantly increase your user base.

Incentivizing beneficial transactions

Motivate users to engage in desirable actions by sponsoring specific transaction fees. For example, you can cover the fees for transactions that contribute to network growth or user engagement.

Increasing user retention

By eliminating the barrier of transaction fees, you create a more familiar and enjoyable user experience. This encourages users to continue using your app.

 

Conclusion

Fee Payer wallets provide an effective solution for sponsoring blockchain transaction fees from users. By leveraging Circle’s Programmable Wallets and Gas Station, you can streamline your user experience. Get started for free.

New call-to-action

*Circle Technology Services, LLC (“CTS”) is a software provider and does not provide regulated financial or advisory services. You are solely responsible for services you provide to users, including obtaining any necessary licenses or approvals and otherwise complying with applicable laws. For additional details, please click here to see the Circle Developer terms of service.

Back to top